[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79K8Y53PRCQ9Z2CM4Y1EZY8":3,"skill-same:01M79K8Y53PRCQ9Z2CM4Y1EZY8":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":36,"ownerHtmlUrl":37,"ownerBlogUrl":38,"ownerDescription":6,"updatedAt":39,"install":40,"resources":53},"01M79K8Y53PRCQ9Z2CM4Y1EZY8","agentverse-memory",null,"Give any AI agent persistent, graph-native memory via Agentverse Memory — a managed MCP service with 35 JSON-RPC tools covering 4 memory types (episodic, semantic\u002Fgraph, procedural, working) plus shared multi-agent memory spaces. Zero LLM at write time (\u003C5ms writes, $0 ingest). Graph memory on every tier — including free. Hybrid retrieval (TF-IDF + dense, RRF-fused). Requires AM_API_KEY env var. Use when asked to store memories, recall past events, build a knowledge graph, share memory between agents, or retrieve facts about users\u002Ftasks.","fetchai\u002Fagentverse-skills","fetchai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F40889903?v=4","01M79K80S0ZCQC0VZBA6574NTC","Fetch.AI","01M79K80SP4PR66CPHS0RP1QSH",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills\u002Fblob\u002Fmain\u002Fskills\u002Fagentverse-memory\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: agentverse-memory\ndescription: >\n  Give any AI agent persistent, graph-native memory via Agentverse Memory —\n  a managed MCP service with 35 JSON-RPC tools covering 4 memory types\n  (episodic, semantic\u002Fgraph, procedural, working) plus shared multi-agent\n  memory spaces. Zero LLM at write time (\u003C5ms writes, $0 ingest). Graph memory\n  on every tier — including free. Hybrid retrieval (TF-IDF + dense, RRF-fused).\n  Requires AM_API_KEY env var.\n  Use when asked to store memories, recall past events, build a knowledge\n  graph, share memory between agents, or retrieve facts about users\u002Ftasks.\nlicense: Apache-2.0\ncompatibility: Python 3.9+, network access, AM_API_KEY env var\nmetadata:\n  version: \"1.3.2\"\n  author: \"Fetch.ai\"\n  last-updated: \"2026-06-30\"\nallowed-tools: Read Bash(python3 *) Bash(curl *) Bash(mem *) Bash(pip install requests)\n---\n\n# Agentverse Memory\n\n## Overview\n\nGive any AI agent persistent, graph-native memory. Agentverse Memory is a managed MCP service that exposes **35 JSON-RPC 2.0 tools** for:\n\n| Memory Type | What it stores | Key tools |\n|-------------|----------------|-----------|\n| **Episodic** | Time-stamped events, observations, conversations | `memory_store_episode`, `memory_search_episodes` |\n| **Entity** | Named entities with typed properties | `memory_store_entity`, `memory_get_entity` |\n| **Graph** | Knowledge graph triples, traversal, pathfinding | `memory_traverse_graph`, `memory_find_path` |\n| **Procedural** | Goal-directed skill sequences with outcome tracking | `memory_store_procedure`, `memory_match_procedure` |\n| **Working** | Ephemeral key-value scratchpad (TTL-aware) | `memory_set_working`, `memory_get_working` |\n| **Shared** | Multi-agent shared knowledge spaces | `memory_create_shared_space`, `memory_shared_query` |\n| **Pheromone** | Stigmergic trails on memory paths | `memory_deposit_pheromone`, `memory_get_pheromone` |\n\n**Key differentiators:**\n- 🚀 **\u003C5ms writes, $0 ingest** — zero LLM inference at write time. Embeddings are computed lazily on the *read* path and cached per agent, so ingestion never pays an LLM\u002Fembedding bill. This is the core cost moat.\n- 🌐 **Graph memory on every tier — including free.** Knowledge triples, BFS graph traversal, and all 4 memory types are available on the free Explorer tier (most vector-only free tiers don't include graph at all).\n- 🔀 **Hybrid retrieval by default** — lexical (TF-IDF) and dense (`text-embedding-3-small`) candidate sets fused via Reciprocal Rank Fusion (RRF, k=60). Live default-on in production.\n- 🐜 **Pheromone-guided retrieval (opt-in)** — stigmergic trails that boost frequently-recalled memories. Best for warm-cache \u002F repeated-access and multi-agent shared workloads; off by default for single-pass queries.\n- 🔗 **MCP-native** — 35 tools over JSON-RPC; works with Claude, Cursor, Codex, Copilot, Gemini CLI.\n\n> **Positioning (honest):** Agentverse Memory competes on **total cost of ownership** ($0 write-time inference), **graph at every tier**, **native MCP**, and **multi-agent pheromone transfer** — not on a claim of higher raw retrieval accuracy than other systems. Keep the headline on cost and capabilities.\n\n## When to Use\n\n- Agent needs to **remember things** across conversations\u002Fsessions\n- Agent needs to **build a knowledge graph** from interactions\n- Agent needs to **find connections** between concepts (graph traversal, shortest path)\n- Agent needs to **share knowledge** with other agents (shared spaces)\n- Agent needs a **scratchpad** for active task state (working memory)\n- Agent needs to **recall what it knew at a specific time** (temporal queries)\n- Agent needs to **reuse proven workflows** across tasks (procedural memory)\n\n## When NOT to Use\n\n- You want in-process (local) memory → use Python dict \u002F Redis directly\n- You only need simple key-value storage with no graph → use `memory_set_working`\n- You want vector similarity search only (no graph) → any vector DB works\n\n## Prerequisites\n\n- `AM_API_KEY` environment variable set (prefix: `am_`)\n  - Get a free key (real response shape shown below):\n    ```bash\n    curl -X POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fv1\u002Fkeys \\\n      -H \"Content-Type: application\u002Fjson\" \\\n      -d '{\"agent_id\":\"my-agent\",\"tier\":\"explorer\"}'\n    # → {\"agent_id\":\"my-agent\",\"key\":\"am_xxxxxxxx\",\"key_id\":\"...\",\n    #    \"monthly_op_limit\":50000,\"tier\":\"explorer\",\"warning\":\"Store this key securely...\"}\n    ```\n    The field is **`key`** (not `api_key`) and the limit is **`monthly_op_limit`** (not `ops_per_month`).\n- Python 3.9+ with `requests`:\n  ```bash\n  pip install requests\n  ```\n\n> **Onboarding paths that work today:**\n> 1. The bundled **`scripts\u002Fmemory_client.py`** CLI (recommended — covers the common operations).\n> 2. **Raw curl \u002F MCP** calls to `…\u002Fmcp` (works from any language).\n>\n> A first-party **Python \u002F TypeScript SDK is coming soon** (pending package publish). The PyPI\u002Fnpm packages are *not yet live*, so don't rely on `pip install agentverse-memory` \u002F `npm install @fetchai\u002Fagentverse-memory` yet — use the bundled script or raw MCP for now.\n\n## Quick Steps\n\n### 1. Get a free API key\n```bash\ncurl -X POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fv1\u002Fkeys \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"agent_id\": \"my-agent\", \"tier\": \"explorer\"}'\n# → {\"agent_id\":\"my-agent\",\"key\":\"am_xxxxxxxxxxxxxxxx\",\"key_id\":\"...\",\n#    \"monthly_op_limit\": 50000, \"tier\": \"explorer\", \"warning\": \"...\"}\n\n# Export the value of the \"key\" field:\nexport AM_API_KEY=\"am_xxxxxxxxxxxxxxxx\"\n```\n\n### 2. Check service health\n```bash\ncurl https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fhealth\n# → {\"service\":\"am-server\",\"status\":\"ok\",\"version\":\"0.1.0\"}\n```\n\n### 3. Store an episodic memory\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py store-episode \\\n  --agent-id \"my-agent\" \\\n  --content \"User Alice asked about quantum computing and preferred simple analogies\"\n```\n\n### 4. Query episodic memories (hybrid retrieval)\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py query-episodes \\\n  --agent-id \"my-agent\" \\\n  --query \"quantum computing preferences\" \\\n  --limit 5\n# Result includes \"retrieval\":\"hybrid\" (TF-IDF ∪ dense, RRF-fused).\n# Add --no-hybrid to force lexical-only, or --use-pheromone for warm-cache re-ranking.\n```\n\n### 5. Store a knowledge graph fact\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py store-fact \\\n  --agent-id \"my-agent\" \\\n  --subject \"Alice\" \\\n  --predicate \"prefers_explanation_style\" \\\n  --object \"simple analogies\"\n```\n\n### 6. Find graph path between concepts (Builder+ tier)\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py find-path \\\n  --agent-id \"my-agent\" \\\n  --start \"Alice\" \\\n  --end \"quantum computing\"\n# A* pathfinding requires the Builder tier or above. On the free Explorer tier\n# use traverse-graph (BFS), which is available everywhere.\n```\n\n### 7. Working memory scratchpad\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py set-working \\\n  --agent-id \"my-agent\" \\\n  --key \"current_task\" \\\n  --value '{\"task\": \"write report\", \"status\": \"in_progress\"}' \\\n  --ttl 3600\n```\n\n### 8. Direct MCP call (curl)\n```bash\ncurl -X POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fmcp \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: $AM_API_KEY\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": 1,\n    \"method\": \"tools\u002Fcall\",\n    \"params\": {\n      \"name\": \"memory_store_episode\",\n      \"arguments\": {\n        \"agent_id\": \"my-agent\",\n        \"content\": \"User prefers dark mode in all interfaces\",\n        \"source\": \"user\"\n      }\n    }\n  }'\n```\n\n> ⚠️ **Onboarding gotcha:** JSON-RPC must be POSTed to the **`\u002Fmcp`** path, not the base URL. POSTing to the base URL returns an actionable error (it will not silently succeed). Always set your endpoint to `…\u002Fmcp`.\n\n### 8b. Bash CLI (`mem`) — optional, shell-first workflows\n\nFor shell-first workflows there is a small `mem` CLI (built around `curl` + `jq`)\ndistributed with the Agentverse Memory service. It wraps the same `\u002Fmcp` endpoint:\n\n```bash\nexport AM_BASE_URL=\"https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\"   # MEM_URL is derived as $AM_BASE_URL\u002Fmcp\nexport AM_API_KEY=\"am_xxxxxxxxxxxxxxxx\"\n\nmem doctor                                            # validate the onboarding chain\nmem episode \"User prefers dark mode\" '{\"tags\":[\"pref\"]}'\nmem search \"dark mode\"\nmem stats\n```\n\n`mem doctor` checks env → `\u002Fmcp` → auth → a metadata round-trip → the usage\nmeter and prints a PASS\u002FFAIL checklist. If you don't have the `mem` CLI installed,\nthe bundled `scripts\u002Fmemory_client.py` (above) covers the same operations and works\nout of the box with only `requests`.\n\n### 9. Python \u002F TypeScript SDK (coming soon)\n\nA first-party SDK is in progress:\n\n```text\n# NOT YET PUBLISHED — do not use yet:\n#   pip install agentverse-memory          (PyPI package not live)\n#   npm install @fetchai\u002Fagentverse-memory (npm package not live)\n```\n\nUntil the packages are published, use `scripts\u002Fmemory_client.py` or call the\n`\u002Fmcp` endpoint directly (any language with an HTTP client works — it's plain\nJSON-RPC 2.0). Track SDK status at the docs site linked under\n[API Reference](#api-reference).\n\n## All 35 MCP Tools\n\n### Episodic Memory (5 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_store_episode` | Store a time-stamped event or observation |\n| `memory_get_episodes` | Retrieve episodes by agent, with pagination |\n| `memory_search_episodes` | Natural-language search — **hybrid retrieval** (TF-IDF ∪ dense embeddings, RRF-fused) |\n| `memory_search_timeline` | Search within a specific time window |\n| `memory_consolidate_episodes` | Merge related episodes into a summary |\n\n### Entity Memory (5 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_store_entity` | Store a named entity with typed properties |\n| `memory_get_entity` | Retrieve entity by name or ID |\n| `memory_list_entities` | List entities with prefix\u002Ftype filter |\n| `memory_store_relation` | Store a typed relationship between two entities (by entity ID) |\n| `memory_get_relations` | Get all relations for an entity |\n\n### Graph Operations (5 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_query_graph` | Keyword graph query over stored triples |\n| `memory_semantic_search` | Vector similarity search across memory types |\n| `memory_get_neighbors` | Get direct neighbors of a graph node |\n| `memory_find_path` | A* pathfinding between concepts (pheromone\u002Fshortest\u002Fsemantic) — **Builder+ tier** |\n| `memory_traverse_graph` | BFS outward from a start node (free on every tier) |\n\n### Graph Direct (3 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_graph_add_triple` | Add a (subject, predicate, object) triple directly |\n| `memory_graph_neighbors` | Get low-level graph neighbors of a node |\n| `memory_graph_shortest_path` | Shortest path between two nodes |\n\n### Procedural Memory (4 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_store_procedure` | Store a named, goal-directed step sequence |\n| `memory_get_procedure` | Retrieve procedure with success\u002Ffail stats |\n| `memory_match_procedure` | Find the best procedure for a task description |\n| `memory_update_procedure` | Update steps or record execution outcome |\n\n### Working Memory (4 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_set_working` | Set key-value with optional TTL (\u003C1ms p50) |\n| `memory_get_working` | Get value by key |\n| `memory_list_working` | List all keys (with prefix filter) |\n| `memory_clear_working` | Delete one key, by prefix, or all |\n\n### Pheromone (2 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_deposit_pheromone` | Deposit a pheromone trail on a memory path |\n| `memory_get_pheromone` | Get the current pheromone weight for a path |\n\n### Shared Memory Spaces (5 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_create_shared_space` | Create a multi-agent shared knowledge space |\n| `memory_join_shared_space` | Join a space by `space_id` (your JWT must grant access — see [Shared Spaces & JWT Authentication](#shared-spaces--jwt-authentication)) |\n| `memory_shared_store_entity` | Store an entity in a shared space |\n| `memory_shared_query` | Query cross-agent memory within a shared space |\n| `memory_list_shared_spaces` | List shared spaces the agent belongs to |\n\n### Utility (2 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_get_stats` | Agent usage stats, counts, rate-limit status |\n| `memory_delete_agent` | Delete all memory for an agent (irreversible) |\n\n### `memory_search_episodes` parameters\n\n| Param | Type | Default | Notes |\n|-------|------|---------|-------|\n| `query` | string | — | Required search text |\n| `limit` | integer | 12 | Max evidence items to return |\n| `use_hybrid` | boolean | `true` | Fuse the TF-IDF candidate set with dense embeddings (RRF). Set `false` for lexical-only. |\n| `use_pheromone` | boolean | `false` | Re-rank by pheromone weight. Best for warm\u002Frepeated-access workloads; off by default. |\n| `max_content_chars` | integer | — | Optional: trim each result's content to N chars to save tokens |\n\nThe result reports the retrieval mode used as `\"retrieval\": \"hybrid\"` or `\"retrieval\": \"tfidf\"`.\n\n## Tool Parameter Reference (all 35 tools)\n\nComplete parameters for every tool, grouped by memory type. Each tool's arguments\ngo inside the JSON-RPC `params.arguments` object (see [Direct MCP call](#8-direct-mcp-call-curl)).\nThe five tools that publish a live `inputSchema` via `tools\u002Flist`\n(`memory_store_episode`, `memory_search_episodes`, `memory_set_working`,\n`memory_graph_neighbors`, `memory_graph_shortest_path`) match the tables below;\nthis section documents the remaining tools that don't yet advertise a schema.\n\n> **Conventions**\n> - **`agent_id` is *not* a tool argument.** Your identity — and which memory palace you read\u002Fwrite — is derived from the `AM_API_KEY` you authenticate with. (The `--agent-id` flag in `memory_client.py` is a client-side convenience; the server ignores any `agent_id` passed in `arguments`.)\n> - `✅` = required · `—` = optional \u002F not applicable · timestamps are **RFC3339** strings (use a `Z` suffix for UTC).\n> - Shared-space tools additionally require **JWT auth** (`Authorization: Bearer \u003Cjwt>`), not just an API key.\n\n### Episodic Memory\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_store_episode` | `content` | string | ✅ | — | Episode text content |\n| | `metadata` | object | — | — | Structured metadata (chunk provenance merged in when content is split) |\n| | `valid_at` | string | — | now | Validity timestamp (RFC3339) |\n| | `chunk` | boolean | — | auto | Force (`true`) \u002F disable (`false`) chunking; auto = chunk only when content > `chunk_threshold` |\n| | `chunk_threshold` | integer | — | 6000 | Auto-chunk content longer than this many chars |\n| | `chunk_size` | integer | — | 2800 | Target chunk size (chars) |\n| | `chunk_overlap` | integer | — | 450 | Overlap between consecutive chunks (chars) |\n| `memory_get_episodes` | `limit` | integer | — | 10 | Max episodes to return (most recent first) |\n| `memory_search_episodes` | `query` | string | ✅ | — | Search text — full detail in the [table above](#memory_search_episodes-parameters) |\n| | `limit` | integer | — | 12 | Max evidence items to return |\n| | `use_hybrid` | boolean | — | server default (**ON** in prod) | Fuse TF-IDF ∪ dense embeddings (RRF) |\n| | `use_pheromone` | boolean | — | server default (**OFF** in prod) | Re-rank by pheromone weight |\n| | `max_content_chars` | integer | — | no trim | Trim each result's content to N chars |\n| `memory_search_timeline` | `start_time` | string | ✅ | — | Window start (RFC3339) |\n| | `end_time` | string | ✅ | — | Window end (RFC3339) |\n| `memory_consolidate_episodes` | `before_time` | string | — | 7 days ago | Consolidate episodes older than this (RFC3339); those with pheromone weight \u003C 0.1 are soft-deleted |\n\n### Entity Memory\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_store_entity` | `entity_id` | string | ✅ | — | Unique entity identifier \u002F name |\n| | `type` | string | — | `\"concept\"` | Entity type |\n| | `description` | string | — | — | Human-readable description |\n| | `predicate` | string | — | — | Predicate (for subject-predicate-object facts) |\n| | `object_value` | string | — | — | Object value (for subject-predicate-object facts) |\n| | `properties` | object | — | — | Structured metadata (alias of `metadata`) |\n| | `metadata` | object | — | — | Structured metadata (takes precedence if both are sent) |\n| `memory_get_entity` | `entity_id` | string | ✅ | — | Entity id\u002Fname to fetch (returns `found:false` if absent) |\n| `memory_list_entities` | `limit` | integer | — | 20 | Max entities to return |\n| `memory_store_relation` | `from_id` | string | ✅ | — | Source entity (UUID **or** name; a new name is auto-created as a stub) |\n| | `to_id` | string | ✅ | — | Target entity (UUID **or** name; auto-created if new) |\n| | `predicate` | string | ✅ | — | Relation label |\n| | `weight` | number | — | 1.0 | Edge weight |\n| `memory_get_relations` | `entity_id` | string | ✅ | — | Entity id\u002Fname whose relations to fetch |\n\n### Graph Operations\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_query_graph` | `query` | string | ✅ | — | Keyword graph query text |\n| `memory_semantic_search` | `query` | string | ✅ | — | Search text (TF-IDF over entities) |\n| | `limit` | integer | — | 10 | Max results |\n| `memory_get_neighbors` | `entity_id` | string | ✅ | — | Entity id\u002Fname to expand from |\n| | `hops` | integer | — | 1 | Neighbor hop depth |\n| `memory_find_path` † | `from_id` | string | ✅ | — | Source node identifier |\n| | `to_id` | string | ✅ | — | Target node identifier |\n| | `max_hops` | integer | — | 6 | Maximum path length (hops) |\n| `memory_traverse_graph` | `start_id` | string | ✅ | — | Starting node identifier |\n| | `algorithm` | string `\"bfs\"`\\|`\"dfs\"` | — | `\"bfs\"` | Traversal algorithm |\n| | `max_depth` | integer | — | 3 | Maximum traversal depth |\n\n> † `memory_find_path` (A* pathfinding) is **tier-gated**: lower tiers receive an in-band `-32002 forbidden` error. Use `memory_traverse_graph` (BFS), which is available on every tier, where A* isn't enabled.\n\n### Graph Direct (low-level triple store)\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_graph_add_triple` | `subject` | string | ✅ | — | Subject node label |\n| | `predicate` | string | ✅ | — | Predicate \u002F edge label |\n| | `object` | string | ✅ | — | Object node label |\n| `memory_graph_neighbors` | `node` | string | ✅ | — | Starting node label |\n| | `depth` | integer | — | 1 | Hop depth (1–5; capped at 5) |\n| | `direction` | string `\"outgoing\"`\\|`\"incoming\"`\\|`\"both\"` | — | `\"outgoing\"` | Edge direction |\n| `memory_graph_shortest_path` | `from` | string | ✅ | — | Source node label |\n| | `to` | string | ✅ | — | Target node label |\n| | `undirected` | boolean | — | false | Traverse edges in both directions |\n\n### Procedural Memory\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_store_procedure` | `name` | string | ✅ | — | Procedure name |\n| | `description` | string | — | — | Description |\n| | `steps` | array&lt;string\\|object&gt; | — | `[]` | Ordered steps: plain strings, or objects `{action, tool?, expected_output?}` |\n| | `tags` | array&lt;string&gt; | — | `[]` | Tags |\n| | `preconditions` | array&lt;string&gt; | — | `[]` | Preconditions |\n| `memory_get_procedure` | `procedure_id` | string | ✅* | — | Procedure UUID — *one of `procedure_id` \u002F `name` required* |\n| | `name` | string | ✅* | — | Procedure name (alternative to `procedure_id`) |\n| `memory_match_procedure` | `task` | string | ✅ | — | Task description to match against stored procedures |\n| | `limit` | integer | — | 5 | Max procedures to return |\n| `memory_update_procedure` | `procedure_id` | string | ✅* | — | Procedure UUID to update — *one of `procedure_id` \u002F `name` required* |\n| | `name` | string | ✅* | — | Procedure name (alternative to `procedure_id`) |\n| | `steps` | array&lt;string\\|object&gt; | ✅ | — | New ordered steps (replaces old; creates a new version) |\n| | `reason` | string | — | — | Reason for the update |\n\n### Working Memory\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_set_working` | `key` | string | ✅ | — | Working memory key |\n| | `content` | string | ✅ | — | Value to store (`value` accepted as a legacy alias; non-strings are JSON-encoded) |\n| | `ttl_seconds` | integer | — | none (no expiry) | Time-to-live in seconds |\n| | `session_id` | string | — | — | Optional session scope |\n| `memory_get_working` | `key` | string | ✅ | — | Key to fetch (returns `found:false` if absent\u002Fexpired) |\n| `memory_list_working` | *(none)* | — | — | — | Lists all live working-memory items |\n| `memory_clear_working` | `key` | string | — | — | Key to delete; **omit to clear ALL** working memory |\n\n### Pheromone\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_deposit_pheromone` | `node_id` | string | ✅ | — | Episode UUID or entity name\u002FID to reinforce |\n| | `strength` | number | — | 1.0 | Pheromone deposit strength |\n| `memory_get_pheromone` | `node_id` | string | ✅ | — | Episode UUID or entity name\u002FID to query |\n\n### Shared Memory Spaces (JWT auth required)\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_create_shared_space` | `name` | string | ✅ | — | Space name (1–128 characters) |\n| `memory_join_shared_space` | `space_id` | string | ✅ | — | Space ID to join (JWT must grant access to it) |\n| | `role` | string `\"owner\"`\\|`\"writer\"`\\|`\"reader\"` | — | `\"writer\"` | Requested role |\n| `memory_shared_store_entity` | `space_id` | string | ✅ | — | Space ID (requires writer\u002Fowner role) |\n| | `name` | string | ✅ | — | Entity name |\n| | `entity_type` | string | — | `\"thing\"` | Entity type |\n| | `description` | string | — | — | Description |\n| `memory_shared_query` | `space_id` | string | ✅ | — | Space ID (requires reader\u002Fwriter\u002Fowner role) |\n| | `query` | string | — | `\"\"` (list all) | Search query; empty\u002Fomitted lists all entities |\n| | `limit` | integer | — | 10 | Max results |\n| `memory_list_shared_spaces` | *(none)* | — | — | — | Lists shared spaces the agent belongs to |\n\n### Utility\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_get_stats` | *(none)* | — | — | — | Usage stats, memory counts, rate-limit status |\n| `memory_delete_agent` | `confirm` | boolean | ✅ | — | Must be `true` to permanently delete all of this agent's memory (irreversible, GDPR) |\n\n## Response Shapes (all 35 tools)\n\nThe top-level keys in each tool's success payload (the `structuredContent` object — see\n[Tool call response](#mcp-protocol-details)). All shapes are verified against the live server.\nFailures instead return `isError:true` + `structuredContent.error{code,type,message}` (see [Edge Cases](#edge-cases)).\n\n### Episodic\n| Tool | Success payload (`structuredContent`) |\n|------|----------------------------------------|\n| `memory_store_episode` | `{ stored:true, id:\"\u003Cuuid>\", ids:[\"\u003Cuuid>\", …], chunks:\u003Cint>, agent_id }` — `id` = first\u002Fonly episode; `ids`\u002F`chunks` reflect auto-chunking |\n| `memory_get_episodes` | `{ episodes:[ \u003CEpisode> … ], count:\u003Cint> }` *(outputSchema)* |\n| `memory_search_episodes` | `{ results:[ { episode, score, … } … ], count:\u003Cint>, retrieval:\"hybrid\"\\|\"tfidf\" }` *(outputSchema)* |\n| `memory_search_timeline` | `{ episodes:[ … ], count:\u003Cint>, window:{ start, end } }` |\n| `memory_consolidate_episodes` | `{ consolidated:\u003Cint>, before:\"\u003Crfc3339>\", note }` |\n\n### Entity\n| Tool | Success payload |\n|------|-----------------|\n| `memory_store_entity` | `{ id:\"\u003Cuuid>\", entity_id, stored:true }` |\n| `memory_get_entity` | found → `{ entity:\u003CEntity>, found:true }` · absent → `{ found:false, entity_id }` |\n| `memory_list_entities` | `{ entities:[ … ], count:\u003Cint> }` *(outputSchema)* |\n| `memory_store_relation` | `{ id:\"\u003Cuuid>\", from_id, to_id, predicate, stored:true }` |\n| `memory_get_relations` | `{ relations:[ … ], count:\u003Cint>, entity_id }` |\n\n### Graph Operations\n| Tool | Success payload |\n|------|-----------------|\n| `memory_query_graph` | Backend graph-query result object (matched nodes\u002Fedges; shape is backend-defined) |\n| `memory_semantic_search` | `{ results:[ { entity, score } … ], count:\u003Cint> }` *(outputSchema)* |\n| `memory_get_neighbors` | `{ neighbors:[ … ], count:\u003Cint>, entity_id, hops:\u003Cint> }` |\n| `memory_find_path` | `{ path:[ … ], hops:\u003Cint>, from_id, to_id }` *(Builder+ tier-license; Explorer → in-band `-32002 forbidden`, fall back to `memory_traverse_graph`)* |\n| `memory_traverse_graph` | `{ visited:[ … ], count:\u003Cint>, start_id, algorithm, max_depth:\u003Cint> }` |\n\n### Graph Direct\n| Tool | Success payload |\n|------|-----------------|\n| `memory_graph_add_triple` | `{ stored:true, triple_id:\"\u003Cuuid>\", subject, predicate, object }` |\n| `memory_graph_neighbors` | `{ node, depth:\u003Cint>, direction, count:\u003Cint>, neighbors:[ { subject, predicate, object } … ] }` |\n| `memory_graph_shortest_path` | `{ from, to, undirected:\u003Cbool>, found:\u003Cbool>, hops:\u003Cint>, path:[ … ] }` |\n\n### Procedural\n| Tool | Success payload |\n|------|-----------------|\n| `memory_store_procedure` | `{ id:\"\u003Cuuid>\", name, stored:true }` |\n| `memory_get_procedure` | found → `{ procedure:\u003CProcedure>, found:true }` · absent → `{ found:false, procedure_id }` |\n| `memory_match_procedure` | `{ results:[ … ], count:\u003Cint> }` |\n| `memory_update_procedure` | `{ new_id:\"\u003Cuuid>\", old_procedure_id, updated:true }` *(creates a new version)* |\n\n### Working\n| Tool | Success payload |\n|------|-----------------|\n| `memory_set_working` | `{ key, set:true, ttl_seconds }` |\n| `memory_get_working` | found → `{ item:\u003CWorkingItem>, found:true }` · absent\u002Fexpired → `{ found:false, key }` |\n| `memory_list_working` | `{ items:[ … ], count:\u003Cint> }` |\n| `memory_clear_working` | single key → `{ key, removed:\u003Cbool> }` · clear-all → `{ cleared:true, keys_deleted:\u003Cint> }` |\n\n### Pheromone\n| Tool | Success payload |\n|------|-----------------|\n| `memory_deposit_pheromone` | `{ node_id, new_weight:\u003Cfloat>, node_type:\"episode\"\\|\"entity\" }` |\n| `memory_get_pheromone` | found → `{ node_id, weight:\u003Cfloat>, node_type }` · absent → `{ node_id, found:false }` |\n\n### Shared Spaces *(JWT auth)*\n| Tool | Success payload |\n|------|-----------------|\n| `memory_create_shared_space` | `{ space_id, name, owner_did, members:\u003Cint>, created_at:\"\u003Crfc3339>\", status:\"created\" }` |\n| `memory_join_shared_space` | `{ space_id, agent_did, role, members:\u003Cint>, status:\"joined\" }` |\n| `memory_shared_store_entity` | `{ space_id, entity_id:\"\u003Cuuid>\", name, entity_type, stored_by, status:\"stored\" }` |\n| `memory_shared_query` | `{ space_id, query, count:\u003Cint>, results:[ { id, name, entity_type, description, score? } … ] }` *(`score` present only for non-empty queries)* |\n| `memory_list_shared_spaces` | `{ agent_did, count:\u003Cint>, spaces:[ { space_id, name, owner_did, my_role, member_count, created_at } … ] }` |\n\n### Utility\n| Tool | Success payload |\n|------|-----------------|\n| `memory_get_stats` | `{ agent_id, tier, monthly_ops_used:\u003Cint>, monthly_op_limit:\u003Cint>, memory:{ episode_count, entity_count, relation_count, procedure_count, working_count } }` *(outputSchema)* |\n| `memory_delete_agent` | `{ agent_id, deleted:true, note }` |\n\n## MCP Protocol Details\n\n**Endpoint:** `POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fmcp`\n**Auth:** `X-API-Key: am_xxxxxxxxxxxxxxxx`\n\n**Protocol version negotiation** — the server implements the current MCP spec and negotiates the protocol version on `initialize`. It accepts versions up to the release candidate **`2026-07-28`** and defaults to **`2025-11-25`** when the client omits or requests an unknown version (it returns a supported version rather than erroring):\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"initialize\",\n  \"params\": { \"protocolVersion\": \"2026-07-28\", \"capabilities\": {},\n              \"clientInfo\": { \"name\": \"my-client\", \"version\": \"1.0\" } } }\n```\n\n**Tool call request:**\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"tools\u002Fcall\",\n  \"params\": {\n    \"name\": \"memory_store_episode\",\n    \"arguments\": { \"agent_id\": \"...\", \"content\": \"...\" }\n  }\n}\n```\n\n**Tool call response** — results carry both a human-readable `content` block **and** a typed `structuredContent` payload, plus an `isError` flag (MCP-spec result shape):\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"result\": {\n    \"content\": [{ \"type\": \"text\", \"text\": \"{\\\"stored\\\":true,\\\"id\\\":\\\"5d9d...\\\"}\" }],\n    \"isError\": false,\n    \"structuredContent\": { \"stored\": true, \"id\": \"5d9d...\", \"ids\": [\"5d9d...\"], \"chunks\": 1 }\n  }\n}\n```\n\n**Errors are reported in-band** — a failing tool call returns `isError: true` with a structured error in `structuredContent.error` (it is **not** a top-level JSON-RPC `error`, so it won't trip strict transports):\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"result\": {\n    \"content\": [{ \"type\": \"text\", \"text\": \"validation error on 'task': required field missing or invalid\" }],\n    \"isError\": true,\n    \"structuredContent\": { \"error\": { \"code\": -32004, \"type\": \"validation_error\",\n                                       \"message\": \"validation error on 'task': ...\" } }\n  }\n}\n```\n(The only protocol-level JSON-RPC error is the auth gate — a missing\u002Finvalid API key.)\n\n**Typed outputs:** five read tools declare an `outputSchema` so clients can validate results without parsing text — `memory_get_episodes`, `memory_search_episodes`, `memory_list_entities`, `memory_semantic_search`, `memory_get_stats`.\n\n**Tools list:** `POST \u002Fmcp` with `{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools\u002Flist\",\"params\":{}}`\n\n## Shared Spaces & JWT Authentication\n\nThe five `memory_*_shared_*` \u002F `memory_create_shared_space` \u002F `memory_join_shared_space` tools are\n**multi-agent** and need a different credential than the rest of the API.\n\n- **Single-agent tools (30):** authenticate with your **API key** (`X-API-Key: am_…` or `Authorization: Bearer am_…`). Fully self-serve via `POST \u002Fv1\u002Fkeys`.\n- **Shared-space tools (5):** require a **JWT** (`Authorization: Bearer \u003Cjwt>`). The server gates access in two steps — **tier first, then JWT**:\n\n  - **Explorer (free) tier** — the tier gate fires first: any shared-space tool call returns an in-band **`-32002` `forbidden`** (`\"forbidden: tier 'explorer' cannot access 'builder' feature\"`). No shared spaces on the free tier; upgrade to Builder ($19\u002Fmo).\n  - **Builder+ tier without a JWT** — the JWT auth gate fires next: returns an in-band **`-32001` `unauthorized`**:\n\n    ```json\n    { \"isError\": true,\n      \"structuredContent\": { \"error\": { \"code\": -32001, \"type\": \"unauthorized\",\n        \"message\": \"unauthorized: Shared space operations require JWT authentication. Use 'Authorization: Bearer \u003Cjwt>' with a valid JWT token.\" } } }\n    ```\n\n### How to obtain a JWT\n\n**Builder+ tiers can now self-serve a JWT via `POST \u002Fv1\u002Fspace-token`!** Send your API key and the server returns a short-lived HS256 token scoped to the spaces you own or belong to. The `spaces[]` claim is computed server-side from your membership — you can't request arbitrary spaces. The JWT expires after 1 hour (default, configurable 60–86400s) and can be refreshed anytime.\n\n```bash\ncurl -s -X POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fv1\u002Fspace-token \\\n  -H \"X-API-Key: am_YOUR_BUILDER_KEY\"\n# → { \"token\": \"eyJ...\", \"token_type\": \"Bearer\",\n#     \"expires_at\": \"2026-06-30T12:26:00Z\", \"expires_in\": 3600,\n#     \"tier\": \"builder\", \"agent_id\": \"agent-abc123\", \"spaces\": [...],\n#     \"usage\": \"Use as Authorization: Bearer \u003Ctoken> with shared-space MCP tools\" }\n```\n\n> **Explorer (free) tier does not include shared spaces.** `\u002Fv1\u002Fspace-token` returns `403 -32002` for Explorer keys. Upgrade to Builder ($19\u002Fmo) for up to 3 owned spaces.\n\nThe server-generated JWT uses these claims:\n\n| Claim | Value \u002F meaning |\n|-------|-----------------|\n| `sub` | Your agent DID — e.g. `did:fetch:agent123abc`. Derived from your API key. |\n| `iss` | Always `agentverse-memory`. |\n| `aud` | Always `am-server`. |\n| `spaces` | Array of space IDs this token may access (computed server-side). `[]` if you haven't created any yet. |\n| `tier` | Your API key's tier (`builder`\\|`pro`\\|`enterprise`). |\n| `exp` | Expiry (Unix seconds, **numeric** — string `exp` is rejected, CVE-2026-25537). |\n| `iat` | Issued-at (Unix seconds). |\n\nWrong `iss`\u002F`aud`\u002Fsignature, an expired token, or a missing required claim are rejected at the auth gate\n(`jwt_invalid_issuer` \u002F `jwt_invalid_audience` \u002F `jwt_invalid_signature` \u002F `jwt_expired` \u002F `jwt_missing_claim`).\n\n**Self-hosted \u002F BYOC:** If you run your own `am-server`, set `JWT_SECRET` env var to enable JWT auth. Without it, `\u002Fv1\u002Fspace-token` returns `503 -32007` (\"JWT_SECRET is unset\"). You'll need to mint tokens yourself using the claim shape above (HS256, with your secret).\n\n### Typical multi-agent flow (self-serve)\n\n1. **Owner** → `POST \u002Fv1\u002Fspace-token` with Builder+ API key → receives JWT.\n2. **Owner** (JWT) → `memory_create_shared_space {name}` → returns `space_id`.\n3. **Owner** → re-mint JWT via `POST \u002Fv1\u002Fspace-token` (now includes the new space in `spaces[]`). Bootstrap complete.\n4. **Collaborators** → each gets their own Builder+ key → `POST \u002Fv1\u002Fspace-token` → JWT scoped to their spaces.\n5. **Members** (JWT) → `memory_join_shared_space {space_id, role}` → roles: `owner` > `writer` > `reader`.\n6. **Writers\u002Fowners** → `memory_shared_store_entity {space_id, name, …}`; **readers+** → `memory_shared_query {space_id, query}`; any member → `memory_list_shared_spaces`.\n\nInsufficient role within a space returns an in-band `-32002` (`forbidden`).\n\n## Pricing\n\n| Tier | Price | Ops\u002Fmonth | Agents | Graph | A* pathfinding | Shared spaces |\n|------|-------|-----------|--------|-------|----------------|---------------|\n| **Explorer** | Free | 50,000 | 3 | ✅ + BFS traversal | ❌ | ❌ |\n| **Builder** | $19\u002Fmo | 500,000 | 25 | ✅ | ✅ A* | ✅ |\n| **Pro** | $99\u002Fmo | 5,000,000 | Unlimited | ✅ | ✅ A* | ✅ Unlimited |\n| **Enterprise** | Custom | Custom | Unlimited | ✅ | ✅ | ✅ |\n\n- All 4 memory types **and** knowledge-graph triples are available on **every tier, including free** — that's the core differentiator vs vector-only free tiers.\n- **Builder** adds A* pathfinding + shared spaces; overage billed at **$0.005 \u002F 1K ops**.\n- **Pro** adds Active Inference + cross-agent queries.\n- **Enterprise** adds SLA, SOC 2, and BYOC (Bring Your Own Cloud).\n\nGet started free: `POST \u002Fv1\u002Fkeys` with `\"tier\": \"explorer\"`.\n\n## API Reference\n\nVerified documentation (all live):\n\n- Docs home: https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002F\n- Docs index: https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002Fdocs\u002F\n- MCP integration guide: https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002Fdocs\u002Fmcp\n- Python SDK docs (SDK publish pending): https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002Fdocs\u002Fpython-sdk\n\n## How It Works\n\n1. **Write path ($0, \u003C5ms)**: Content → TF-IDF keyword extraction → embedded `sled` store. **No LLM and no embedding inference at write time** — ingestion is free and fast.\n2. **Read path (hybrid)**: Query → TF-IDF lexical candidates **∪** dense-embedding candidates (`text-embedding-3-small`, computed lazily on read and cached per agent) → fused via **Reciprocal Rank Fusion (RRF, k=60)** → optional pheromone re-ranking when `use_pheromone:true`.\n3. **Graph**: Knowledge triples form an in-memory graph; BFS traversal is available on every tier, A* pathfinding (pheromone\u002Fshortest\u002Fsemantic strategies) on Builder+.\n4. **Pheromone decay**: `w(t) = w₀ × exp(-Δt\u002Fτ)` — lazy computation at query time, no background daemon. Pheromone re-ranking is **opt-in** (default off) and most valuable for warm-cache \u002F repeated-access and multi-agent shared workloads.\n5. **Shared spaces**: Dedicated storage namespace per space; DID\u002FVC access control for ASI Chain identity.\n\n> **Cost note:** Because embeddings are computed on the read path and cached — never at write time — ingesting a large corpus costs **$0** in LLM\u002Fembedding fees and writes stay under 5ms. An internal within-harness benchmark (LOCOMO) measured hybrid retrieval lifting answer quality **+4.8pp overall \u002F +7.5pp single-hop** versus lexical-only, while preserving the zero-LLM-write property. (Internal, within-harness measurement — not a cross-vendor accuracy claim.)\n\n## Edge Cases\n\n- **Rate limits**: 429 response — check `X-RateLimit-Reset` header and retry after reset\n- **No \u002F bad API key**: 401 response — set `AM_API_KEY` and ensure it starts with `am_`\n- **Tool execution error**: returned in-band as `isError:true` + `structuredContent.error{code,type,message}` (HTTP 200), e.g. `-32004` for argument-validation failures — fix the arguments and retry\n- **Unknown tool name**: top-level JSON-RPC `-32601` (\"unknown tool\") — verify the name matches the 35-tool list (all lowercase, `memory_` prefix)\n- **Tier-gated feature**: in-band `-32002` (\"forbidden: tier ... cannot access ...\") — e.g. A* `find_path` on the free tier; upgrade or use BFS `traverse_graph`\n- **Large content**: episode content limited to 64KB; triple subject\u002Fpredicate\u002Fobject to 1KB each\n- **Temporal filter**: `valid_at` ISO 8601 string — use `Z` suffix for UTC\n\n## References\n\n- [Agentverse Memory Docs](https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002F)\n- [MCP Integration Guide](https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002Fdocs\u002Fmcp)\n- [Agentverse Platform](https:\u002F\u002Fagentverse.ai)\n","# Agentverse Memory\n\n## Overview\n\nGive any AI agent persistent, graph-native memory. Agentverse Memory is a managed MCP service that exposes **35 JSON-RPC 2.0 tools** for:\n\n| Memory Type | What it stores | Key tools |\n|-------------|----------------|-----------|\n| **Episodic** | Time-stamped events, observations, conversations | `memory_store_episode`, `memory_search_episodes` |\n| **Entity** | Named entities with typed properties | `memory_store_entity`, `memory_get_entity` |\n| **Graph** | Knowledge graph triples, traversal, pathfinding | `memory_traverse_graph`, `memory_find_path` |\n| **Procedural** | Goal-directed skill sequences with outcome tracking | `memory_store_procedure`, `memory_match_procedure` |\n| **Working** | Ephemeral key-value scratchpad (TTL-aware) | `memory_set_working`, `memory_get_working` |\n| **Shared** | Multi-agent shared knowledge spaces | `memory_create_shared_space`, `memory_shared_query` |\n| **Pheromone** | Stigmergic trails on memory paths | `memory_deposit_pheromone`, `memory_get_pheromone` |\n\n**Key differentiators:**\n- 🚀 **\u003C5ms writes, $0 ingest** — zero LLM inference at write time. Embeddings are computed lazily on the *read* path and cached per agent, so ingestion never pays an LLM\u002Fembedding bill. This is the core cost moat.\n- 🌐 **Graph memory on every tier — including free.** Knowledge triples, BFS graph traversal, and all 4 memory types are available on the free Explorer tier (most vector-only free tiers don't include graph at all).\n- 🔀 **Hybrid retrieval by default** — lexical (TF-IDF) and dense (`text-embedding-3-small`) candidate sets fused via Reciprocal Rank Fusion (RRF, k=60). Live default-on in production.\n- 🐜 **Pheromone-guided retrieval (opt-in)** — stigmergic trails that boost frequently-recalled memories. Best for warm-cache \u002F repeated-access and multi-agent shared workloads; off by default for single-pass queries.\n- 🔗 **MCP-native** — 35 tools over JSON-RPC; works with Claude, Cursor, Codex, Copilot, Gemini CLI.\n\n> **Positioning (honest):** Agentverse Memory competes on **total cost of ownership** ($0 write-time inference), **graph at every tier**, **native MCP**, and **multi-agent pheromone transfer** — not on a claim of higher raw retrieval accuracy than other systems. Keep the headline on cost and capabilities.\n\n## When to Use\n\n- Agent needs to **remember things** across conversations\u002Fsessions\n- Agent needs to **build a knowledge graph** from interactions\n- Agent needs to **find connections** between concepts (graph traversal, shortest path)\n- Agent needs to **share knowledge** with other agents (shared spaces)\n- Agent needs a **scratchpad** for active task state (working memory)\n- Agent needs to **recall what it knew at a specific time** (temporal queries)\n- Agent needs to **reuse proven workflows** across tasks (procedural memory)\n\n## When NOT to Use\n\n- You want in-process (local) memory → use Python dict \u002F Redis directly\n- You only need simple key-value storage with no graph → use `memory_set_working`\n- You want vector similarity search only (no graph) → any vector DB works\n\n## Prerequisites\n\n- `AM_API_KEY` environment variable set (prefix: `am_`)\n  - Get a free key (real response shape shown below):\n    ```bash\n    curl -X POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fv1\u002Fkeys \\\n      -H \"Content-Type: application\u002Fjson\" \\\n      -d '{\"agent_id\":\"my-agent\",\"tier\":\"explorer\"}'\n    # → {\"agent_id\":\"my-agent\",\"key\":\"am_xxxxxxxx\",\"key_id\":\"...\",\n    #    \"monthly_op_limit\":50000,\"tier\":\"explorer\",\"warning\":\"Store this key securely...\"}\n    ```\n    The field is **`key`** (not `api_key`) and the limit is **`monthly_op_limit`** (not `ops_per_month`).\n- Python 3.9+ with `requests`:\n  ```bash\n  pip install requests\n  ```\n\n> **Onboarding paths that work today:**\n> 1. The bundled **`scripts\u002Fmemory_client.py`** CLI (recommended — covers the common operations).\n> 2. **Raw curl \u002F MCP** calls to `…\u002Fmcp` (works from any language).\n>\n> A first-party **Python \u002F TypeScript SDK is coming soon** (pending package publish). The PyPI\u002Fnpm packages are *not yet live*, so don't rely on `pip install agentverse-memory` \u002F `npm install @fetchai\u002Fagentverse-memory` yet — use the bundled script or raw MCP for now.\n\n## Quick Steps\n\n### 1. Get a free API key\n```bash\ncurl -X POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fv1\u002Fkeys \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"agent_id\": \"my-agent\", \"tier\": \"explorer\"}'\n# → {\"agent_id\":\"my-agent\",\"key\":\"am_xxxxxxxxxxxxxxxx\",\"key_id\":\"...\",\n#    \"monthly_op_limit\": 50000, \"tier\": \"explorer\", \"warning\": \"...\"}\n\n# Export the value of the \"key\" field:\nexport AM_API_KEY=\"am_xxxxxxxxxxxxxxxx\"\n```\n\n### 2. Check service health\n```bash\ncurl https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fhealth\n# → {\"service\":\"am-server\",\"status\":\"ok\",\"version\":\"0.1.0\"}\n```\n\n### 3. Store an episodic memory\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py store-episode \\\n  --agent-id \"my-agent\" \\\n  --content \"User Alice asked about quantum computing and preferred simple analogies\"\n```\n\n### 4. Query episodic memories (hybrid retrieval)\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py query-episodes \\\n  --agent-id \"my-agent\" \\\n  --query \"quantum computing preferences\" \\\n  --limit 5\n# Result includes \"retrieval\":\"hybrid\" (TF-IDF ∪ dense, RRF-fused).\n# Add --no-hybrid to force lexical-only, or --use-pheromone for warm-cache re-ranking.\n```\n\n### 5. Store a knowledge graph fact\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py store-fact \\\n  --agent-id \"my-agent\" \\\n  --subject \"Alice\" \\\n  --predicate \"prefers_explanation_style\" \\\n  --object \"simple analogies\"\n```\n\n### 6. Find graph path between concepts (Builder+ tier)\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py find-path \\\n  --agent-id \"my-agent\" \\\n  --start \"Alice\" \\\n  --end \"quantum computing\"\n# A* pathfinding requires the Builder tier or above. On the free Explorer tier\n# use traverse-graph (BFS), which is available everywhere.\n```\n\n### 7. Working memory scratchpad\n```bash\npython3 skills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py set-working \\\n  --agent-id \"my-agent\" \\\n  --key \"current_task\" \\\n  --value '{\"task\": \"write report\", \"status\": \"in_progress\"}' \\\n  --ttl 3600\n```\n\n### 8. Direct MCP call (curl)\n```bash\ncurl -X POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fmcp \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: $AM_API_KEY\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": 1,\n    \"method\": \"tools\u002Fcall\",\n    \"params\": {\n      \"name\": \"memory_store_episode\",\n      \"arguments\": {\n        \"agent_id\": \"my-agent\",\n        \"content\": \"User prefers dark mode in all interfaces\",\n        \"source\": \"user\"\n      }\n    }\n  }'\n```\n\n> ⚠️ **Onboarding gotcha:** JSON-RPC must be POSTed to the **`\u002Fmcp`** path, not the base URL. POSTing to the base URL returns an actionable error (it will not silently succeed). Always set your endpoint to `…\u002Fmcp`.\n\n### 8b. Bash CLI (`mem`) — optional, shell-first workflows\n\nFor shell-first workflows there is a small `mem` CLI (built around `curl` + `jq`)\ndistributed with the Agentverse Memory service. It wraps the same `\u002Fmcp` endpoint:\n\n```bash\nexport AM_BASE_URL=\"https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\"   # MEM_URL is derived as $AM_BASE_URL\u002Fmcp\nexport AM_API_KEY=\"am_xxxxxxxxxxxxxxxx\"\n\nmem doctor                                            # validate the onboarding chain\nmem episode \"User prefers dark mode\" '{\"tags\":[\"pref\"]}'\nmem search \"dark mode\"\nmem stats\n```\n\n`mem doctor` checks env → `\u002Fmcp` → auth → a metadata round-trip → the usage\nmeter and prints a PASS\u002FFAIL checklist. If you don't have the `mem` CLI installed,\nthe bundled `scripts\u002Fmemory_client.py` (above) covers the same operations and works\nout of the box with only `requests`.\n\n### 9. Python \u002F TypeScript SDK (coming soon)\n\nA first-party SDK is in progress:\n\n```text\n# NOT YET PUBLISHED — do not use yet:\n#   pip install agentverse-memory          (PyPI package not live)\n#   npm install @fetchai\u002Fagentverse-memory (npm package not live)\n```\n\nUntil the packages are published, use `scripts\u002Fmemory_client.py` or call the\n`\u002Fmcp` endpoint directly (any language with an HTTP client works — it's plain\nJSON-RPC 2.0). Track SDK status at the docs site linked under\n[API Reference](#api-reference).\n\n## All 35 MCP Tools\n\n### Episodic Memory (5 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_store_episode` | Store a time-stamped event or observation |\n| `memory_get_episodes` | Retrieve episodes by agent, with pagination |\n| `memory_search_episodes` | Natural-language search — **hybrid retrieval** (TF-IDF ∪ dense embeddings, RRF-fused) |\n| `memory_search_timeline` | Search within a specific time window |\n| `memory_consolidate_episodes` | Merge related episodes into a summary |\n\n### Entity Memory (5 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_store_entity` | Store a named entity with typed properties |\n| `memory_get_entity` | Retrieve entity by name or ID |\n| `memory_list_entities` | List entities with prefix\u002Ftype filter |\n| `memory_store_relation` | Store a typed relationship between two entities (by entity ID) |\n| `memory_get_relations` | Get all relations for an entity |\n\n### Graph Operations (5 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_query_graph` | Keyword graph query over stored triples |\n| `memory_semantic_search` | Vector similarity search across memory types |\n| `memory_get_neighbors` | Get direct neighbors of a graph node |\n| `memory_find_path` | A* pathfinding between concepts (pheromone\u002Fshortest\u002Fsemantic) — **Builder+ tier** |\n| `memory_traverse_graph` | BFS outward from a start node (free on every tier) |\n\n### Graph Direct (3 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_graph_add_triple` | Add a (subject, predicate, object) triple directly |\n| `memory_graph_neighbors` | Get low-level graph neighbors of a node |\n| `memory_graph_shortest_path` | Shortest path between two nodes |\n\n### Procedural Memory (4 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_store_procedure` | Store a named, goal-directed step sequence |\n| `memory_get_procedure` | Retrieve procedure with success\u002Ffail stats |\n| `memory_match_procedure` | Find the best procedure for a task description |\n| `memory_update_procedure` | Update steps or record execution outcome |\n\n### Working Memory (4 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_set_working` | Set key-value with optional TTL (\u003C1ms p50) |\n| `memory_get_working` | Get value by key |\n| `memory_list_working` | List all keys (with prefix filter) |\n| `memory_clear_working` | Delete one key, by prefix, or all |\n\n### Pheromone (2 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_deposit_pheromone` | Deposit a pheromone trail on a memory path |\n| `memory_get_pheromone` | Get the current pheromone weight for a path |\n\n### Shared Memory Spaces (5 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_create_shared_space` | Create a multi-agent shared knowledge space |\n| `memory_join_shared_space` | Join a space by `space_id` (your JWT must grant access — see [Shared Spaces & JWT Authentication](#shared-spaces--jwt-authentication)) |\n| `memory_shared_store_entity` | Store an entity in a shared space |\n| `memory_shared_query` | Query cross-agent memory within a shared space |\n| `memory_list_shared_spaces` | List shared spaces the agent belongs to |\n\n### Utility (2 tools)\n| Tool | Description |\n|------|-------------|\n| `memory_get_stats` | Agent usage stats, counts, rate-limit status |\n| `memory_delete_agent` | Delete all memory for an agent (irreversible) |\n\n### `memory_search_episodes` parameters\n\n| Param | Type | Default | Notes |\n|-------|------|---------|-------|\n| `query` | string | — | Required search text |\n| `limit` | integer | 12 | Max evidence items to return |\n| `use_hybrid` | boolean | `true` | Fuse the TF-IDF candidate set with dense embeddings (RRF). Set `false` for lexical-only. |\n| `use_pheromone` | boolean | `false` | Re-rank by pheromone weight. Best for warm\u002Frepeated-access workloads; off by default. |\n| `max_content_chars` | integer | — | Optional: trim each result's content to N chars to save tokens |\n\nThe result reports the retrieval mode used as `\"retrieval\": \"hybrid\"` or `\"retrieval\": \"tfidf\"`.\n\n## Tool Parameter Reference (all 35 tools)\n\nComplete parameters for every tool, grouped by memory type. Each tool's arguments\ngo inside the JSON-RPC `params.arguments` object (see [Direct MCP call](#8-direct-mcp-call-curl)).\nThe five tools that publish a live `inputSchema` via `tools\u002Flist`\n(`memory_store_episode`, `memory_search_episodes`, `memory_set_working`,\n`memory_graph_neighbors`, `memory_graph_shortest_path`) match the tables below;\nthis section documents the remaining tools that don't yet advertise a schema.\n\n> **Conventions**\n> - **`agent_id` is *not* a tool argument.** Your identity — and which memory palace you read\u002Fwrite — is derived from the `AM_API_KEY` you authenticate with. (The `--agent-id` flag in `memory_client.py` is a client-side convenience; the server ignores any `agent_id` passed in `arguments`.)\n> - `✅` = required · `—` = optional \u002F not applicable · timestamps are **RFC3339** strings (use a `Z` suffix for UTC).\n> - Shared-space tools additionally require **JWT auth** (`Authorization: Bearer \u003Cjwt>`), not just an API key.\n\n### Episodic Memory\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_store_episode` | `content` | string | ✅ | — | Episode text content |\n| | `metadata` | object | — | — | Structured metadata (chunk provenance merged in when content is split) |\n| | `valid_at` | string | — | now | Validity timestamp (RFC3339) |\n| | `chunk` | boolean | — | auto | Force (`true`) \u002F disable (`false`) chunking; auto = chunk only when content > `chunk_threshold` |\n| | `chunk_threshold` | integer | — | 6000 | Auto-chunk content longer than this many chars |\n| | `chunk_size` | integer | — | 2800 | Target chunk size (chars) |\n| | `chunk_overlap` | integer | — | 450 | Overlap between consecutive chunks (chars) |\n| `memory_get_episodes` | `limit` | integer | — | 10 | Max episodes to return (most recent first) |\n| `memory_search_episodes` | `query` | string | ✅ | — | Search text — full detail in the [table above](#memory_search_episodes-parameters) |\n| | `limit` | integer | — | 12 | Max evidence items to return |\n| | `use_hybrid` | boolean | — | server default (**ON** in prod) | Fuse TF-IDF ∪ dense embeddings (RRF) |\n| | `use_pheromone` | boolean | — | server default (**OFF** in prod) | Re-rank by pheromone weight |\n| | `max_content_chars` | integer | — | no trim | Trim each result's content to N chars |\n| `memory_search_timeline` | `start_time` | string | ✅ | — | Window start (RFC3339) |\n| | `end_time` | string | ✅ | — | Window end (RFC3339) |\n| `memory_consolidate_episodes` | `before_time` | string | — | 7 days ago | Consolidate episodes older than this (RFC3339); those with pheromone weight \u003C 0.1 are soft-deleted |\n\n### Entity Memory\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_store_entity` | `entity_id` | string | ✅ | — | Unique entity identifier \u002F name |\n| | `type` | string | — | `\"concept\"` | Entity type |\n| | `description` | string | — | — | Human-readable description |\n| | `predicate` | string | — | — | Predicate (for subject-predicate-object facts) |\n| | `object_value` | string | — | — | Object value (for subject-predicate-object facts) |\n| | `properties` | object | — | — | Structured metadata (alias of `metadata`) |\n| | `metadata` | object | — | — | Structured metadata (takes precedence if both are sent) |\n| `memory_get_entity` | `entity_id` | string | ✅ | — | Entity id\u002Fname to fetch (returns `found:false` if absent) |\n| `memory_list_entities` | `limit` | integer | — | 20 | Max entities to return |\n| `memory_store_relation` | `from_id` | string | ✅ | — | Source entity (UUID **or** name; a new name is auto-created as a stub) |\n| | `to_id` | string | ✅ | — | Target entity (UUID **or** name; auto-created if new) |\n| | `predicate` | string | ✅ | — | Relation label |\n| | `weight` | number | — | 1.0 | Edge weight |\n| `memory_get_relations` | `entity_id` | string | ✅ | — | Entity id\u002Fname whose relations to fetch |\n\n### Graph Operations\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_query_graph` | `query` | string | ✅ | — | Keyword graph query text |\n| `memory_semantic_search` | `query` | string | ✅ | — | Search text (TF-IDF over entities) |\n| | `limit` | integer | — | 10 | Max results |\n| `memory_get_neighbors` | `entity_id` | string | ✅ | — | Entity id\u002Fname to expand from |\n| | `hops` | integer | — | 1 | Neighbor hop depth |\n| `memory_find_path` † | `from_id` | string | ✅ | — | Source node identifier |\n| | `to_id` | string | ✅ | — | Target node identifier |\n| | `max_hops` | integer | — | 6 | Maximum path length (hops) |\n| `memory_traverse_graph` | `start_id` | string | ✅ | — | Starting node identifier |\n| | `algorithm` | string `\"bfs\"`\\|`\"dfs\"` | — | `\"bfs\"` | Traversal algorithm |\n| | `max_depth` | integer | — | 3 | Maximum traversal depth |\n\n> † `memory_find_path` (A* pathfinding) is **tier-gated**: lower tiers receive an in-band `-32002 forbidden` error. Use `memory_traverse_graph` (BFS), which is available on every tier, where A* isn't enabled.\n\n### Graph Direct (low-level triple store)\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_graph_add_triple` | `subject` | string | ✅ | — | Subject node label |\n| | `predicate` | string | ✅ | — | Predicate \u002F edge label |\n| | `object` | string | ✅ | — | Object node label |\n| `memory_graph_neighbors` | `node` | string | ✅ | — | Starting node label |\n| | `depth` | integer | — | 1 | Hop depth (1–5; capped at 5) |\n| | `direction` | string `\"outgoing\"`\\|`\"incoming\"`\\|`\"both\"` | — | `\"outgoing\"` | Edge direction |\n| `memory_graph_shortest_path` | `from` | string | ✅ | — | Source node label |\n| | `to` | string | ✅ | — | Target node label |\n| | `undirected` | boolean | — | false | Traverse edges in both directions |\n\n### Procedural Memory\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_store_procedure` | `name` | string | ✅ | — | Procedure name |\n| | `description` | string | — | — | Description |\n| | `steps` | array&lt;string\\|object&gt; | — | `[]` | Ordered steps: plain strings, or objects `{action, tool?, expected_output?}` |\n| | `tags` | array&lt;string&gt; | — | `[]` | Tags |\n| | `preconditions` | array&lt;string&gt; | — | `[]` | Preconditions |\n| `memory_get_procedure` | `procedure_id` | string | ✅* | — | Procedure UUID — *one of `procedure_id` \u002F `name` required* |\n| | `name` | string | ✅* | — | Procedure name (alternative to `procedure_id`) |\n| `memory_match_procedure` | `task` | string | ✅ | — | Task description to match against stored procedures |\n| | `limit` | integer | — | 5 | Max procedures to return |\n| `memory_update_procedure` | `procedure_id` | string | ✅* | — | Procedure UUID to update — *one of `procedure_id` \u002F `name` required* |\n| | `name` | string | ✅* | — | Procedure name (alternative to `procedure_id`) |\n| | `steps` | array&lt;string\\|object&gt; | ✅ | — | New ordered steps (replaces old; creates a new version) |\n| | `reason` | string | — | — | Reason for the update |\n\n### Working Memory\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_set_working` | `key` | string | ✅ | — | Working memory key |\n| | `content` | string | ✅ | — | Value to store (`value` accepted as a legacy alias; non-strings are JSON-encoded) |\n| | `ttl_seconds` | integer | — | none (no expiry) | Time-to-live in seconds |\n| | `session_id` | string | — | — | Optional session scope |\n| `memory_get_working` | `key` | string | ✅ | — | Key to fetch (returns `found:false` if absent\u002Fexpired) |\n| `memory_list_working` | *(none)* | — | — | — | Lists all live working-memory items |\n| `memory_clear_working` | `key` | string | — | — | Key to delete; **omit to clear ALL** working memory |\n\n### Pheromone\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_deposit_pheromone` | `node_id` | string | ✅ | — | Episode UUID or entity name\u002FID to reinforce |\n| | `strength` | number | — | 1.0 | Pheromone deposit strength |\n| `memory_get_pheromone` | `node_id` | string | ✅ | — | Episode UUID or entity name\u002FID to query |\n\n### Shared Memory Spaces (JWT auth required)\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_create_shared_space` | `name` | string | ✅ | — | Space name (1–128 characters) |\n| `memory_join_shared_space` | `space_id` | string | ✅ | — | Space ID to join (JWT must grant access to it) |\n| | `role` | string `\"owner\"`\\|`\"writer\"`\\|`\"reader\"` | — | `\"writer\"` | Requested role |\n| `memory_shared_store_entity` | `space_id` | string | ✅ | — | Space ID (requires writer\u002Fowner role) |\n| | `name` | string | ✅ | — | Entity name |\n| | `entity_type` | string | — | `\"thing\"` | Entity type |\n| | `description` | string | — | — | Description |\n| `memory_shared_query` | `space_id` | string | ✅ | — | Space ID (requires reader\u002Fwriter\u002Fowner role) |\n| | `query` | string | — | `\"\"` (list all) | Search query; empty\u002Fomitted lists all entities |\n| | `limit` | integer | — | 10 | Max results |\n| `memory_list_shared_spaces` | *(none)* | — | — | — | Lists shared spaces the agent belongs to |\n\n### Utility\n\n| Tool | Parameter | Type | Req | Default | Description |\n|------|-----------|------|:---:|---------|-------------|\n| `memory_get_stats` | *(none)* | — | — | — | Usage stats, memory counts, rate-limit status |\n| `memory_delete_agent` | `confirm` | boolean | ✅ | — | Must be `true` to permanently delete all of this agent's memory (irreversible, GDPR) |\n\n## Response Shapes (all 35 tools)\n\nThe top-level keys in each tool's success payload (the `structuredContent` object — see\n[Tool call response](#mcp-protocol-details)). All shapes are verified against the live server.\nFailures instead return `isError:true` + `structuredContent.error{code,type,message}` (see [Edge Cases](#edge-cases)).\n\n### Episodic\n| Tool | Success payload (`structuredContent`) |\n|------|----------------------------------------|\n| `memory_store_episode` | `{ stored:true, id:\"\u003Cuuid>\", ids:[\"\u003Cuuid>\", …], chunks:\u003Cint>, agent_id }` — `id` = first\u002Fonly episode; `ids`\u002F`chunks` reflect auto-chunking |\n| `memory_get_episodes` | `{ episodes:[ \u003CEpisode> … ], count:\u003Cint> }` *(outputSchema)* |\n| `memory_search_episodes` | `{ results:[ { episode, score, … } … ], count:\u003Cint>, retrieval:\"hybrid\"\\|\"tfidf\" }` *(outputSchema)* |\n| `memory_search_timeline` | `{ episodes:[ … ], count:\u003Cint>, window:{ start, end } }` |\n| `memory_consolidate_episodes` | `{ consolidated:\u003Cint>, before:\"\u003Crfc3339>\", note }` |\n\n### Entity\n| Tool | Success payload |\n|------|-----------------|\n| `memory_store_entity` | `{ id:\"\u003Cuuid>\", entity_id, stored:true }` |\n| `memory_get_entity` | found → `{ entity:\u003CEntity>, found:true }` · absent → `{ found:false, entity_id }` |\n| `memory_list_entities` | `{ entities:[ … ], count:\u003Cint> }` *(outputSchema)* |\n| `memory_store_relation` | `{ id:\"\u003Cuuid>\", from_id, to_id, predicate, stored:true }` |\n| `memory_get_relations` | `{ relations:[ … ], count:\u003Cint>, entity_id }` |\n\n### Graph Operations\n| Tool | Success payload |\n|------|-----------------|\n| `memory_query_graph` | Backend graph-query result object (matched nodes\u002Fedges; shape is backend-defined) |\n| `memory_semantic_search` | `{ results:[ { entity, score } … ], count:\u003Cint> }` *(outputSchema)* |\n| `memory_get_neighbors` | `{ neighbors:[ … ], count:\u003Cint>, entity_id, hops:\u003Cint> }` |\n| `memory_find_path` | `{ path:[ … ], hops:\u003Cint>, from_id, to_id }` *(Builder+ tier-license; Explorer → in-band `-32002 forbidden`, fall back to `memory_traverse_graph`)* |\n| `memory_traverse_graph` | `{ visited:[ … ], count:\u003Cint>, start_id, algorithm, max_depth:\u003Cint> }` |\n\n### Graph Direct\n| Tool | Success payload |\n|------|-----------------|\n| `memory_graph_add_triple` | `{ stored:true, triple_id:\"\u003Cuuid>\", subject, predicate, object }` |\n| `memory_graph_neighbors` | `{ node, depth:\u003Cint>, direction, count:\u003Cint>, neighbors:[ { subject, predicate, object } … ] }` |\n| `memory_graph_shortest_path` | `{ from, to, undirected:\u003Cbool>, found:\u003Cbool>, hops:\u003Cint>, path:[ … ] }` |\n\n### Procedural\n| Tool | Success payload |\n|------|-----------------|\n| `memory_store_procedure` | `{ id:\"\u003Cuuid>\", name, stored:true }` |\n| `memory_get_procedure` | found → `{ procedure:\u003CProcedure>, found:true }` · absent → `{ found:false, procedure_id }` |\n| `memory_match_procedure` | `{ results:[ … ], count:\u003Cint> }` |\n| `memory_update_procedure` | `{ new_id:\"\u003Cuuid>\", old_procedure_id, updated:true }` *(creates a new version)* |\n\n### Working\n| Tool | Success payload |\n|------|-----------------|\n| `memory_set_working` | `{ key, set:true, ttl_seconds }` |\n| `memory_get_working` | found → `{ item:\u003CWorkingItem>, found:true }` · absent\u002Fexpired → `{ found:false, key }` |\n| `memory_list_working` | `{ items:[ … ], count:\u003Cint> }` |\n| `memory_clear_working` | single key → `{ key, removed:\u003Cbool> }` · clear-all → `{ cleared:true, keys_deleted:\u003Cint> }` |\n\n### Pheromone\n| Tool | Success payload |\n|------|-----------------|\n| `memory_deposit_pheromone` | `{ node_id, new_weight:\u003Cfloat>, node_type:\"episode\"\\|\"entity\" }` |\n| `memory_get_pheromone` | found → `{ node_id, weight:\u003Cfloat>, node_type }` · absent → `{ node_id, found:false }` |\n\n### Shared Spaces *(JWT auth)*\n| Tool | Success payload |\n|------|-----------------|\n| `memory_create_shared_space` | `{ space_id, name, owner_did, members:\u003Cint>, created_at:\"\u003Crfc3339>\", status:\"created\" }` |\n| `memory_join_shared_space` | `{ space_id, agent_did, role, members:\u003Cint>, status:\"joined\" }` |\n| `memory_shared_store_entity` | `{ space_id, entity_id:\"\u003Cuuid>\", name, entity_type, stored_by, status:\"stored\" }` |\n| `memory_shared_query` | `{ space_id, query, count:\u003Cint>, results:[ { id, name, entity_type, description, score? } … ] }` *(`score` present only for non-empty queries)* |\n| `memory_list_shared_spaces` | `{ agent_did, count:\u003Cint>, spaces:[ { space_id, name, owner_did, my_role, member_count, created_at } … ] }` |\n\n### Utility\n| Tool | Success payload |\n|------|-----------------|\n| `memory_get_stats` | `{ agent_id, tier, monthly_ops_used:\u003Cint>, monthly_op_limit:\u003Cint>, memory:{ episode_count, entity_count, relation_count, procedure_count, working_count } }` *(outputSchema)* |\n| `memory_delete_agent` | `{ agent_id, deleted:true, note }` |\n\n## MCP Protocol Details\n\n**Endpoint:** `POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fmcp`\n**Auth:** `X-API-Key: am_xxxxxxxxxxxxxxxx`\n\n**Protocol version negotiation** — the server implements the current MCP spec and negotiates the protocol version on `initialize`. It accepts versions up to the release candidate **`2026-07-28`** and defaults to **`2025-11-25`** when the client omits or requests an unknown version (it returns a supported version rather than erroring):\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"initialize\",\n  \"params\": { \"protocolVersion\": \"2026-07-28\", \"capabilities\": {},\n              \"clientInfo\": { \"name\": \"my-client\", \"version\": \"1.0\" } } }\n```\n\n**Tool call request:**\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"tools\u002Fcall\",\n  \"params\": {\n    \"name\": \"memory_store_episode\",\n    \"arguments\": { \"agent_id\": \"...\", \"content\": \"...\" }\n  }\n}\n```\n\n**Tool call response** — results carry both a human-readable `content` block **and** a typed `structuredContent` payload, plus an `isError` flag (MCP-spec result shape):\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"result\": {\n    \"content\": [{ \"type\": \"text\", \"text\": \"{\\\"stored\\\":true,\\\"id\\\":\\\"5d9d...\\\"}\" }],\n    \"isError\": false,\n    \"structuredContent\": { \"stored\": true, \"id\": \"5d9d...\", \"ids\": [\"5d9d...\"], \"chunks\": 1 }\n  }\n}\n```\n\n**Errors are reported in-band** — a failing tool call returns `isError: true` with a structured error in `structuredContent.error` (it is **not** a top-level JSON-RPC `error`, so it won't trip strict transports):\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"result\": {\n    \"content\": [{ \"type\": \"text\", \"text\": \"validation error on 'task': required field missing or invalid\" }],\n    \"isError\": true,\n    \"structuredContent\": { \"error\": { \"code\": -32004, \"type\": \"validation_error\",\n                                       \"message\": \"validation error on 'task': ...\" } }\n  }\n}\n```\n(The only protocol-level JSON-RPC error is the auth gate — a missing\u002Finvalid API key.)\n\n**Typed outputs:** five read tools declare an `outputSchema` so clients can validate results without parsing text — `memory_get_episodes`, `memory_search_episodes`, `memory_list_entities`, `memory_semantic_search`, `memory_get_stats`.\n\n**Tools list:** `POST \u002Fmcp` with `{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools\u002Flist\",\"params\":{}}`\n\n## Shared Spaces & JWT Authentication\n\nThe five `memory_*_shared_*` \u002F `memory_create_shared_space` \u002F `memory_join_shared_space` tools are\n**multi-agent** and need a different credential than the rest of the API.\n\n- **Single-agent tools (30):** authenticate with your **API key** (`X-API-Key: am_…` or `Authorization: Bearer am_…`). Fully self-serve via `POST \u002Fv1\u002Fkeys`.\n- **Shared-space tools (5):** require a **JWT** (`Authorization: Bearer \u003Cjwt>`). The server gates access in two steps — **tier first, then JWT**:\n\n  - **Explorer (free) tier** — the tier gate fires first: any shared-space tool call returns an in-band **`-32002` `forbidden`** (`\"forbidden: tier 'explorer' cannot access 'builder' feature\"`). No shared spaces on the free tier; upgrade to Builder ($19\u002Fmo).\n  - **Builder+ tier without a JWT** — the JWT auth gate fires next: returns an in-band **`-32001` `unauthorized`**:\n\n    ```json\n    { \"isError\": true,\n      \"structuredContent\": { \"error\": { \"code\": -32001, \"type\": \"unauthorized\",\n        \"message\": \"unauthorized: Shared space operations require JWT authentication. Use 'Authorization: Bearer \u003Cjwt>' with a valid JWT token.\" } } }\n    ```\n\n### How to obtain a JWT\n\n**Builder+ tiers can now self-serve a JWT via `POST \u002Fv1\u002Fspace-token`!** Send your API key and the server returns a short-lived HS256 token scoped to the spaces you own or belong to. The `spaces[]` claim is computed server-side from your membership — you can't request arbitrary spaces. The JWT expires after 1 hour (default, configurable 60–86400s) and can be refreshed anytime.\n\n```bash\ncurl -s -X POST https:\u002F\u002Fam-server-jbneh74b5q-uc.a.run.app\u002Fv1\u002Fspace-token \\\n  -H \"X-API-Key: am_YOUR_BUILDER_KEY\"\n# → { \"token\": \"eyJ...\", \"token_type\": \"Bearer\",\n#     \"expires_at\": \"2026-06-30T12:26:00Z\", \"expires_in\": 3600,\n#     \"tier\": \"builder\", \"agent_id\": \"agent-abc123\", \"spaces\": [...],\n#     \"usage\": \"Use as Authorization: Bearer \u003Ctoken> with shared-space MCP tools\" }\n```\n\n> **Explorer (free) tier does not include shared spaces.** `\u002Fv1\u002Fspace-token` returns `403 -32002` for Explorer keys. Upgrade to Builder ($19\u002Fmo) for up to 3 owned spaces.\n\nThe server-generated JWT uses these claims:\n\n| Claim | Value \u002F meaning |\n|-------|-----------------|\n| `sub` | Your agent DID — e.g. `did:fetch:agent123abc`. Derived from your API key. |\n| `iss` | Always `agentverse-memory`. |\n| `aud` | Always `am-server`. |\n| `spaces` | Array of space IDs this token may access (computed server-side). `[]` if you haven't created any yet. |\n| `tier` | Your API key's tier (`builder`\\|`pro`\\|`enterprise`). |\n| `exp` | Expiry (Unix seconds, **numeric** — string `exp` is rejected, CVE-2026-25537). |\n| `iat` | Issued-at (Unix seconds). |\n\nWrong `iss`\u002F`aud`\u002Fsignature, an expired token, or a missing required claim are rejected at the auth gate\n(`jwt_invalid_issuer` \u002F `jwt_invalid_audience` \u002F `jwt_invalid_signature` \u002F `jwt_expired` \u002F `jwt_missing_claim`).\n\n**Self-hosted \u002F BYOC:** If you run your own `am-server`, set `JWT_SECRET` env var to enable JWT auth. Without it, `\u002Fv1\u002Fspace-token` returns `503 -32007` (\"JWT_SECRET is unset\"). You'll need to mint tokens yourself using the claim shape above (HS256, with your secret).\n\n### Typical multi-agent flow (self-serve)\n\n1. **Owner** → `POST \u002Fv1\u002Fspace-token` with Builder+ API key → receives JWT.\n2. **Owner** (JWT) → `memory_create_shared_space {name}` → returns `space_id`.\n3. **Owner** → re-mint JWT via `POST \u002Fv1\u002Fspace-token` (now includes the new space in `spaces[]`). Bootstrap complete.\n4. **Collaborators** → each gets their own Builder+ key → `POST \u002Fv1\u002Fspace-token` → JWT scoped to their spaces.\n5. **Members** (JWT) → `memory_join_shared_space {space_id, role}` → roles: `owner` > `writer` > `reader`.\n6. **Writers\u002Fowners** → `memory_shared_store_entity {space_id, name, …}`; **readers+** → `memory_shared_query {space_id, query}`; any member → `memory_list_shared_spaces`.\n\nInsufficient role within a space returns an in-band `-32002` (`forbidden`).\n\n## Pricing\n\n| Tier | Price | Ops\u002Fmonth | Agents | Graph | A* pathfinding | Shared spaces |\n|------|-------|-----------|--------|-------|----------------|---------------|\n| **Explorer** | Free | 50,000 | 3 | ✅ + BFS traversal | ❌ | ❌ |\n| **Builder** | $19\u002Fmo | 500,000 | 25 | ✅ | ✅ A* | ✅ |\n| **Pro** | $99\u002Fmo | 5,000,000 | Unlimited | ✅ | ✅ A* | ✅ Unlimited |\n| **Enterprise** | Custom | Custom | Unlimited | ✅ | ✅ | ✅ |\n\n- All 4 memory types **and** knowledge-graph triples are available on **every tier, including free** — that's the core differentiator vs vector-only free tiers.\n- **Builder** adds A* pathfinding + shared spaces; overage billed at **$0.005 \u002F 1K ops**.\n- **Pro** adds Active Inference + cross-agent queries.\n- **Enterprise** adds SLA, SOC 2, and BYOC (Bring Your Own Cloud).\n\nGet started free: `POST \u002Fv1\u002Fkeys` with `\"tier\": \"explorer\"`.\n\n## API Reference\n\nVerified documentation (all live):\n\n- Docs home: https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002F\n- Docs index: https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002Fdocs\u002F\n- MCP integration guide: https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002Fdocs\u002Fmcp\n- Python SDK docs (SDK publish pending): https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002Fdocs\u002Fpython-sdk\n\n## How It Works\n\n1. **Write path ($0, \u003C5ms)**: Content → TF-IDF keyword extraction → embedded `sled` store. **No LLM and no embedding inference at write time** — ingestion is free and fast.\n2. **Read path (hybrid)**: Query → TF-IDF lexical candidates **∪** dense-embedding candidates (`text-embedding-3-small`, computed lazily on read and cached per agent) → fused via **Reciprocal Rank Fusion (RRF, k=60)** → optional pheromone re-ranking when `use_pheromone:true`.\n3. **Graph**: Knowledge triples form an in-memory graph; BFS traversal is available on every tier, A* pathfinding (pheromone\u002Fshortest\u002Fsemantic strategies) on Builder+.\n4. **Pheromone decay**: `w(t) = w₀ × exp(-Δt\u002Fτ)` — lazy computation at query time, no background daemon. Pheromone re-ranking is **opt-in** (default off) and most valuable for warm-cache \u002F repeated-access and multi-agent shared workloads.\n5. **Shared spaces**: Dedicated storage namespace per space; DID\u002FVC access control for ASI Chain identity.\n\n> **Cost note:** Because embeddings are computed on the read path and cached — never at write time — ingesting a large corpus costs **$0** in LLM\u002Fembedding fees and writes stay under 5ms. An internal within-harness benchmark (LOCOMO) measured hybrid retrieval lifting answer quality **+4.8pp overall \u002F +7.5pp single-hop** versus lexical-only, while preserving the zero-LLM-write property. (Internal, within-harness measurement — not a cross-vendor accuracy claim.)\n\n## Edge Cases\n\n- **Rate limits**: 429 response — check `X-RateLimit-Reset` header and retry after reset\n- **No \u002F bad API key**: 401 response — set `AM_API_KEY` and ensure it starts with `am_`\n- **Tool execution error**: returned in-band as `isError:true` + `structuredContent.error{code,type,message}` (HTTP 200), e.g. `-32004` for argument-validation failures — fix the arguments and retry\n- **Unknown tool name**: top-level JSON-RPC `-32601` (\"unknown tool\") — verify the name matches the 35-tool list (all lowercase, `memory_` prefix)\n- **Tier-gated feature**: in-band `-32002` (\"forbidden: tier ... cannot access ...\") — e.g. A* `find_path` on the free tier; upgrade or use BFS `traverse_graph`\n- **Large content**: episode content limited to 64KB; triple subject\u002Fpredicate\u002Fobject to 1KB each\n- **Temporal filter**: `valid_at` ISO 8601 string — use `Z` suffix for UTC\n\n## References\n\n- [Agentverse Memory Docs](https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002F)\n- [MCP Integration Guide](https:\u002F\u002Ffetchai.github.io\u002Fagentverse-memory\u002Fdocs\u002Fmcp)\n- [Agentverse Platform](https:\u002F\u002Fagentverse.ai)\n",{"name":5,"license":15,"metadata":24,"description":28,"allowed-tools":29,"compatibility":30},{"author":25,"version":26,"last-updated":27},"Fetch.ai","1.3.2","2026-06-30","Give any AI agent persistent, graph-native memory via Agentverse Memory — a managed MCP service with 35 JSON-RPC tools covering 4 memory types (episodic, semantic\u002Fgraph, procedural, working) plus shared multi-agent memory spaces. Zero LLM at write time (\u003C5ms writes, $0 ingest). Graph memory on every tier — including free. Hybrid retrieval (TF-IDF + dense, RRF-fused). Requires AM_API_KEY env var. Use when asked to store memories, recall past events, build a knowledge graph, share memory between agents, or retrieve facts about users\u002Ftasks.\n","Read Bash(python3 *) Bash(curl *) Bash(mem *) Bash(pip install requests)","Python 3.9+, network access, AM_API_KEY env var","main","ddaff4fa6455cb8d10edae9fe3e62243d578bcb5","skills\u002Fagentverse-memory",3,"https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills","https:\u002F\u002Fagentverse.ai","https:\u002F\u002Fgithub.com\u002Ffetchai","https:\u002F\u002Ffetch.ai","2026-06-30 19:55:55",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add fetchai\u002Fagentverse-skills --skill agentverse-memory",{"tool":46,"command":47},"bunx","bunx skills add fetchai\u002Fagentverse-skills --skill agentverse-memory",{"tool":49,"command":50},"pnpm","pnpm dlx skills add fetchai\u002Fagentverse-skills --skill agentverse-memory","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills\u002Fblob\u002Fmain\u002Fskills\u002Fagentverse-memory\u002FSKILL.md",true,[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"scripts\u002Fmemory_client.py","SCRIPT","脚本",17254,"https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills\u002Fblob\u002Fmain\u002Fskills\u002Fagentverse-memory\u002Fscripts\u002Fmemory_client.py",[61,68,75,82,89,96],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M79K9AYJT3C8DM2MTNNXYFAA","asi1-chat","Query the ASI:One LLM — the AI model by the ASI Alliance (Fetch.ai + SingularityNET + Ocean Protocol). OpenAI-compatible API. Supports asi1 (default) and asi1-mini models. Requires ASI_ONE_API_KEY env var. Use when asked to \"use ASI\", \"query ASI:One\", or \"use the Fetch.ai LLM\".","https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills\u002Fblob\u002Fmain\u002Fskills\u002Fasi1-chat\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M79K960TWMYTNRJH9FDBZ057","agentverse-search","Search Fetch.ai's Agentverse for agents by keyword, capability, or protocol. Returns agent names, addresses, descriptions, and supported protocols. Use when asked to find, discover, or list available agents on Agentverse. Requires AGENTVERSE_API_KEY env var.","https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills\u002Fblob\u002Fmain\u002Fskills\u002Fagentverse-search\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M79K8PKPTJHJWHJ82A6N9M9F","agentverse-manage","Manage hosted agents on Fetch.ai's Agentverse: list, start, stop, view logs, and delete agents. Provides operational control over your deployed agents. Requires AGENTVERSE_API_KEY env var. Use when asked to list agents, check agent status, view logs, start\u002Fstop agents, or clean up.","https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills\u002Fblob\u002Fmain\u002Fskills\u002Fagentverse-manage\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M79K8JDXGJXFAN88ZFAV1JRM","agentverse-inspect","Inspect any agent's capabilities, protocols, endpoints, and status on Fetch.ai's Agentverse Almanac. Use to understand what an agent can do before interacting with it. Requires AGENTVERSE_API_KEY env var. Use when asked to \"inspect\", \"check\", or \"what can this agent do\".","https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills\u002Fblob\u002Fmain\u002Fskills\u002Fagentverse-inspect\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M79K8EDM76DKZXWQAT7V02KE","agentverse-image-gen","Generate images using AI agents on Fetch.ai's Agentverse. Sends a text prompt to an image generation agent and returns the generated image URL. Handles agent discovery, relay deployment, and response parsing automatically. Requires AGENTVERSE_API_KEY env var. Use when asked to generate, create, or make an image via Agentverse.","https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills\u002Fblob\u002Fmain\u002Fskills\u002Fagentverse-image-gen\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M79K872D6SGKF9803AJ6WZ51","agentverse-deploy","Deploy Python code as a hosted agent on Fetch.ai's Agentverse. Creates a new agent, uploads code, and optionally starts it. Handles the tricky code upload format automatically. Requires AGENTVERSE_API_KEY env var. Use when asked to deploy, host, or publish an agent on Agentverse.","https:\u002F\u002Fgithub.com\u002Ffetchai\u002Fagentverse-skills\u002Fblob\u002Fmain\u002Fskills\u002Fagentverse-deploy\u002FSKILL.md",[],[]]