MemOS overview

A local-first memory layer for AI agents. One SQLite file, four surfaces, no cloud account in the core path.

MemOS is a local-first memory layer for AI agents. It stores facts, preferences, decisions, and ingested documents in a single SQLite file, then recalls them through a TypeScript SDK, a CLI, an MCP server, or an HTTP API.

There is no account, no hosted control plane, and no API key in the core path.

Why it exists

Hosted memory APIs are convenient, but they make your context someone else's service. MemOS takes the opposite position: the memory is a file on your disk. You can inspect it, back it up, encrypt it, export it, or delete it without asking a vendor.

That choice also makes the system useful where cloud memory is not: offline laptops, air-gapped machines, regulated environments, and local-model setups.

The four surfaces

SurfaceUse it forStart
TypeScript SDKEmbed memory in a Node or Bun appnpm install @mem-os/sdk
CLILocal work, scripts, and maintenancenpx -y @mem-os/sdk --help
MCP serverAny MCP-capable coding agentnpx -y @mem-os/sdk mcp
HTTP APIPython, Dify, n8n, or a shared servicememos-server

All four read and write the same SQLite database. MEMOS_DB_PATH selects the file; MEMOS_NAMESPACE selects the default namespace.

What you get

  • Graph memory. Nodes have typed edges: relates_to, contradicts, supports, derived_from, temporal_precedes, and more.
  • Trust and provenance. Every memory can carry a source, a trust score, and a version timeline. Trust-weighted retrieval is built in.
  • Temporal validity. validFrom / validTo and searchTemporal() let you ask what was true at a point in time.
  • Context packs. Token-budgeted bundles of memory, graph neighbours, and citations, ready to inject into a prompt.
  • Consolidation. Deduplicate, archive, summarise clusters, and decay stale memories without losing history.
  • Audit and deletion. A tamper-evident log, export, and deletion certificates.
  • Encryption at rest. memos encrypt uses SQLite's encrypted build.
  • Image memory. Captions plus optional CLIP pixel search.
  • MCP native. stdio and Streamable HTTP, with a published compatibility policy.

Works with

Claude Code, Cursor, Codex, Gemini CLI, Hermes, OpenClaw, Cline, Zed, Goose, Kilo, pi, OpenCode, Windsurf, and any MCP client. memos connect <harness> writes the config for you; see the harness matrix.

Next