# Agent Brain (`agent-brain`)

**Agent Brain** · 8 MESH / call · cognition · calls 1065 (house 1065 / external 0)

Reason over a question or task with your agent's own persistent memory in the loop: recalls up to 12 relevant memories from your agent's private scope, reasons with Claude, and writes up to 3 new memories back, so the agent improves with every call. Recall by meaning, not just keyword, when the estate's memory server is reachable (falls back to its own always-on store otherwise — never fails the call). Use for decisions that should build on what the agent already knows; agent-memory covers plain store/recall. Runs claude-haiku-4.5 — the response names the model that served the call; agent-brain-smart runs the identical contract on claude-sonnet-5. Input: {think: string}. Returns {answer, reasoning, confidence, memories_considered, used_memories, learned, model, engine}.

## Input schema

```json
{
 "type": "object",
 "properties": {
  "think": {
   "type": "string",
   "description": "The question or task to reason over. Trimmed and truncated to 4000 chars. Aliases question/task/input are full equivalents (first non-empty wins)."
  },
  "question": {
   "type": "string",
   "description": "Alias for think."
  },
  "task": {
   "type": "string",
   "description": "Alias for think."
  },
  "input": {
   "type": "string",
   "description": "Alias for think."
  },
  "character": {
   "type": "string",
   "description": "Optional per-character memory sub-scope (game NPCs): slugified, truncated to 48 chars. Aliases: as, npc."
  },
  "as": {
   "type": "string",
   "description": "Alias for character."
  },
  "npc": {
   "type": "string",
   "description": "Alias for character."
  }
 },
 "anyOf": [
  {
   "required": [
    "think"
   ]
  },
  {
   "required": [
    "question"
   ]
  },
  {
   "required": [
    "task"
   ]
  },
  {
   "required": [
    "input"
   ]
  }
 ],
 "additionalProperties": true
}
```

## Call it

MCP — POST https://market.meshtool.ai/mcp (streamable HTTP), `tools/call` `agent-brain`:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "agent-brain",
    "arguments": {
      "input": {
        "think": "…",
        "question": "…",
        "task": "…",
        "input": "…",
        "character": "…",
        "as": "…"
      }
    }
  }
}
```

REST — `POST /api/call/agent-brain`:

```bash
curl -X POST https://market.meshtool.ai/api/call/agent-brain \
  -H 'Authorization: Bearer $MESH_KEY' \
  -H 'content-type: application/json' \
  -d '{"input":{"think":"…","question":"…","task":"…","input":"…","character":"…","as":"…"}}'
```

No key? A call without one returns HTTP 402 with the price and `POST /api/accounts` to mint a free key with starter MESH.

- JSON record: https://market.meshtool.ai/c/agent-brain.json
- Catalog: https://market.meshtool.ai/api/capabilities · Manifest: https://market.meshtool.ai/.well-known/mcp.json · OpenAPI: https://market.meshtool.ai/openapi.json
