Skip to main content
GET
https://api.memoclaw.com
/
v1
/
memories
/
{id}
/
graph
Memory Graph
curl --request GET \
  --url https://api.memoclaw.com/v1/memories/{id}/graph
{
  "root": {
    "id": "<string>",
    "content": "<string>",
    "importance": 123
  },
  "nodes": [
    {}
  ],
  "edges": [
    {
      "source_id": "<string>",
      "target_id": "<string>",
      "relation_type": "<string>"
    }
  ],
  "depth": 123
}
Price: FREE Traverse the knowledge graph of related memories. Returns connected memories up to N hops away, with relationship edges. This endpoint helps visualize and explore how memories relate to each other through the relations API.

Path Parameters

id
string
required
UUID of the starting memory.

Query Parameters

depth
number
Maximum hops to traverse. Default: 2. Max: 5.
limit
number
Maximum total memories to return. Default: 50. Max: 200.
relation_types
string
Comma-separated list of relation types to include: related_to, derived_from, contradicts, supersedes, supports.

Response (200 OK)

root
object
The starting memory.
nodes
array
All memories discovered in the graph traversal.
edges
array
Relationships between memories.
depth
number
Actual depth traversed.

Example

curl "https://api.memoclaw.com/v1/memories/550e8400-e29b-41d4-a716-446655440000/graph?depth=2" \
  -H "Authorization: Bearer <token>"
Response
{
  "root": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "content": "User prefers dark mode",
    "importance": 0.8
  },
  "nodes": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "content": "User prefers dark mode",
      "importance": 0.8
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "content": "Dark mode saves battery",
      "importance": 0.5
    },
    {
      "id": "770e8400-e29b-41d4-a716-446655440002",
      "content": "User uses vim keybindings",
      "importance": 0.7
    }
  ],
  "edges": [
    {
      "source_id": "550e8400-e29b-41d4-a716-446655440000",
      "target_id": "660e8400-e29b-41d4-a716-446655440001",
      "relation_type": "supports"
    },
    {
      "source_id": "550e8400-e29b-41d4-a716-446655440000",
      "target_id": "770e8400-e29b-41d4-a716-446655440002",
      "relation_type": "related_to"
    }
  ],
  "depth": 2
}