Lumen Night Reader
~/posts/kimi-cli-memory-options

Kimi Cli Memory Options

24 min read Markdown

Consolidated, validated reference for adding durable cross-session memory to Kimi Code CLI. All claims about external repositories were re-verified against upstream sources (May 2026). Unverified or contradicted claims from source drafts are marked or removed.


Verdict

Best default (validated)     →  agentmemory (rohitg00)
                                MCP stdio, 51 tools, local iii-engine + embeddings, REST + viewer
                                Officially supports Claude Code, Cursor, Gemini CLI, OpenCode,
                                Codex CLI, Hermes, OpenClaw, pi. Kimi CLI not on official list,
                                but standard MCP stdio block should work.

Best minimal local           →  ai-memory-mcp (alphaonedev)
                                Rust binary, single SQLite + FTS5, 97.8% R@5 on LongMemEval,
                                26 MCP tools, WAL mode, 79% smaller TOON output, no API cost.

Best Kimi-native             →  kimi-mneme (claimed by source drafts) — UNVERIFIED
                                ⚠️ Could not be located on GitHub or PyPI in May 2026.
                                Do not include in install plan until existence confirmed.

Best minimal Python          →  rekal (janbjorge)
                                Python 3.11+, single SQLite + FTS5 + sqlite-vec (384-dim),
                                16 MCP tools, simple stdio, primary target Codex CLI / OpenCode.

Best MCP graph route         →  mem0-mcp-selfhosted (elvismdev)
                                Qdrant + optional Neo4j + Ollama, ~11 tools, fully offline.

Best multi-agent             →  HeurChain
                                Confirmed Kimi CLI read/write via MCP SSE in source drafts;
                                Redis + vault, ACT-R decay, BM25 only.

Best temporal reasoning      →  Graphiti (Zep)
                                Neo4j/FalkorDB, fact validity windows, NER pipeline.
                                Operationally heavy; specialized use case.

Avoid                        →  MemNexus, Mem0 Cloud, Zep Cloud (data leaves machine)
                                Letta, Honcho (replace the agent rather than extend it)
                                Raw vector DBs without memory logic (RAG poisoning over time)
                                SSE-only servers for new setups (SSE deprecated in MCP spec March 2025)
                                kimi-memory-mcp (SARPixelPioneer) — AgentSeal 75/100, DeepSeek required

Kimi CLI Native Memory Surface — What You Get Out of the Box

FeatureWhat it givesWhat it does not give
Session persistenceContinue a session; context survives compaction via PreCompact/PostCompact hooksDurable searchable memory across sessions or projects
AGENTS.mdProject rules and conventions auto-loaded on session startAutomatic extraction of decisions, debugging insights, or evolving facts
Hooks (Beta)13 lifecycle events configured as [[hooks]] in ~/.kimi/config.toml (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Notification, PreCompact, Stop, etc.); regex matchers, timeouts, blocking via exit code 2Storage or retrieval backend by itself
Skills (.kimi/skills/)Prompt-injected skill instructions, scoped Project > User > Extra > Built-inPersistent cross-session memory
MCP (~/.kimi/mcp.json)Any standard MCP server via stdio or Streamable HTTP; managed with kimi mcp subcommandAutomatic memory unless the agent actively calls memory tools
PluginsLocal toolkits packaged via plugin.json; OAuth credentials can be injected via inject blockLong-term memory unless the plugin implements it
Agent FlowWorkflow orchestrationNot a memory layer

Key constraints:

  • Hooks are Beta. Implementation details and configuration definitions may change in future versions. Plugins relying on hook JSON payload shape may break on minor releases.
  • Global ~/.kimi/AGENTS.md is not implemented (issue #2152).
  • Native long-term memory is an open feature request (issues #1167, #1283).
  • MoonshotAI has stated they have no plan to add a lifecycle hooks system internally beyond the current Beta implementation — orchestration is delegated to Agent Flow (discussion #986).

Key opportunity: The hooks system — specifically SessionStart for injection and PostToolUse for capture — is the correct integration layer for automated memory. It runs silently without consuming agent tokens on explicit tool calls.


Memory Types for a Coding Agent

TypePurposeTypical storageExample
Static instructionsStable rules and preferencesAGENTS.md, config filesCoding style, forbidden libraries, build commands
Session persistenceRestoring in-progress CLI stateKimi session storeResuming an interrupted session
EpisodicWhat happened in previous sessionsSQLite, JSONL, vector DB“We fixed auth timeout by changing retry logic”
SemanticSearchable facts retrievable by meaningSQLite FTS, embeddings, Qdrant“What did we learn about that auth bug last week?”
ProceduralHow to do recurring tasksMarkdown, command recipesRelease procedure for this repo
Entity / relationshipFacts connected as a graphNeo4j, FalkorDB, GraphitiService A depends on table B and queue C
ReflectiveLessons learned, debugging insightsSummaries, memory notes“Do not use this API — breaks on Windows”
Multi-agent sharedShared context across toolsHTTP / MCP serviceKimi + Claude Code + Cursor on one knowledge base

A serious coding-agent memory system should usually combine: static rules + episodic summaries + semantic retrieval + explicit project facts. Graph memory is useful later, but using it on day one is architectural CrossFit.

A plain vector DB is storage, not memory. Without capture policy, fact invalidation, deduplication, and retrieval logic, it accumulates contradictions (RAG poisoning). Choose systems with memory logic, not just storage.


Selection Criteria

CriterionRequirement
Kimi CLI compatibilityWorks via ~/.kimi/mcp.json (stdio/HTTP) or kimi mcp add
Install path≤5 commands from zero to working; documented; reproducible
Local / self-hostedData stays on machine by default; embeddings via Ollama/FastEmbed/ONNX configurable
Retrieval qualityHybrid search (semantic + keyword or graph); handles temporal facts
MaintenanceActive repo within 90 days; responsive issues; current MCP spec
PrivacyNo mandatory cloud calls for core operations; local LLM support
Operational complexitySolo dev: <10 min to working; Docker overhead must be justified
Token economyLazy retrieval, summaries, scoped injection, progressive disclosure
ExtensibilityCan evolve from single local file to multi-agent shared infra

Master Shortlist

SystemTypeKimi fitStorageTransportSelf-hostedVerdict
agentmemoryHybrid semantic + KG + FTSDirect (stdio)iii engine (local)stdio + RESTYesInstall now — default
ai-memory-mcpSQLite + FTS5 + cosineDirect (stdio)Single SQLite + WALstdio + RESTYesInstall now — minimal
rekalSQLite + FTS5 + sqlite-vecDirect (stdio)~/.rekal/memory.dbstdioYesBest simple local Python
kimi-mnemeClaimed Kimi-native pluginClaimed native hooksSQLite + sqlite-vecMCP claimedYes⚠️ Unverified — do not rely
mem0-mcp-selfhostedSemantic + graphDirect (stdio)Qdrant + Neo4jstdioYesBest graph MCP route
HeurChainTiered universalConfirmed (SSE)Redis + vaultSSEYes (Docker)Best multi-agent
mnemonHybrid BM25 + vectorMCP stdioSQLite + vectorstdioYesBest typed Python option
MnemoHybrid semanticMCP stdioSQLite (WASM) + HNSWstdioYesLightest npm option
EngramZero-dep localMCP stdioSQLite + ONNX embedsstdioYesZero-config alt to agentmemory
mcp-memory-service (doobidoo)Hybrid + KGDirect (stdio + REST)SQLite-vec (default) / hybridstdio + HTTPYesEvaluate — general purpose
OpenMemory (Mem0)Temporal graph + UIHTTP MCPSQLite/Postgres + optional Neo4jHTTPYes (Docker)Evaluate — temporal
Hindsight (Vectorize)Structured 4-strategy retrievalHTTP MCPPostgres + pgvectorHTTPYes (Docker)Evaluate — best retrieval quality
Graphiti (Zep)Temporal knowledge graphMCP serverNeo4j / FalkorDBMCPYes (heavy)Specialized — temporal
@mcp/server-memoryOfficial Anthropic KGDirect (stdio)JSONL filestdioYesBaseline graph starter
ipiton/agent-memory-mcpTyped (4 categories)Direct (stdio)Files + vectorstdioYesStrict type safety, full offline
mcp-server-qdrant (official)Vector backendMCP stdioQdrantstdioYesScale beyond SQLite
VestigeRepo-pinnedDirect (stdio)SQLite per repostdioYesEvaluate — project isolation
CogneeGraphRAG control planeAdapter requiredNetworkX / Neo4jHTTPYesEvaluate — repo knowledge
mcp-local-memoryEntity / relation KGDirect (stdio)SQLite + sqlite-vecstdioYesEvaluate — structured lightweight
Honcho / LettaMulti-agent platformsWrong paradigm for solo KimiPostgres + RedisRESTYesAvoid for Kimi-only
MemNexusCloud SaaSHTTPCloudHTTPNoAvoid

1. agentmemory (rohitg00)

Persistent memory for AI coding agents — 51 MCP tools, REST API on port 3111, real-time viewer on 3113. Built on iii-engine (Worker/Function/Trigger primitives) with all-MiniLM-L6-v2 local embeddings.

FieldAssessment
RoleCross-session, cross-agent persistent memory with hybrid search
Best useMulti-tool environments (Kimi + Claude Code + Codex CLI etc.) sharing one store
Kimi fitStandard MCP stdio — Kimi is NOT on the official supported-agent list, but the universal MCP block should work
Storageiii-engine state store (SQLite-backed via iii’s StateModule)
SearchHybrid: semantic (all-MiniLM-L6-v2 local) + FTS + knowledge graph + BM25
Self-hostFully local; binds to 127.0.0.1 by default
LLM/APINone for base operations; optional for advanced features
Installnpx @agentmemory/agentmemory + JSON block; or full plugin via marketplace on supported agents
MaintenanceActive (v0.9.x, May 2026); ~6.2k stars; single maintainer; documented governance
Known issueImportant: @agentmemory/mcp standalone and @agentmemory/agentmemory server are architecturally isolated — they use separate KV stores. Hooks-captured observations are not visible to MCP tools unless you set AGENTMEMORY_URL + AGENTMEMORY_FORCE_PROXY=1 (issue #159, partially addressed in v0.9.7+).
Risksiii engine is proprietary; Node.js required; standalone-vs-server isolation; server must be pre-started
VerdictInstall now — maximum compatibility, best tool surface, but verify proxy config to avoid isolated stores
# Terminal 1 — start the server (background or supervisord)
npx @agentmemory/agentmemory

# Verify
curl http://localhost:3111/agentmemory/health
# Viewer
open http://localhost:3113
// ~/.kimi/mcp.json
{
  "mcpServers": {
    "agentmemory": {
      "command": "npx",
      "args": ["-y", "@agentmemory/mcp"],
      "env": {
        "AGENTMEMORY_URL": "http://localhost:3111",
        "AGENTMEMORY_FORCE_PROXY": "1",
        "AGENTMEMORY_TOOLS": "all",
      },
    },
  },
}

2. ai-memory-mcp (alphaonedev)

Rust binary memory server — single SQLite + FTS5 with WAL mode, 26 MCP tools, 24 REST endpoints, 26-command CLI. 97.8% R@5 on LongMemEval; TOON output 40–61% smaller than JSON.

FieldAssessment
RoleDefault persistent memory for any MCP client — user prefs, project facts, debugging notes
Best usePrivacy-first solo dev; zero cloud dependency; benchmarked recall
Kimi fitDirect — standard MCP stdio
StorageSingle SQLite file with WAL (safe concurrent reads during writes)
SearchFTS5 + cosine similarity, fixed 60/40 semantic/keyword blend; 6-factor scoring (relevance, priority, access freq, confidence, tier boost, recency decay)
Tiersshort (6h TTL) → mid (7d TTL) → long (permanent); auto-promotion on 5+ accesses; TTL extends on recall
FeaturesContradiction detection on store; priority reinforcement (+1 every 10 accesses, max 10)
Self-hostFully local; no services; no containers
LLM/APINone for keyword tier; optional LLM for smart-tier query expansion
InstallPre-built Rust binary via install script, apt PPA, dnf COPR, or PowerShell; NOT an npm package
MaintenanceActive (April 2026); MIT; AlphaOne LLC
RisksRust binary install adds OS-specific path; smart-tier requires API key
VerdictInstall now — best for minimalism, privacy, token efficiency
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/alphaonedev/ai-memory-mcp/main/install.sh | sh

# Then add to ~/.kimi/mcp.json:
{
  "mcpServers": {
    "ai-memory": {
      "command": "ai-memory",
      "args": ["mcp"],
    },
  },
}

3. rekal (janbjorge)

Minimal Python MCP memory server backed by one SQLite file with FTS5 + 384-dim sqlite-vec semantic index. 16 MCP tools across four categories.

FieldAssessment
RoleCompact local-first memory for explicit facts, preferences, and decisions
Best useSimplest useful MCP memory; reliability over feature density
Kimi fitDirect — standard MCP stdio (command = "rekal")
Storage~/.rekal/memory.db (memories table + FTS5 virtual + sqlite-vec virtual, kept in sync by triggers)
SearchHybrid: FTS5 + cosine vector + recency decay
Self-hostFully local
LLM/APINone required
InstallPython 3.11+; uv tool or pip — auto-creates DB on first run
Primary targetsClaude Code, Codex CLI, OpenCode — but standard MCP stdio works with Kimi
RisksLess rich than semantic + graph stacks; smaller ecosystem signal
VerdictSimplest reliable Python option
uv tool install rekal
# or: pip install rekal
// ~/.kimi/mcp.json
{
  "mcpServers": {
    "rekal": {
      "command": "rekal",
      "env": { "REKAL_PROJECT": "kimi-default" },
    },
  },
}

Then optionally instruct the agent in your project’s AGENTS.md:

Call memory_build_context with your current task before exploring the codebase.

4. kimi-mneme — ⚠️ Unverified

Both source drafts describe kimi-mneme (claimed at github.com/barrelc/kimi-mneme) as a Kimi-native plugin with 13 lifecycle hooks, SQLite + sqlite-vec storage, OAuth reuse from ~/.kimi/credentials/kimi-code.json, and automatic silent capture/injection.

Validation result (May 2026): the repository could not be located via GitHub search, official Kimi CLI plugin showcase, or PyPI. It is also missing from the kimi-cli GitHub topic and awesome-kimi-cli. Issue #2161 — claimed to be the kimi-mneme showcase — was not surfaced as such by search.

Conclusion: do not include in any install plan until existence and maintenance are confirmed in person. If it does exist, the lifecycle-hook architecture would be the most efficient native option — but do not block on it.


5. mem0-mcp-selfhosted (elvismdev)

Self-hosted Mem0 MCP server: ~11 tools, Qdrant vectors, optional Neo4j graph, Ollama for full offline.

FieldAssessment
RoleFull-featured general-purpose memory with entity relationships
Best useProjects needing knowledge graphs, entity linking, contradiction detection, full offline
Kimi fitDirect (stdio); .mcp.json config
StorageQdrant (vectors) + optional Neo4j (graph)
SearchSemantic vector + graph traversal
Self-hostFully offline with MEM0_PROVIDER=ollama
LLM/APIDefault Anthropic; fully switchable to Ollama
InstallMedium — Qdrant + (optional) Neo4j + Ollama
MaintenanceActive (April 2026); MIT; community
Risks3-service stack; cold-start latency; not Kimi-specific
VerdictUse when knowledge graphs and full offline both matter
docker run -d -p 6333:6333 --name qdrant qdrant/qdrant
docker run -d -p 7474:7474 -p 7687:7687 neo4j        # optional, for graph
ollama pull qwen3:14b && ollama pull bge-m3

kimi mcp add --transport stdio mem0 \
  --env MEM0_PROVIDER=ollama \
  --env MEM0_LLM_MODEL=qwen3:14b \
  --env MEM0_USER_ID=artur \
  -- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhosted

6. HeurChain

Universal tiered memory layer; source drafts report confirmed Kimi CLI read/write via MCP SSE with all 26 tools available. BM25 search, ACT-R cognitive decay, Redis + persistent vault.

FieldAssessment
RoleShared memory infrastructure for multiple agents on one machine
Best useMulti-agent setups (Kimi + Claude Code + OpenClaw + CI bots)
Kimi fitConfirmed via MCP SSE
StorageRedis (cache + session) + vault (persistent tier)
SearchBM25-ranked keyword; automatic tier promotion with ACT-R decay
Self-hostDocker Compose, 4 containers
LLM/APINone for core operations
RisksNo semantic vector search (BM25 only); 4-container overhead; SSE deprecated in MCP spec
VerdictUse only if running multiple agents simultaneously and accepting Docker overhead
git clone <heurchain-repo> && cd heurchain/docker
cp .env.example .env
docker compose -f docker-compose.standalone.yml up -d --build
kimi mcp add --transport http heurchain http://localhost/sse

7. mnemon (Python)

Hybrid BM25 + vector with typed memory schema (decision / preference / observation / antipattern) and composite scoring (relevance + recency + confidence).

FieldAssessment
RoleStructured long-term memory with typed categories
Kimi fitMCP stdio
StorageSQLite (local) or PostgreSQL (remote vault) + vector embeddings
Self-hostLocal-only or self-hosted vault
LLM/APIOptional local 1.7B model for query expansion
Installpip install mnemon-memory + mnemon setup
VerdictBest local Python option with explicit memory typing and decay

8. Mnemo (TypeScript)

Daemonless local-first npm-installable MCP memory — ONNX embeddings, HNSW vector index, sub-100ms at 50K memories.

FieldAssessment
RoleFast, pure-local semantic memory for decisions, conventions, preferences
Kimi fitMCP stdio (designed for Claude Code; standard MCP, untested with Kimi)
StorageSQLite (sql.js WASM) + HNSW vector index
SearchCosine similarity + recency + access-frequency boost
Self-host100% local; ONNX all-MiniLM-L6-v2 (~25MB); no daemon
LLM/APINone
VerdictLightest npm option — verify with Kimi before relying on
npm install -g @mnemo-mcp/cli
mnemo init

9. Engram (@hbarefoot/engram)

Zero-dependency local-first MCP memory — SQLite + 23MB ONNX all-MiniLM-L6-v2 embeddings.

FieldAssessment
RoleDrop-in persistent memory for any MCP client
Kimi fitDirect (stdio)
StorageSQLite + ONNX embeddings
SearchHybrid: vector + FTS5
InstallSingle npm install -g
VerdictZero-config alternative to agentmemory when Node is available
npm install -g @hbarefoot/engram
kimi mcp add engram -- engram start --mcp-only

10. mcp-memory-service (doobidoo)

Mature hybrid MCP server with REST + stdio, knowledge graph, autonomous consolidation, dashboard.

FieldAssessment
RoleFull-spectrum agent memory with dashboard
Best useMulti-client shared memory; KG traversal; UI visibility
Kimi fitDirect — stdio or HTTP
StorageSQLite-vec by default (no external DB); optional Cloudflare hybrid
SearchSemantic + KG traversal + tag filtering
Self-hostLocal-first; optional Cloudflare sync (opt-in)
LLM/APIEmbeddings local (Ollama / LiteLLM / vLLM)
Installpip install mcp-memory-service or Docker
MaintenanceActive; PyPI
VerdictEvaluate for robust general-purpose memory with graph
pip install mcp-memory-service
# or: uv pip install mcp-memory-service
{
  "mcpServers": {
    "memory": {
      "command": "memory",
      "args": ["server"],
    },
  },
}

11. OpenMemory (Mem0)

Local-first temporal memory with dashboard UI, time-aware scoring, Waypoint audit traces.

FieldAssessment
RoleExplainable temporal memory — facts that change over time
Kimi fitHTTP MCP transport
StorageSQLite (default), optional Postgres / Neo4j
SearchComposite: relevance + recency + co-activation; Waypoint traces
Self-hostDocker Compose; Ollama for local embeddings
VerdictEvaluate for workflows needing temporal reasoning
git clone https://github.com/mem0ai/mem0.git ~/mem0
cd ~/mem0/openmemory
echo "EMBEDDING_PROVIDER=ollama" >> .env
echo "OLLAMA_BASE_URL=http://localhost:11434" >> .env
docker-compose up -d
kimi mcp add --transport http openmemory http://localhost:8765/mcp

12. Hindsight (Vectorize.io)

Structured memory with fact extraction, entity resolution, 4 parallel retrieval strategies + cross-encoder reranking.

FieldAssessment
RoleHigh-quality structured memory with retain / recall / reflect operations
Kimi fitHTTP MCP
StoragePostgreSQL + pgvector
SearchSemantic + BM25 + graph + temporal in parallel, then cross-encoder rerank
Self-hostDocker Compose
LLM/APIEmbedding model + LLM for reflect
VerdictEvaluate for best retrieval quality at the cost of heavier infra

13. Graphiti (Zep)

Temporal knowledge graph engine with fact validity windows. Best fit for evolving project architecture tracking.

FieldAssessment
RoleTemporal semantic memory tracking when facts become true or obsolete
Kimi fitVia Graphiti MCP server
StorageNeo4j 5.26+ or FalkorDB
SearchHybrid: semantic + keyword + graph; temporal validity windows
LLM/APIRequires capable model (GPT-4o, Claude 3.5, or Llama 3 via Ollama) for NER
InstallHigh — Neo4j/FalkorDB + Python 3.10+ + LLM pipeline
VerdictSpecialized — temporal reasoning is best-in-class; operational overhead is high
docker run -p 8100:8100 \
  -e OPENAI_API_KEY=sk-... \
  -e GRAPH_DB_URI=bolt://localhost:7687 \
  zepai/knowledge-graph-mcp

14. @modelcontextprotocol/server-memory (Official Anthropic)

Lightweight knowledge graph MCP server — entities, relations, observations in a local JSONL file.

FieldAssessment
RoleBasic persistent structured memory for interconnected facts
Best useCodebase architecture relationships, team conventions, simple entity graphs
Kimi fitDirect — stdio MCP
StorageJSONL file (flat, local)
SearchEntity graph traversal + observations; no semantic similarity
InstallSingle npx
RisksLinear search on large files; no vector search; quickly outgrown
VerdictSimple graph starter — good baseline, easy to migrate from
export MEMORY_FILE_PATH="$HOME/.kimi/knowledge-graph.jsonl"
kimi mcp add --transport stdio memory -- npx -y @modelcontextprotocol/server-memory

15. ipiton/agent-memory-mcp

Typed persistent memory with 4 categories (episodic, semantic, procedural, working) and Ollama-only mode.

FieldAssessment
RoleStructured typed persistent memory
Kimi fitDirect (stdio)
SearchType-aware retrieval; session capture hooks
Self-hostMCP_EMBEDDING_MODE=local-only disables all external calls
Installpip install agent-memory-mcp
VerdictBest for strict type safety and full offline

16. qdrant/mcp-server-qdrant

Official Qdrant MCP server — backend choice, not a complete memory policy.

FieldAssessment
RoleScalable semantic vector backend
Best useMemory volume beyond what SQLite-vec handles; semantic recall as priority
Kimi fitMCP stdio
RisksMore operational weight than SQLite; a backend, not a memory workflow
VerdictAdd when memory volume justifies it; pair with a memory-logic layer

Integration Patterns

PatternModelBest forTrade-off
MCP stdio serverkimi mcp add + child process (agentmemory, ai-memory-mcp, rekal)Universal; most compatible; zero glue codeAgent must proactively call memory tools; server must be pre-started
MCP HTTP serverSeparate service (HeurChain, OpenMemory, Hindsight)Multi-session, shared state, dashboardExtra running service; network dependency
Kimi plugin + hooksLifecycle hook scripts in config.tomlAutomatic silent capture / injection — no agent token costBeta hooks; may change on minor releases
SessionStart hook + fetchBash script → stdout additionalContext (when supported)Memory injection without MCP; minimal infraNot semantic; requires discipline
Manual project filesAGENTS.md, docs/decisions/, MEMORY.mdZero-infra baseline for stable rulesNo search; manual curation
External hosted APIMem0 Cloud, Zep CloudZero setupData leaves machine; vendor lock-in

Critical insight: Kimi lifecycle hooks (SessionStart for injection, PostToolUse for capture) run silently without consuming agent tokens on explicit tool calls. Combined with an MCP server, hooks handle session-level management automatically while MCP tools handle on-demand semantic queries.


Deployment Blueprints

Blueprint A — Minimal Viable (2 minutes)

Kimi CLI
  └── MCP stdio: agentmemory OR ai-memory-mcp OR rekal
        └── Local storage (iii engine / SQLite)

No containers. No API keys. No daemons beyond the server process.

# Option A: agentmemory
npx @agentmemory/agentmemory &
# Add JSON block to ~/.kimi/mcp.json (see section 1)

# Option B: ai-memory-mcp (Rust binary)
curl -fsSL https://raw.githubusercontent.com/alphaonedev/ai-memory-mcp/main/install.sh | sh
# Add JSON block to ~/.kimi/mcp.json (see section 2)

# Option C: rekal
uv tool install rekal
# Add JSON block to ~/.kimi/mcp.json (see section 3)

Blueprint B — Robust Semantic + Graph

Kimi CLI
  └── MCP stdio: mcp-memory-service (doobidoo)
        └── SQLite-vec (hybrid storage)
        └── Local dashboard
uv pip install mcp-memory-service
# Configure ~/.kimi/mcp.json with `command = "memory"`

Blueprint C — Multi-Agent Shared Memory

Kimi CLI + Claude Code + OpenClaw + CI/CD bots
  └── MCP SSE: HeurChain
        └── Docker Compose stack (Redis + nginx + vault)
git clone <heurchain-repo> && cd heurchain/docker
cp .env.example .env
docker compose -f docker-compose.standalone.yml up -d --build
kimi mcp add --transport http heurchain http://localhost/sse

Blueprint D — Full Offline Graph Memory

Kimi CLI
  └── MCP stdio: mem0-mcp-selfhosted
        ├── Qdrant (vectors)
        ├── Neo4j (knowledge graph)
        └── Ollama (embeddings + LLM)
docker run -d -p 6333:6333 qdrant/qdrant
docker run -d -p 7687:7687 neo4j
ollama pull qwen3:14b && ollama pull bge-m3
kimi mcp add --transport stdio mem0 \
  --env MEM0_PROVIDER=ollama \
  --env MEM0_USER_ID=artur \
  -- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhosted

Layer model

Stable project rules      →  AGENTS.md  (project root; global ~/.kimi/AGENTS.md not yet implemented)
Session-level capture     →  SessionStart / PostToolUse hooks → MCP write
On-demand semantic recall →  ai-memory-mcp / agentmemory / rekal (MCP tools)
Knowledge graph (opt-in)  →  mem0-mcp-selfhosted or Graphiti
Codebase index (opt-in)   →  Qdrant + SKILL.md workflow

Solo developer — start here

  1. ai-memory-mcp (Rust, minimal) or agentmemory (most tools, cross-agent) via ~/.kimi/mcp.json
  2. AGENTS.md in each project root for stable conventions
  3. Optional SessionStart hook for explicit memory injection on session boot

Multi-project / advanced

  1. agentmemory as the cross-agent shared store
  2. Hook-driven capture into the same store via PostToolUse
  3. mem0-mcp-selfhosted when knowledge graphs are required
  4. Graphiti only if temporal fact tracking becomes necessary

Privacy, Security, Token Economy

Data locality

TierSystemsWhat stays local
Fully localai-memory-mcp, Engram, Mnemo, rekal, ipitonAll data; no network calls
Local inframem0-mcp-selfhosted (Ollama), mcp-memory-service, HeurChainData on-machine; Docker containers
Configurableagentmemory, OpenMemory, HindsightLocal by default; cloud opt-in
AvoidMemNexus, Mem0 Cloud, Zep CloudData leaves machine

LLM / embedding dependency

  • No API key: agentmemory (local all-MiniLM-L6-v2), ai-memory-mcp (FTS5 keyword tier), Engram, Mnemo, rekal, @mcp/server-memory
  • Ollama switchable: mem0-mcp-selfhosted (MEM0_PROVIDER=ollama), OpenMemory, mcp-memory-service
  • Avoid for private repos: systems sending code to OpenAI/Anthropic for NER (Graphiti, Cognee, Mnemory default config)

Security risks and mitigations

RiskDescriptionMitigation
Secret captureHooks saving raw stdout may persist env vars, tokens, API keysDenylist filters; never store raw command output; redact before save
Cloud summarizationSession content sent to external LLM for extractionPrefer local-LLM or hook-only flows; configure Ollama backends
RAG poisoningHostile text in npm install output → injected into future sessionsTag tool-output as low trust; require citation verification
Stale factsOld decisions override newer fixesStore status, superseded_by, created_at, updated_at
Cross-project leakageFacts from one repo pollute anotherAlways include project, repo_root, branch, scope metadata
SQLite concurrencyMultiple Kimi tabs → database is lockedConfigure SQLite with WAL mode (ai-memory-mcp does this by default)

Never store

  • API keys, access tokens, SSH private keys
  • .env values, customer data
  • Raw production logs, private messages
  • Full proprietary files unless access policy explicitly allows

Prefer storing

  • Summaries instead of raw transcripts
  • Decisions instead of conversations
  • Stable facts instead of noisy logs
  • Command recipes without credentials
  • File paths and symbols without private payloads
{
  "id": "uuid",
  "type": "decision",
  "project": "repo-name",
  "repo_root": "/path/to/repo",
  "branch": "main",
  "scope": "backend",
  "title": "Use Alembic for schema changes",
  "content": "Use Alembic migrations instead of ad-hoc SQL files.",
  "source": "kimi-session",
  "confidence": "high",
  "status": "active",
  "superseded_by": null,
  "created_at": "2026-05-15T00:00:00Z",
  "updated_at": "2026-05-15T00:00:00Z",
  "tags": ["database", "migration"]
}

Memory categories that map cleanly across most systems:

TypeMeaning
factStable known fact about project / user / tooling
decisionChosen path and reason
constraintRule that should affect future work
bugKnown issue + reproduction / fix
procedureRepeatable command / process
summarySession or milestone summary
observationLower-confidence note from codebase / session

Token economy — progressive disclosure

A naive RAG dumps 100 facts into the system prompt. Kimi context limits break fast. Correct systems return only IDs + headlines on initial recall; the agent then calls get_details(id) only for relevant ones. Systems with this pattern: ai-memory-mcp (79% smaller TOON output), agentmemory (configurable response shape).

Ranking signals worth combining:

  • Project match
  • Current working directory
  • File path relevance
  • Recency
  • Confidence
  • Memory type
  • Semantic similarity
  • Explicit tags

Install Order

Use this order to avoid overbuilding.

# 1. Verify Kimi CLI feature surface
kimi --version
kimi mcp list
kimi plugin list

# 2. Add stable project memory
# Create AGENTS.md in project root (use /init to auto-generate the skeleton)

# 3. Install one MCP memory server
# Recommended default — ai-memory-mcp (Rust, minimal, validated)
curl -fsSL https://raw.githubusercontent.com/alphaonedev/ai-memory-mcp/main/install.sh | sh
# Add the JSON block from section 2 to ~/.kimi/mcp.json

# 4. Verify memory tools are visible
kimi mcp list
# (Inside Kimi: try memory_save / memory_recall via tool surface)

# 5. (Optional) Add SessionStart hook for explicit memory injection
# ~/.kimi/config.toml:
#   [[hooks]]
#   event = "SessionStart"
#   command = "~/.kimi/hooks/memory-inject.sh"

# 6. (Optional) Evaluate graph memory if semantic search proves insufficient
docker run -d -p 6333:6333 qdrant/qdrant
ollama pull bge-m3
# Add mem0-mcp-selfhosted to ~/.kimi/mcp.json (Blueprint D)

Rejected Candidates

CandidateReason rejected
MemNexusCloud-only SaaS; gated preview (May 2026); no self-host; privacy violation
Zep Cloud / Mem0 CloudVendor lock-in; data leaves machine; per-call billing
Letta (MemGPT)Stateful agent framework that replaces Kimi rather than extending it; REST-only, no MCP
HonchoDesigned as multi-agent platform OS; requires Postgres + Redis + Deriver; overkill for solo Kimi
LangGraph memoryRequires full LangChain adoption; high p95 latency; not a drop-in MCP solution
kimi-memory-mcp (SARPixelPioneer)Low maintenance signal; AgentSeal 75/100 (RAG poisoning risk); requires DeepSeek API
Raw vector DBs (Chroma, Pinecone, LanceDB standalone)Storage without memory logic; no capture, invalidation, dedup; accumulates contradictions
SSE-only MCP serversSSE deprecated in MCP spec (March 2025); prefer stdio or Streamable HTTP for new setups
Archived Mem0 MCP reposRedirected to cloud path; not a reliable local-first choice
claude-memClaude Code–specific hooks; not MCP-based; Kimi compatibility unverified
OMEGA / Memento / smolbrain / callmemExperimental; unverified benchmark claims; no confirmed install path
kimi-mnemeRepo availability could not be verified in May 2026; move to Evaluate after confirmation
Cognee (as default)Python SDK for document-corpus ingestion; no native MCP server; targets GraphRAG, not session memory
DevMemoryRequires Portkey API key; reduces attractiveness of fully local setups
AGENTS.md onlyStatic instructions, not queryable evolving memory
Browser / localStorage memory toolsWrong fit for CLI coding workflows

Open Questions

QuestionWhy it matters
Does kimi-mneme actually exist?Some research passes failed to locate it; determines whether the best-native option is real
Will MoonshotAI add native memory to Kimi CLI?Feature request #1283 / #1167 open; if implemented, most community plugins are superseded
When will global ~/.kimi/AGENTS.md ship?Issue #2152 open; required for cross-project user preferences without per-project files
Does Kimi SessionStart support additionalContext injection?Determines whether hooks can auto-inject memory without MCP tool calls
Does Kimi CLI support Streamable HTTP MCP transport?Determines compatibility with next-gen servers as SSE fades
How does token consumption scale with multiple MCP memory servers?Community reports ~50K tokens for basic interactions with several servers active
Can multiple Kimi instances share memory concurrently?Requires WAL mode (ai-memory-mcp has this); Redis-backed systems (HeurChain) handle this natively
Is sqlite-vec performance stable at >100K memories?May need migration to Qdrant at scale
Correct deduplication policy?Prevents “semantic landfill” — the natural end state of naive agent memory
Append-only vs mutable memory?Append-only improves auditability; mutable summaries reduce noise; tradeoff is real
Can memories be safely scoped per repo / branch / worktree?Prevents cross-project contamination in multi-repo workflows

Final Recommendation

Install ai-memory-mcp first.
  → Rust binary, single SQLite + WAL, 26 MCP tools, 6-factor scoring, TOON output
  → Zero API keys, fully local, benchmarked recall, ~5 minutes from zero to working

Install agentmemory instead if you want maximum tool surface and cross-agent sharing.
  → 51 MCP tools, REST + viewer, local iii-engine + embeddings
  → Set AGENTMEMORY_FORCE_PROXY=1 to avoid the standalone-vs-server split-store bug

Install rekal if you want the absolute simplest Python option.
  → Single SQLite, FTS5 + sqlite-vec, 16 tools, `~/.rekal/memory.db`

Add AGENTS.md per project for stable conventions.

Do not install kimi-mneme until existence and maintenance are confirmed in person.

Install mem0-mcp-selfhosted only when knowledge graphs and entity linking actually matter.
  → Qdrant + Neo4j + Ollama, fully offline, 3-service stack

Use HeurChain only when running multiple agents simultaneously.
  → Confirmed Kimi read/write via SSE; Docker, 4 containers; BM25 only

Use Graphiti only for temporal reasoning on long-lived projects.
  → Fact validity windows; Neo4j + NER pipeline; significant operational overhead

Avoid MemNexus, Mem0 Cloud, Zep Cloud (data leaves machine).
Avoid Letta and Honcho (they replace the agent rather than extend it).
Avoid raw vector DBs without memory logic (RAG poisoning is the natural end state).

Start simple. Add complexity only when the simple setup proves insufficient.

The best first implementation is deliberately boring: one local memory backend, one project namespace, session-end summaries, explicit saved decisions, semantic retrieval only when useful, no graph database until facts actually have relationships worth querying. This gives Kimi CLI durable cross-session memory without turning your terminal into a distributed-systems dissertation defense.


Sources

Kimi CLI

MCP memory servers — local-first

Vector and graph backends

Mem0 / OpenMemory

Multi-agent / platform-level

Reference and comparison

Unverified