Skip to content

ggwhite/memory-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

memory-mcp

Cross-session persistent memory for AI coding agents. CLI-first, SQLite FTS5, zero dependencies.

demo

Install

git clone https://github.com/user/memory-mcp.git
cd memory-mcp
make build
# binary: bin/memory-mcp

Add to PATH or use absolute path.

CLI

# Store
memory-mcp store -t til "SQLite trigram tokenizer 支援 CJK 搜索"
memory-mcp store -t feedback --tags testing,go --project myapp "用 real DB 跑 integration test"

# Search (3+ chars for CJK)
memory-mcp search "trigram"
memory-mcp search "全文搜索"

# List / manage
memory-mcp list [--type type] [--since 7d]
memory-mcp update <id> "new content"
memory-mcp delete <id>
memory-mcp stats

# Export / Import
memory-mcp export > backup.json
memory-mcp import backup.json

Memory types: feedback, til, summary, knowledge

Global flags: --json (JSON output), --db <path> (override DB path)

AI Agent Integration

Claude Code (MCP Server)

claude mcp add memory -s user -- /path/to/memory-mcp serve

Then add to your CLAUDE.md or global instructions:

# Cross-session memory

Store valuable technical knowledge, preferences, and solutions for recall across sessions:
  memory-mcp store -t til "description"
  memory-mcp store -t feedback --tags tag1,tag2 "preference"

Recall when starting a task or need context:
  memory-mcp search "keyword"
  memory-mcp list --since 7d

Codex / Gemini / Other LLM Agents

Add to AGENTS.md, GEMINI.md, or equivalent instructions file:

# Cross-session memory

Store valuable technical knowledge, preferences, and solutions:
  memory-mcp store -t <type> [--tags t1,t2] [--project name] "content"

Types: feedback (preferences), til (solutions), summary (session summaries), knowledge (cross-project knowledge)

Recall when needed:
  memory-mcp search "keyword"
  memory-mcp list [--type type] [--since 7d]

DB Location

Default: ~/.local/share/memory-mcp/memory.db

Override: --db flag or MEMORY_MCP_DB env var.

Semantic Search

search 自動混合 FTS5 關鍵字搜尋與本機 Ollama 產生的語意向量搜尋(Reciprocal Rank Fusion)。Ollama 不在線時自動降級為純 FTS5,不影響既有使用方式。

# 需要本機跑著 Ollama 並已拉下 embedding 模型(預設 nomic-embed-text)
ollama pull nomic-embed-text

# 補算既有資料、或 Ollama 曾離線期間漏算的 embedding;可重複執行
memory-mcp reindex

環境變數(皆有預設值):

  • MEMORY_MCP_OLLAMA_URL(預設 http://localhost:11434
  • MEMORY_MCP_EMBED_MODEL(預設 nomic-embed-text

跨機器同步(--remote)不需要裝 Ollama:語意運算全部發生在中央機器(跑實體 DB 那台)。

Search

Uses SQLite FTS5 with trigram tokenizer. Supports any language including CJK. Queries need at least 3 characters.

About

Cross-session persistent memory for AI coding agents. CLI-first, SQLite FTS5, zero external dependencies.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages