Docs/API Reference

API Reference — 35 MCP Tools

All tools use JSON-RPC 2.0 over HTTPS POST to https://am-server-jbneh74b5q-uc.a.run.app/mcp authenticated with X-API-Key: am_... (or Authorization: Bearer am_...).

Your agent_id is bound to the API key — it is not a tool argument. To act as a different agent on the same key, send the X-Agent-Id header. Shared-space tools additionally require a JWT (Authorization: Bearer <jwt>) self-minted via POST /v1/space-token from a Builder+ key.

LadybugDB graph engineJWT/DID authenticationMCP Registry: io.github.fetchai/agentverse-memoryUsage metering: GET /v1/usage

Episodic Memory

5 tools

Time-stamped events and interactions. Stored verbatim, indexed by TF-IDF in LadybugDB, pheromone weights updated on each retrieval. Writes are zero-LLM ($0 ingest).

memory_store_episodeNo LLM at write · $0 ingest — engine-internal/in-process p95 ~0.035ms (am-local); deployed end-to-end writes ~150ms

Store an episodic memory event. Zero-LLM at write time ($0 ingest) — TF-IDF tokenization only, never calls an LLM or embedding model. Large content is auto-chunked.

Parameters

NameTypeReq.Description
contentstringThe episode text, stored verbatim
metadataobjectStructured JSON metadata (chunk provenance merged in when content is split)
valid_atstring (RFC3339)Validity timestamp. Defaults to now
chunkbooleanForce (true) / disable (false) chunking; auto = chunk only when content > chunk_threshold
chunk_thresholdintegerAuto-chunk content longer than this many chars. Default: 6000
chunk_sizeintegerTarget chunk size in chars. Default: 2800
chunk_overlapintegerOverlap between consecutive chunks in chars. Default: 450

Returns

{ stored: true, id: "<uuid>", ids: ["<uuid>", ...], chunks, agent_id }

Example call

{
  "jsonrpc": "2.0", "id": 1,
  "method": "tools/call",
  "params": {
    "name": "memory_store_episode",
    "arguments": {
      "content": "User asked for Q1 financials summary.",
      "metadata": { "user_id": "user_42", "tags": ["finance", "q1"] }
    }
  }
}
memory_get_episodes

Retrieve the most recent episodes for the authenticated agent (newest first).

Parameters

NameTypeReq.Description
limitintegerMax episodes to return. Default: 10

Returns

{ episodes: [...], count }

Example call

{
  "jsonrpc": "2.0", "id": 2,
  "method": "tools/call",
  "params": {
    "name": "memory_get_episodes",
    "arguments": { "limit": 5 }
  }
}
memory_search_episodes

Hybrid search over episodes. Default retrieval is hybrid (RRF fusion of TF-IDF ∪ dense embeddings) — embeddings are computed read-path only, so writes stay zero-LLM. Set use_hybrid:false for lexical-only TF-IDF. Optional pheromone re-ranking for warm/repeated-access workloads.

Parameters

NameTypeReq.Description
querystringNatural language query text
limitintegerMax evidence items to return. Default: 12
use_hybridbooleanFuse TF-IDF ∪ dense embeddings (RRF). Server default: ON in prod. Set false for lexical-only
use_pheromonebooleanRe-rank by pheromone weight. Server default: OFF in prod
max_content_charsintegerTrim each result's content to N chars to save tokens. Default: no trim

Returns

{ results: [{ episode, score, ... }], count, retrieval: "hybrid"|"tfidf" }

Example call

{
  "jsonrpc": "2.0", "id": 3,
  "method": "tools/call",
  "params": {
    "name": "memory_search_episodes",
    "arguments": {
      "query": "What did the user ask about quarterly reports?",
      "limit": 5
    }
  }
}
memory_search_timeline

Return episodes whose validity falls within a time window. Optimized for temporal lookups using the LadybugDB temporal index.

Parameters

NameTypeReq.Description
start_timestring (RFC3339)Window start
end_timestring (RFC3339)Window end

Returns

{ episodes: [...], count, window: { start, end } }

Example call

{
  "jsonrpc": "2.0", "id": 4,
  "method": "tools/call",
  "params": {
    "name": "memory_search_timeline",
    "arguments": {
      "start_time": "2026-05-12T00:00:00Z",
      "end_time": "2026-05-12T23:59:59Z"
    }
  }
}
memory_consolidate_episodes

Consolidate older episodes. Rule-based (no LLM); episodes with pheromone weight < 0.1 are soft-deleted.

Parameters

NameTypeReq.Description
before_timestring (RFC3339)Consolidate episodes older than this. Default: 7 days ago

Returns

{ consolidated, before, note }

Example call

{
  "jsonrpc": "2.0", "id": 5,
  "method": "tools/call",
  "params": {
    "name": "memory_consolidate_episodes",
    "arguments": {
      "before_time": "2026-04-30T23:59:59Z"
    }
  }
}

Semantic Memory — Entities & Relations

5 tools

Named entities and typed relationships. Forms a directed knowledge graph in LadybugDB. Available on every tier, including the free Explorer plan.

memory_store_entityNo LLM at write · $0 ingest — engine-internal graph write (am-local); deployed end-to-end ~150ms

Store a named entity in the agent's knowledge graph. Entities are the nodes of your graph — people, companies, concepts, documents. Can also encode a subject-predicate-object fact via predicate/object_value.

Parameters

NameTypeReq.Description
entity_idstringUnique entity identifier / name (e.g., "Acme Corp", "Alice")
typestringEntity type. Default: "concept"
descriptionstringHuman-readable description
predicatestringPredicate (for subject-predicate-object facts)
object_valuestringObject value (for subject-predicate-object facts)
propertiesobjectStructured metadata (alias of metadata)
metadataobjectStructured metadata (takes precedence if both are sent)

Returns

{ id: "<uuid>", entity_id, stored: true }

Example call

{
  "jsonrpc": "2.0", "id": 6,
  "method": "tools/call",
  "params": {
    "name": "memory_store_entity",
    "arguments": {
      "entity_id": "Acme Corp",
      "type": "organization",
      "description": "Technology company founded in 2020",
      "properties": { "industry": "technology", "founded": 2020 }
    }
  }
}
memory_get_entity

Retrieve a specific entity by its id/name. Returns found:false if absent.

Parameters

NameTypeReq.Description
entity_idstringEntity id/name to fetch

Returns

found → { entity, found: true } · absent → { found: false, entity_id }

Example call

{
  "jsonrpc": "2.0", "id": 7,
  "method": "tools/call",
  "params": {
    "name": "memory_get_entity",
    "arguments": { "entity_id": "Acme Corp" }
  }
}
memory_list_entities

List entities in the agent's knowledge graph.

Parameters

NameTypeReq.Description
limitintegerMax entities to return. Default: 20

Returns

{ entities: [...], count }

Example call

{
  "jsonrpc": "2.0", "id": 8,
  "method": "tools/call",
  "params": {
    "name": "memory_list_entities",
    "arguments": { "limit": 20 }
  }
}
memory_store_relationNo LLM at write · $0 ingest — engine-internal graph write (am-local); deployed end-to-end ~150ms

Create a typed relationship (edge) between two entities in the knowledge graph. Endpoints may be a UUID or a name (a new name is auto-created as a stub).

Parameters

NameTypeReq.Description
from_idstringSource entity (UUID or name; a new name is auto-created as a stub)
to_idstringTarget entity (UUID or name; auto-created if new)
predicatestringRelation label (e.g., "works_at", "approved", "authored")
weightnumberEdge weight. Default: 1.0

Returns

{ id: "<uuid>", from_id, to_id, predicate, stored: true }

Example call

{
  "jsonrpc": "2.0", "id": 9,
  "method": "tools/call",
  "params": {
    "name": "memory_store_relation",
    "arguments": {
      "from_id": "Alice",
      "to_id": "Q3 Budget",
      "predicate": "approved",
      "weight": 0.95
    }
  }
}
memory_get_relations

Get all relations for an entity.

Parameters

NameTypeReq.Description
entity_idstringEntity id/name whose relations to fetch

Returns

{ relations: [...], count, entity_id }

Example call

{
  "jsonrpc": "2.0", "id": 10,
  "method": "tools/call",
  "params": {
    "name": "memory_get_relations",
    "arguments": { "entity_id": "Alice" }
  }
}

Graph & Search

6 tools

Query the knowledge graph, run semantic search, find neighbors, add triples, and compute shortest paths. Powered by LadybugDB (active fork of Kùzu).

memory_query_graph

Run a keyword query against the knowledge graph.

Parameters

NameTypeReq.Description
querystringKeyword graph query text

Returns

Backend graph-query result object (matched nodes/edges; backend-defined shape)

Example call

{
  "jsonrpc": "2.0", "id": 11,
  "method": "tools/call",
  "params": {
    "name": "memory_query_graph",
    "arguments": { "query": "Who approved the Q3 budget?" }
  }
}
memory_semantic_search

TF-IDF semantic search over entities. Returns results ranked by similarity.

Parameters

NameTypeReq.Description
querystringSearch text (TF-IDF over entities)
limitintegerMax results. Default: 10

Returns

{ results: [{ entity, score }], count }

Example call

{
  "jsonrpc": "2.0", "id": 12,
  "method": "tools/call",
  "params": {
    "name": "memory_semantic_search",
    "arguments": {
      "query": "What do we know about Acme Corp?",
      "limit": 15
    }
  }
}
memory_get_neighbors

Expand the immediate neighbors of an entity in the knowledge graph. Fast lookup for exploring local graph structure.

Parameters

NameTypeReq.Description
entity_idstringEntity id/name to expand from
hopsintegerNeighbor hop depth. Default: 1

Returns

{ neighbors: [...], count, entity_id, hops }

Example call

{
  "jsonrpc": "2.0", "id": 13,
  "method": "tools/call",
  "params": {
    "name": "memory_get_neighbors",
    "arguments": {
      "entity_id": "Acme Corp",
      "hops": 1
    }
  }
}
memory_graph_add_tripleNo LLM at write · $0 ingest — engine-internal graph write (am-local); deployed end-to-end ~150ms

Add a (subject, predicate, object) triple to the low-level triple store. Auto-creates nodes if they don't exist.

Parameters

NameTypeReq.Description
subjectstringSubject node label
predicatestringPredicate / edge label
objectstringObject node label

Returns

{ stored: true, triple_id: "<uuid>", subject, predicate, object }

Example call

{
  "jsonrpc": "2.0", "id": 14,
  "method": "tools/call",
  "params": {
    "name": "memory_graph_add_triple",
    "arguments": {
      "subject": "Fetch.ai",
      "predicate": "develops",
      "object": "Agentverse Memory"
    }
  }
}
memory_graph_neighbors

Multi-hop neighbor exploration over the triple store, with depth and direction control.

Parameters

NameTypeReq.Description
nodestringStarting node label
depthintegerHop depth (1–5; capped at 5). Default: 1
directionstring ("outgoing"|"incoming"|"both")Edge direction. Default: "outgoing"

Returns

{ node, depth, direction, count, neighbors: [{ subject, predicate, object }] }

Example call

{
  "jsonrpc": "2.0", "id": 15,
  "method": "tools/call",
  "params": {
    "name": "memory_graph_neighbors",
    "arguments": {
      "node": "Fetch.ai",
      "depth": 2,
      "direction": "both"
    }
  }
}
memory_graph_shortest_path

Find the shortest path between two nodes in the triple store using BFS.

Parameters

NameTypeReq.Description
fromstringSource node label
tostringTarget node label
undirectedbooleanTraverse edges in both directions. Default: false

Returns

{ from, to, undirected, found, hops, path: [...] }

Example call

{
  "jsonrpc": "2.0", "id": 16,
  "method": "tools/call",
  "params": {
    "name": "memory_graph_shortest_path",
    "arguments": {
      "from": "Alice",
      "to": "Q3 Budget",
      "undirected": true
    }
  }
}

Procedural Memory

4 tools

Skill definitions: name → steps. Stores repeatable workflows an agent has learned. Matched by TF-IDF similarity to task descriptions.

memory_store_procedure

Store a procedural memory — a named skill with an ordered step sequence.

Parameters

NameTypeReq.Description
namestringProcedure name (e.g., "generate_q1_report")
descriptionstringDescription
stepsarray<string|object>Ordered steps: plain strings, or objects {action, tool?, expected_output?}. Default: []
tagsarray<string>Tags. Default: []
preconditionsarray<string>Preconditions. Default: []

Returns

{ id: "<uuid>", name, stored: true }

Example call

{
  "jsonrpc": "2.0", "id": 17,
  "method": "tools/call",
  "params": {
    "name": "memory_store_procedure",
    "arguments": {
      "name": "generate_q1_report",
      "description": "Produce Q1 financial summary",
      "steps": [
        "Query Salesforce for Q1 revenue data",
        "Compare to Q4 prior year",
        "Draft 3-bullet summary",
        "Send to Slack #finance"
      ]
    }
  }
}
memory_get_procedure

Retrieve a specific procedure by procedure_id or by name (one of the two is required).

Parameters

NameTypeReq.Description
procedure_idstringProcedure UUID — one of procedure_id / name required
namestringProcedure name — alternative to procedure_id

Returns

found → { procedure, found: true } · absent → { found: false, procedure_id }

Example call

{
  "jsonrpc": "2.0", "id": 18,
  "method": "tools/call",
  "params": {
    "name": "memory_get_procedure",
    "arguments": { "name": "generate_q1_report" }
  }
}
memory_match_procedure

Find the best matching procedures for a task. Returns ranked candidates by TF-IDF similarity.

Parameters

NameTypeReq.Description
taskstringTask description to match against stored procedures
limitintegerMax procedures to return. Default: 5

Returns

{ results: [...], count }

Example call

{
  "jsonrpc": "2.0", "id": 19,
  "method": "tools/call",
  "params": {
    "name": "memory_match_procedure",
    "arguments": {
      "task": "How do I make a quarterly financial report?"
    }
  }
}
memory_update_procedure

Replace a procedure's steps. Creates a new version (the previous version is retained). Identify the procedure by procedure_id or name.

Parameters

NameTypeReq.Description
procedure_idstringProcedure UUID to update — one of procedure_id / name required
namestringProcedure name — alternative to procedure_id
stepsarray<string|object>New ordered steps (replaces old; creates a new version)
reasonstringReason for the update

Returns

{ new_id: "<uuid>", old_procedure_id, updated: true }

Example call

{
  "jsonrpc": "2.0", "id": 20,
  "method": "tools/call",
  "params": {
    "name": "memory_update_procedure",
    "arguments": {
      "name": "generate_q1_report",
      "steps": [
        "Query Salesforce for Q1 revenue data",
        "Compare to Q4 prior year",
        "Draft 5-bullet summary",
        "Review with manager",
        "Send to Slack #finance"
      ],
      "reason": "Added manager review step"
    }
  }
}

Working Memory

4 tools

Ephemeral key/value store with optional TTL. For scratchpad state, active task context, and short-lived agent state that does not need graph indexing.

memory_set_working

Set a key in the agent's working memory with an optional TTL. Non-string content is JSON-encoded.

Parameters

NameTypeReq.Description
keystringWorking memory key (e.g., "current_task")
contentstringValue to store (value accepted as a legacy alias; non-strings are JSON-encoded)
ttl_secondsintegerTime-to-live in seconds. Default: none (no expiry)
session_idstringOptional session scope

Returns

{ key, set: true, ttl_seconds }

Example call

{
  "jsonrpc": "2.0", "id": 21,
  "method": "tools/call",
  "params": {
    "name": "memory_set_working",
    "arguments": {
      "key": "current_task",
      "content": "Drafting Q1 financial report for user_42",
      "ttl_seconds": 3600
    }
  }
}
memory_get_working

Retrieve a value from working memory by key. Returns found:false if absent or expired.

Parameters

NameTypeReq.Description
keystringKey to fetch

Returns

found → { item, found: true } · absent/expired → { found: false, key }

Example call

{
  "jsonrpc": "2.0", "id": 22,
  "method": "tools/call",
  "params": {
    "name": "memory_get_working",
    "arguments": { "key": "current_task" }
  }
}
memory_list_working

List all live (non-expired) working-memory items for the agent.

Parameters

No parameters.

Returns

{ items: [...], count }

Example call

{
  "jsonrpc": "2.0", "id": 23,
  "method": "tools/call",
  "params": {
    "name": "memory_list_working",
    "arguments": {}
  }
}
memory_clear_working

Delete a specific working memory key, or clear all working memory (omit key).

Parameters

NameTypeReq.Description
keystringKey to delete; omit to clear ALL working memory

Returns

single key → { key, removed } · clear-all → { cleared: true, keys_deleted }

Example call

{
  "jsonrpc": "2.0", "id": 24,
  "method": "tools/call",
  "params": {
    "name": "memory_clear_working",
    "arguments": { "key": "current_task" }
  }
}

Pheromone Trails

2 tools

Stigmergic memory trails. Deposit pheromones on nodes to influence future retrieval ranking. The more a memory is accessed/reinforced, the stronger its trail.

memory_deposit_pheromone

Deposit a pheromone signal on a node (episode UUID or entity name/ID). Strengthens its retrieval weight for future queries.

Parameters

NameTypeReq.Description
node_idstringEpisode UUID or entity name/ID to reinforce
strengthnumberPheromone deposit strength. Default: 1.0

Returns

{ node_id, new_weight, node_type: "episode"|"entity" }

Example call

{
  "jsonrpc": "2.0", "id": 25,
  "method": "tools/call",
  "params": {
    "name": "memory_deposit_pheromone",
    "arguments": {
      "node_id": "Acme Corp",
      "strength": 0.3
    }
  }
}
memory_get_pheromone

Get the current pheromone weight for a node.

Parameters

NameTypeReq.Description
node_idstringEpisode UUID or entity name/ID to query

Returns

found → { node_id, weight, node_type } · absent → { node_id, found: false }

Example call

{
  "jsonrpc": "2.0", "id": 26,
  "method": "tools/call",
  "params": {
    "name": "memory_get_pheromone",
    "arguments": { "node_id": "Acme Corp" }
  }
}

Graph Traversal

2 tools

Advanced graph traversal: BFS/DFS exploration (every tier) and A* pathfinding (Builder+). Use memory_traverse_graph on the free Explorer tier.

memory_find_pathBuilder+

Find a path between two entities using A* pathfinding. Builder+ tier — lower tiers receive an in-band -32002 forbidden error; use memory_traverse_graph (BFS) on the free Explorer tier.

Parameters

NameTypeReq.Description
from_idstringSource node identifier
to_idstringTarget node identifier
max_hopsintegerMaximum path length (hops). Default: 6

Returns

{ path: [...], hops, from_id, to_id } (Builder+; else in-band -32002)

Example call

{
  "jsonrpc": "2.0", "id": 27,
  "method": "tools/call",
  "params": {
    "name": "memory_find_path",
    "arguments": {
      "from_id": "Alice",
      "to_id": "Q3 Budget",
      "max_hops": 4
    }
  }
}
memory_traverse_graph

Traverse the knowledge graph from a starting node using BFS or DFS. Available on every tier, including the free Explorer plan.

Parameters

NameTypeReq.Description
start_idstringStarting node identifier
algorithmstring ("bfs"|"dfs")Traversal algorithm. Default: "bfs"
max_depthintegerMaximum traversal depth. Default: 3

Returns

{ visited: [...], count, start_id, algorithm, max_depth }

Example call

{
  "jsonrpc": "2.0", "id": 28,
  "method": "tools/call",
  "params": {
    "name": "memory_traverse_graph",
    "arguments": {
      "start_id": "Acme Corp",
      "algorithm": "bfs",
      "max_depth": 3
    }
  }
}

Shared Spaces

5 tools

Multi-agent shared memory with DID-authenticated access control. These tools require JWT auth (Authorization: Bearer <jwt>) in addition to your API key — self-mint a short-lived JWT via POST /v1/space-token from a Builder+ key. All shared-space tools are Builder+.

memory_create_shared_spaceBuilder+

Create a shared memory space. The calling agent becomes the space owner. Requires a space JWT (POST /v1/space-token from a Builder+ key).

Parameters

NameTypeReq.Description
namestringSpace name (1–128 characters)

Returns

{ space_id, name, owner_did, members, created_at, status: "created" }

Example call

{
  "jsonrpc": "2.0", "id": 29,
  "method": "tools/call",
  "params": {
    "name": "memory_create_shared_space",
    "arguments": { "name": "research-team" }
  }
}
memory_join_shared_spaceBuilder+

Join an existing shared memory space (the JWT must grant access to it). Requires a space JWT.

Parameters

NameTypeReq.Description
space_idstringSpace ID to join (JWT must grant access to it)
rolestring ("owner"|"writer"|"reader")Requested role. Default: "writer"

Returns

{ space_id, agent_did, role, members, status: "joined" }

Example call

{
  "jsonrpc": "2.0", "id": 30,
  "method": "tools/call",
  "params": {
    "name": "memory_join_shared_space",
    "arguments": {
      "space_id": "space_04ia...",
      "role": "writer"
    }
  }
}
memory_shared_store_entityBuilder+

Store an entity into a shared space's knowledge graph (requires writer/owner role). Requires a space JWT.

Parameters

NameTypeReq.Description
space_idstringSpace ID (requires writer/owner role)
namestringEntity name
entity_typestringEntity type. Default: "thing"
descriptionstringDescription

Returns

{ space_id, entity_id: "<uuid>", name, entity_type, stored_by, status: "stored" }

Example call

{
  "jsonrpc": "2.0", "id": 31,
  "method": "tools/call",
  "params": {
    "name": "memory_shared_store_entity",
    "arguments": {
      "space_id": "space_04ia...",
      "name": "Project Alpha",
      "entity_type": "project",
      "description": "Active high-priority project"
    }
  }
}
memory_shared_queryBuilder+

Query the shared knowledge graph across all agents in a space (requires reader/writer/owner role). Empty/omitted query lists all entities. Requires a space JWT.

Parameters

NameTypeReq.Description
space_idstringSpace ID (requires reader/writer/owner role)
querystringSearch query; empty/omitted lists all entities. Default: "" (list all)
limitintegerMax results. Default: 10

Returns

{ space_id, query, count, results: [{ id, name, entity_type, description, score? }] }

Example call

{
  "jsonrpc": "2.0", "id": 32,
  "method": "tools/call",
  "params": {
    "name": "memory_shared_query",
    "arguments": {
      "space_id": "space_04ia...",
      "query": "What has any agent learned about Project Alpha?",
      "limit": 10
    }
  }
}
memory_list_shared_spacesBuilder+

List all shared spaces the agent belongs to, including ownership info and member counts. Requires a space JWT.

Parameters

No parameters.

Returns

{ agent_did, count, spaces: [{ space_id, name, owner_did, my_role, member_count, created_at }] }

Example call

{
  "jsonrpc": "2.0", "id": 33,
  "method": "tools/call",
  "params": {
    "name": "memory_list_shared_spaces",
    "arguments": {}
  }
}

System

2 tools

Usage statistics and agent management.

memory_get_stats

Get usage statistics and memory counts for the authenticated agent, including tier and monthly ops consumption.

Parameters

No parameters.

Returns

{ agent_id, tier, monthly_ops_used, monthly_op_limit, memory: { episode_count, entity_count, relation_count, procedure_count, working_count } }

Example call

{
  "jsonrpc": "2.0", "id": 34,
  "method": "tools/call",
  "params": {
    "name": "memory_get_stats",
    "arguments": {}
  }
}
memory_delete_agent

Permanently delete all memory data for the agent — episodes, entities, relations, procedures, working memory, and pheromone trails. Irreversible (GDPR).

Parameters

NameTypeReq.Description
confirmbooleanMust be true to permanently delete all of this agent's memory (irreversible)

Returns

{ agent_id, deleted: true, note }

Example call

{
  "jsonrpc": "2.0", "id": 35,
  "method": "tools/call",
  "params": {
    "name": "memory_delete_agent",
    "arguments": { "confirm": true }
  }
}

🐳 Self-Hosting

All 35 tools are available when self-hosting via Docker Compose (Dockerfile.standalone). Run docker compose up to start a local instance with LadybugDB. Usage metering is available at GET /v1/usage.