API Reference
memory_export_subgraph
Export a portion of the graph for backup or sharing
memory_export_subgraph
Export a portion of the knowledge graph as a portable JSON structure. Use for backups, sharing between agents, or migrating data.
Parameters
Specific node IDs to export. The export includes these nodes and all edges between them.
Starting node for graph traversal. Exports this node and all nodes reachable within depth hops.
When using root_node_id, how many hops to traverse. Default: 2. Maximum: 5.
Whether to include edges and hyperedges. Default: true.
Source graph. Defaults to your account’s default graph.
Provide either node_ids OR root_node_id, not both.
Example request (specific nodes)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "memory_export_subgraph",
"arguments": {
"node_ids": ["node_abc123", "node_def456", "node_ghi789"],
"include_edges": true
}
}
}
Example request (traversal)
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "memory_export_subgraph",
"arguments": {
"root_node_id": "node_sarah_abc123",
"depth": 2
}
}
}
Example response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"export_id": "exp_xyz789",
"exported_at": "2026-03-15T14:30:00Z",
"source_graph": "default",
"nodes": [
{
"id": "node_abc123",
"content": "Sarah Chen, Backend Tech Lead",
"node_type": "person",
"metadata": {"team": "backend", "level": "senior"},
"created_at": "2026-01-15T10:00:00Z",
"updated_at": "2026-02-20T14:00:00Z"
},
{
"id": "node_def456",
"content": "Project Phoenix: API modernization",
"node_type": "project",
"metadata": {"status": "active"},
"created_at": "2026-01-20T09:00:00Z",
"updated_at": "2026-01-20T09:00:00Z"
}
],
"edges": [
{
"id": "edge_uvw123",
"edge_type": "manages",
"directed": true,
"source": "node_abc123",
"target": "node_def456",
"metadata": {"since": "2026-01"},
"created_at": "2026-01-20T09:00:00Z"
}
],
"hyperedges": [
{
"id": "hedge_qrs456",
"edge_type": "decision_context",
"content": "Tech stack decision",
"nodes": ["node_abc123", "node_def456", "node_ghi789"],
"metadata": {"outcome": "PostgreSQL"},
"created_at": "2026-02-01T15:00:00Z"
}
],
"stats": {
"total_nodes": 2,
"total_edges": 1,
"total_hyperedges": 1
}
}
}
Response fields
| Field | Type | Description |
|---|---|---|
export_id | string | Unique identifier for this export |
exported_at | string | Export timestamp |
source_graph | string | Graph the data came from |
nodes | array | Exported nodes with full data |
edges | array | Binary edges between exported nodes |
hyperedges | array | Hyperedges involving exported nodes |
stats | object | Summary counts |
Errors
| Code | Description |
|---|---|
INVALID_PARAMETER | Invalid combination of parameters |
NODE_NOT_FOUND | Specified node doesn’t exist |
EXPORT_TOO_LARGE | Export exceeds size limit (10MB) |
GRAPH_NOT_FOUND | Specified graph_id doesn’t exist |
QUOTA_EXCEEDED | Monthly query limit reached |
Notes
Query cost — Each memory_export_subgraph call counts as 1 query.
Requires admin scope — This operation requires memory:admin scope.
Export size limits
| Plan | Max export size |
|---|---|
| Free | 1 MB |
| Developer | 10 MB |
| Pro | 50 MB |
| Enterprise | Custom |
Use cases
Backup specific knowledge:
{
"root_node_id": "node_project_alpha",
"depth": 3
}
Share knowledge with another agent:
{
"node_ids": ["node_a", "node_b", "node_c"],
"include_edges": true
}
Archive before deletion:
{
"node_ids": ["node_to_delete"],
"depth": 1
}
Edges in exports
Only edges where both endpoints are in the export are included:
Exported: [A, B, C]
A ─── B ✅ Included (both nodes exported)
B ─── C ✅ Included
A ─── D ❌ Not included (D not exported)
Importing exports
Use memory_load_link to import exported data:
{
"name": "memory_load_link",
"arguments": {
"data": {/* exported subgraph */},
"graph_id": "target_graph"
}
}
See memory_load_link for import options.