mem9-ai/mem9

Unlimited memory for OpenClaw

mem9 – Persistent Memory for AI Agents

What it is – mem9 is a server‑side service that gives AI‑driven agents a shared, durable memory store. Instead of each agent keeping its own temporary notebook, mem9 lets them write facts, retrieve them later (by keyword or semantic similarity), and keep that knowledge across restarts, machines, and even different tooling platforms.

Why it matters – Many coding‑assistant agents (OpenClaw, Hermes, Claude Code, OpenCode, Codex, DeepSeek Harness, Dify, etc.) lose context when the process ends. mem9 solves that by providing:

  • Persistent storage – memories survive session shutdowns and laptop switches.
  • Cross‑agent sharing – the same “space” can be used by many runtimes, enabling coordinated workflows.
  • Hybrid recall – you can search by vector similarity or plain text, and view results in a visual dashboard.
  • Stateless plugins – the agents only need to call a thin HTTP API; all heavy lifting (search, embedding, policy) lives in the mem9 server.

How you use it

  1. Pick an endpoint – either the hosted API (https://api.mem9.ai) or run the server yourself (mnemo‑server).
  2. Create a “space” – a logical bucket for memories. The hosted service auto‑provisions a TiDB‑backed space; self‑hosted deployments require you to apply a control‑plane schema and set a DSN.
  3. Call the REST API – the core operations are POST /memories (write), GET /memories (search), GET /memories/{id} (fetch), PUT /memories/{id} (update) and DELETE /memories/{id}. Authentication is via an X‑API‑Key header (or legacy tenant‑path headers).
  4. Plug into your agent – mem9 ships ready‑made plugins for the major coding‑assistant platforms listed above, or you can integrate directly with any HTTP client.

Key technical bits

  • Back‑ends – The server can run on TiDB (default), PostgreSQL, or a custom db9 store. TiDB gives built‑in vector search, full‑text search, and automatic embedding via Cohere models.
  • Embedding – You can let TiDB auto‑embed (MNEMO_EMBED_AUTO_MODEL) or supply your own OpenAI‑compatible embeddings.
  • Smart ingest – When enabled, the server runs an LLM (default gpt‑4o‑mini) to extract durable facts from incoming chat sessions before storing them.
  • Space Chains – Advanced feature that lets you link multiple spaces into a routing pipeline, with per‑node routing policies and webhook notifications.
  • Webhooks – Mem9 can push events (memory.added, memory.deleted, etc.) to external services, useful for audit logs or triggering downstream actions.

Getting started

# Self‑hosted example (TiDB backend)
cd server
MNEMO_DSN="user:pass@tcp(host:4000)/mnemos?parseTime=true" go run ./cmd/mnemo-server

Or, for quick experimentation, set the environment variables for the hosted API and start using the SDKs or curl:

export MEM9_API_URL="https://api.mem9.ai"
export MEM9_API_KEY="<your‑key>"
curl -X POST "$MEM9_API_URL/v1alpha2/mem9s/memories" \
     -H "X-API-Key: $MEM9_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"content":"The function foo() adds two numbers","metadata":{}}'

Who it’s for – Teams building multi‑agent coding assistants, RAG pipelines, or any AI workflow that needs a reliable, searchable knowledge base that lives beyond a single process.


All details above are taken directly from the repository’s README.

Related

  • Project
  • Project
  • Project
  • Project
  • Project