memdex
Optional integration with a local Ollama instance to generate embeddings for notes and file summaries, enabling hybrid keyword and vector search via reciprocal rank fusion, with fallback to keyword search when Ollama is unavailable.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@memdexcatch me up on the last agent's handoff for this project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
memdex
Shared, token-saving memory for AI coding agents. Zero dependencies, one SQLite file, any MCP client.
Every new agent session starts from nothing: it re-reads the same files, re-runs the same searches and re-discovers the same pitfalls. When several agents (Claude Code, Codex, Cursor, DeepSeek, …) work on one machine, they also can't see what the others learned or are doing right now.
memdex fixes that with a small MCP server:
Feature | What it does | Borrowed idea |
Content-hash summary cache | An agent reads a 3,000-token file once and saves a 100-token summary. The summary is keyed to the file's sha256, so it stays valid until the content changes, then is flagged stale automatically. Identical content in other worktrees or branches shares it. | content-addressed storage |
Incremental index | Only files whose size or mtime moved are re-read. Re-indexing an 800-file repo takes ~0.2 s. | Everything's USN-journal approach |
Outline + symbol map | Free outlines (docstring + classes/functions with line numbers) for Python, JS/TS, Vue/Svelte, Go (receiver methods as | Serena / repo maps, without tree-sitter |
Notes that know when they rot | Decisions, pitfalls, todos and handoffs, linked to the files they're about. When those files change, the note is marked "⚠ changed since". Notes are append-only ( | Basic Memory, mem0 |
Agent coordination |
| — |
Hybrid search | SQLite FTS5 trigram (works for Korean/Japanese/Chinese, with a fallback for 2-character terms) + optional local embeddings via Ollama, merged by reciprocal rank fusion. | claude-context |
Bounded reads |
| Kensaku's |
Whole-machine content search | With Kensaku installed, | Kensaku |
Measured on a real 800-file TypeScript repo: a 144 KB source file → 1.6 KB file_summary response (outline only,
before any agent summary was saved).
Install
pipx install memdex-mcp # or: pip install memdex-mcpThe PyPI name is memdex-mcp (plain memdex was taken); the command, package and MCP server are all memdex.
From source: pipx install git+https://github.com/ChoYugyeong/memdex or pip install -e . in a checkout.
Python 3.9+. No other dependencies — the MCP stdio protocol is implemented directly, so it won't break across MCP SDK versions.
Related MCP server: DIP
Connect your agents
memdex config --agent <name> prints these snippets.
Claude Code
claude mcp add memdex --scope user -e MEMDEX_AGENT=claude -- memdex serveOptional: inject the brief at every session start (~/.claude/settings.json):
{ "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "memdex hook session-start --agent claude" } ] } ] } }Any other MCP client (Claude Desktop, Cursor, Codex, Windsurf, DeepSeek harness, …)
{ "mcpServers": { "memdex": { "command": "memdex", "args": ["serve"], "env": { "MEMDEX_AGENT": "codex" } } } }Give each agent its own MEMDEX_AGENT name. Its full id becomes name@checkout, e.g. claude@myrepo-wt.
Tools
Tool | Use |
| Start of session: last handoff, pitfalls, decisions, todos, unread messages, other agents' claims. Refreshes the index. |
| Before reading a file: cached summary (if the content is unchanged) + outline. |
| After reading a file: store a 2–6 line summary for everyone. |
| Symbol definition lookup. |
| A bounded slice of a file around |
| Notes, handoffs and file summaries; keyword + semantic. Plus Kensaku content hits when installed ( |
| Save / read / archive notes ( |
| End of session: done / next / decisions / pitfalls. Releases your claims. |
| Messages between agents (broadcast or |
| Announce what you're editing; warns about overlaps. |
The server sends usage instructions in its MCP initialize response, so agents know the workflow without extra prompting.
The 12 tool schemas cost about 1,000 tokens per request.
CLI
Everything the MCP tools do is also a command, for shell-capable agents and for humans:
memdex brief --agent codex # start of session: handoff, notes, inbox, claims
memdex file src/store.py # cached summary + outline
memdex file src/store.py --summary "…" # save a summary
memdex snippet src/store.py --query "def index"
memdex search "locked"
memdex remember pitfall "WAL mode needed" --body "…" --files src/store.py
memdex claim src/store.py --intent "refactor"
memdex post "store.py is mine for an hour" --to claude
memdex inbox
memdex handoff "Done X" --next "Y" --pitfalls "Z"
memdex index · memdex export --out notes/ · memdex statsWhere data lives
Everything is in ~/.memdex/memdex.db (override with MEMDEX_HOME). Nothing is written into your
repositories, so memory never ends up in a commit. Files that look like secrets (.env*, *.pem, *.key,
*secret*, *credential*, …), binaries, lockfiles, files over 512 KB and anything git ignores are never read.
A project is identified by its git common directory, so all worktrees of a repository share notes, messages and claims, while each worktree keeps its own file index.
Kensaku integration (optional)
Kensaku is a local, read-only desktop search engine that indexes
file names, the full text of PDF/DOCX/EPUB, OCR'd screenshots and a semantic tier. memdex covers a
project's source; Kensaku covers the rest of the machine. If kensaku-cli is on PATH (or
MEMDEX_KENSAKU points to it), search appends Kensaku's content hits, scoped to the project unless
everywhere is set. MEMDEX_KENSAKU=off disables it.
Semantic search (optional)
ollama pull bge-m3
export MEMDEX_EMBED=ollama:bge-m3 # MEMDEX_OLLAMA_URL defaults to http://localhost:11434Notes and summaries get embedded when saved; search merges keyword and vector rankings. If Ollama is unreachable, memdex silently falls back to keyword search.
Development
python -m unittest discover testsLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Shared project memory that keeps teammates and AI agents aligned across sessions.
Project memory for coding agents: requirements, decisions, code graph and delivery telemetry.
Memory for AI agent teams across tools, sessions, repositories, and teammates.
Related MCP Servers
- AlicenseCqualityBmaintenanceEnables Claude Code agents and sub-agents to share a persistent, compiled memory of project state, decisions, tasks, and facts across sessions instead of re-reading transcripts. Provides token-efficient bootstrap, search, commit, leased task claiming, and task-specific context compilation so parallel agents can coordinate without clobbering each other.59 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables coding agents to maintain local-first project memory, coordinate task ownership across Git worktrees, and verify completion against project-defined checks with durable evidence stored in the repository.Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables AI coding agents to read and write persistent project-scoped and cross-project memory during sessions, using local semantic search to surface relevant decisions, preferences, error patterns, and guidelines across sessions. It also optionally exposes an autonomous task queue that draws on that same stored context.-
- AlicenseNot gradedqualityAmaintenanceEnables AI coding assistants to persistently save, search, and restore project context across sessions, including decisions, progress, file caches, checkpoints, and channel-based memory. It supports git-aware organization, batch operations, and shared memory across parallel sessions.250 npmMIT