Every MCP tool, every HTTP endpoint, every CLI command — categorized, cross-referenced, signed off. 43 + 50 + 40 = 133 operations exposed across three protocol fronts. One implementation underneath, three ways to call it.
Same Rust binary, four startup mode flags. The mode determines which IPC surface is active and which background loops run. Switch by changing one CLI flag — no config file edits required.
Auto-discovered by Claude Code, Cursor, Codex, Continue, Gemini CLI, Windsurf, and any MCP-compliant client. Tool names follow memory_<verb> convention.
Axum-served. mTLS-aware. CORS layer. Prometheus metrics at /metrics. Body limit 2 MiB. Trace spans on every request. The same operations as MCP, plus federation-private peer endpoints.
| Method | Path | Purpose |
|---|---|---|
| GET | /api/v1/health | Liveness check. Always returns 200. |
| GET | /metrics | Prometheus scrape (community convention path). |
| GET | /api/v1/metrics | Prometheus scrape (REST-consistent path). |
| GET | /api/v1/capabilities | Self-describing introspection. |
| GET | /api/v1/stats | Per-namespace counts + tier breakdown. |
| — Memory CRUD — | ||
| GET | /api/v1/memories | List memories, paginated, filter. |
| POST | /api/v1/memories | Create new memory. |
| POST | /api/v1/memories/bulk | Bulk insert with partial-success semantics. |
| GET | /api/v1/memories/{id} | Fetch one memory by ID. |
| PUT | /api/v1/memories/{id} | Update existing memory. |
| DELETE | /api/v1/memories/{id} | Soft-delete to archive tier. |
| POST | /api/v1/memories/{id}/promote | Tier promotion or vertical hierarchy clone. |
| — Search & recall — | ||
| GET | /api/v1/search | FTS5 keyword search. |
| GET | /api/v1/recall | Hybrid recall (GET form for cacheability). |
| POST | /api/v1/recall | Hybrid recall (POST form for large payloads). |
| POST | /api/v1/forget | Bulk delete by query. |
| POST | /api/v1/consolidate | Merge N memories into 1. |
| GET | /api/v1/contradictions | List detected contradiction pairs. |
| GET | /api/v1/check_duplicate | Pre-write similarity check. |
| — Knowledge graph — | ||
| POST | /api/v1/links | Create typed link. |
| DELETE | /api/v1/links | Delete a link. |
| GET | /api/v1/links/{id} | Fetch one link. |
| GET | /api/v1/taxonomy | Hierarchical namespace tree. |
| GET | /api/v1/kg/timeline | Ordered fact timeline for an entity. |
| POST | /api/v1/kg/invalidate | Set valid_until on a link. |
| POST | /api/v1/kg/query | Recursive-CTE outbound traversal. |
| — Entities (Stream B) — | ||
| POST | /api/v1/entities | Register entity with aliases. |
| GET | /api/v1/entities/by_alias | Resolve alias → canonical entity. |
| — Namespace policy — | ||
| GET | /api/v1/namespaces | List namespaces (or get standard via ?namespace=). |
| POST | /api/v1/namespaces | Set namespace standard (query-string form). |
| DELETE | /api/v1/namespaces | Clear namespace standard (query-string form). |
| GET | /api/v1/namespaces/{ns}/standard | Get standard (path form, MCP parity). |
| POST | /api/v1/namespaces/{ns}/standard | Set standard (path form). |
| DELETE | /api/v1/namespaces/{ns}/standard | Clear standard (path form). |
| — Archive & GC — | ||
| GET | /api/v1/archive | List archived memories. |
| POST | /api/v1/archive | Bulk archive by IDs. |
| DELETE | /api/v1/archive | Hard purge archived > N days old. |
| POST | /api/v1/archive/{id}/restore | Restore archived to original tier. |
| GET | /api/v1/archive/stats | Archive size + age histogram. |
| POST | /api/v1/gc | Manual GC trigger. |
| GET | /api/v1/export | JSON dump of all memories + links. |
| POST | /api/v1/import | Bulk JSON import. |
| — Federation peer-private — | ||
| POST | /api/v1/sync/push | Peer pushes a batch. |
| GET | /api/v1/sync/since | Peer pulls since cursor. |
| — Subscriptions & A2A — | ||
| POST | /api/v1/notify | Send notification to agent inbox. |
| GET | /api/v1/inbox | Read pending notifications. |
| POST | /api/v1/subscriptions | Register webhook. |
| DELETE | /api/v1/subscriptions | Unsubscribe. |
| GET | /api/v1/subscriptions | List active subscriptions. |
| POST | /api/v1/session/start | Initialize agent session. |
| — Agents & pending — | ||
| GET | /api/v1/agents | List registered agents. |
| POST | /api/v1/agents | Register agent. |
| GET | /api/v1/pending | List pending governance actions. |
| POST | /api/v1/pending/{id}/approve | Approve pending action. |
| POST | /api/v1/pending/{id}/reject | Reject pending action. |
Direct subcommands of the ai-memory binary. No daemon required for read/write commands. Run against any database file via --db <path>.
--content - reads stdin.For each logical operation, here's the MCP tool, the HTTP endpoint, and the CLI command. Every row maps to the same underlying handler in src/db.rs — three protocol fronts, one source of truth.
| Operation | MCP Tool | HTTP Endpoint | CLI Command |
|---|---|---|---|
| Hybrid recall | memory_recall | GET /api/v1/recall | recall <ctx> |
| Keyword search | memory_search | GET /api/v1/search | search <q> |
| Get one | memory_get | GET /api/v1/memories/{id} | get <id> |
| List | memory_list | GET /api/v1/memories | list |
| Store | memory_store | POST /api/v1/memories | store --title --content |
| Bulk store | via multiple stores | POST /api/v1/memories/bulk | import (stdin JSON) |
| Update | memory_update | PUT /api/v1/memories/{id} | update <id> |
| Delete | memory_delete | DELETE /api/v1/memories/{id} | delete <id> |
| Promote | memory_promote | POST /api/v1/memories/{id}/promote | promote <id> |
| Bulk forget | memory_forget | POST /api/v1/forget | forget --pattern |
| Consolidate | memory_consolidate | POST /api/v1/consolidate | consolidate --ids |
| Detect contradiction | memory_detect_contradiction | GET /api/v1/contradictions | via curator |
| Check duplicate | memory_check_duplicate | GET /api/v1/check_duplicate | via store --check |
| Create link | memory_link | POST /api/v1/links | link <src> <tgt> |
| Get links | memory_get_links | GET /api/v1/links/{id} | via get (auto-includes) |
| Taxonomy | memory_get_taxonomy | GET /api/v1/taxonomy | via stats |
| KG query | memory_kg_query | POST /api/v1/kg/query | via shell |
| KG timeline | memory_kg_timeline | GET /api/v1/kg/timeline | via shell |
| KG invalidate | memory_kg_invalidate | POST /api/v1/kg/invalidate | resolve <winner> <loser> |
| Register entity | memory_entity_register | POST /api/v1/entities | via store + tag |
| Resolve alias | memory_entity_get_by_alias | GET /api/v1/entities/by_alias | via search |
| Stats | memory_stats | GET /api/v1/stats | stats |
| Capabilities | memory_capabilities | GET /api/v1/capabilities | via stats --json |
| Session start | memory_session_start | POST /api/v1/session/start | N/A |
| GC | memory_gc | POST /api/v1/gc | gc |
| Archive list | via list + filter | GET /api/v1/archive | archive list |
| Archive restore | via promote | POST /api/v1/archive/{id}/restore | archive restore --id |
| Archive purge | via forget | DELETE /api/v1/archive | archive purge --older-than |
| Export | via list bulk | GET /api/v1/export | export |
| Import | via store batch | POST /api/v1/import | import |
| Subscribe | memory_subscribe | POST /api/v1/subscriptions | via shell |
| Unsubscribe | memory_unsubscribe | DELETE /api/v1/subscriptions | via shell |
| List subs | memory_list_subscriptions | GET /api/v1/subscriptions | via shell |
| Notify | memory_notify | POST /api/v1/notify | via shell |
| Inbox | memory_inbox | GET /api/v1/inbox | via shell |
| Register agent | memory_agent_register | POST /api/v1/agents | agents register |
| List agents | memory_agent_list | GET /api/v1/agents | agents list |
| Pending list | memory_pending_list | GET /api/v1/pending | pending list |
| Pending approve | memory_pending_approve | POST /api/v1/pending/{id}/approve | pending approve <id> |
| Pending reject | memory_pending_reject | POST /api/v1/pending/{id}/reject | pending reject <id> |
| Sync push (peer) | peer-private | POST /api/v1/sync/push | peer-private |
| Sync since (peer) | peer-private | GET /api/v1/sync/since | peer-private |