Persistent memory MCP server for Codex, local-first and SQLite-backed.
🇺🇸 English • 🇪🇸 Español • 🇩🇪 Deutsch
Quick Start • Documentation • Automatic Mode • Architecture Design • How It Works • MCP Search Tools • System Requirements • Contributing • License
codex-mem preserves project memory across Codex sessions with a practical progressive retrieval workflow.
One-command automated install:
npm run mcp:installInstaller options:
bash scripts/install-mcp.sh --help
bash scripts/install-mcp.sh --dry-run
bash scripts/install-mcp.sh --dry-run --no-register
bash scripts/install-mcp.sh --name codex-mem --db-path .memory/codex-mem.dbAutomatic workflow helpers:
npm run auto:mode -- start --ingest --project codex-mem
npm run auto:mode -- end --summary "Completed MCP setup docs and tests."
npm run auto:mode -- commit
npm run auto:install-hooks -- --project codex-memManual install path:
npm install
export MEMORY_DB_PATH=.memory/codex-mem.db
npm run migrate
npm run mcp:startVS Code MCP setup values:
- Name:
codex-mem - Transport:
STDIO - Command:
npm - Arguments:
run,mcp:start,--silent - Environment variable:
MEMORY_DB_PATH=.memory/codex-mem.db - Working directory: absolute path to your
codex-memrepository
- README.md
- CONTRIBUTING.md
- LICENSE
- scripts/install-mcp.sh
- scripts/auto-memory.sh
- scripts/install-git-hooks.sh
- SECURITY.md
- CHANGELOG.md
- .env.example
- .github/ISSUE_TEMPLATE/bug_report.yml
- .github/ISSUE_TEMPLATE/feature_request.yml
- .github/ISSUE_TEMPLATE/config.yml
- .github/pull_request_template.md
- docs/project-plan.md
- docs/roadmap.md
- docs/requirements.md
- docs/mvp-spec.md
- docs/delivery-plan.md
- docs/implementation-kickoff.md
- docs/architecture.md
- docs/architecture-diagram.mmd
- docs/data-model.md
- docs/data-model-diagram.mmd
- docs/technical-design.md
- docs/runtime-decision.md
- docs/mcp-api-spec.md
- docs/auto-mode.md
- docs/auto-capture-wrapper.md
- docs/setup-guide.md
- docs/usage-guide.md
- docs/troubleshooting.md
- docs/operations-runbook.md
- docs/security-baseline.md
- docs/test-strategy.md
codex-mem currently supports a practical semi-automatic workflow:
npm run auto:mode -- start --project codex-mem --ingest
npm run auto:mode -- end --project codex-mem --summary "Session handoff summary."
npm run auto:mode -- commit --project codex-mem
npm run auto:install-hooks -- --project codex-memSee full details in docs/auto-mode.md.
flowchart LR
User["User / Codex Session"] --> MCP["MCP Interface"]
MCP --> Service["Memory Service"]
Service --> Policy["Policy Layer"]
Policy --> Storage["Storage Layer (SQLite + FTS)"]
Service --> Ingest["Ingestion Layer"]
Ingest --> Sources["Project Sources (docs, logs)"]
Ingest --> Policy
Service --> Search["Search Flow"]
Search --> Storage
Service --> Timeline["Timeline Flow"]
Timeline --> Storage
Service --> Details["Details Flow"]
Details --> Storage
Service --> Save["Save Flow"]
Save --> Policy
subgraph LocalRuntime["Local Runtime"]
MCP
Service
Policy
Storage
Ingest
end
save_memorystores key decisions, fixes, and constraints.searchreturns compact index entries for low-cost discovery.timelineexpands context around anchor entries.get_entriesfetches full details only for selected IDs.ingest_docsimports docs with source/hash dedupe.retention_dry_runreports cleanup candidates without deleting data.
Recommended retrieval flow:
searchtimelineget_entries
Available MCP tools:
save_memorysearchtimelineget_entriesingest_docsretention_dry_run
- Node.js 20+
- npm
- Local filesystem write access for
.memory/ - SQLite runtime support (via bundled dependency)
- Fork the repository
- Create a feature branch
- Add or update tests
- Update docs for behavior changes
- Open a pull request
See CONTRIBUTING.md.
Licensed under AGPL-3.0.
See LICENSE.
