Portable memory stack for Codex, split into three reusable parts:
packages/codex-memory-mcpLanceDB-backed MCP server for storage, recall, import/export, compaction, and project-aware scope resolution.workspace-memoryMarkdown-first workspace logging layer for daily logs and per-project session logs.skills/portable-memoryCodex skill that standardizes when to recall, store, update, export, import, and compact memory.
- Keep durable project memory across Codex sessions
- Separate repository-specific memory from cross-project preferences
- Keep Markdown logs usable even when semantic memory services are offline
- Export and import memory when moving machines
- Reduce stale or duplicated memory with compaction and supersede rules
This repository contains the reusable memory framework.
It does not contain personal memory data.
License: MIT
Excluded from the publishable repo:
- real daily logs
- real project session logs
- local LanceDB state
- exported memory snapshots
- machine-specific
.codexstate
codex-portable-memory/
|- packages/
| \- codex-memory-mcp/
|- skills/
| \- portable-memory/
|- workspace-memory/
| |- config/
| |- scripts/
| |- templates/
| \- tests/
\- examples/
Bootstrap the repository:
node scripts/bootstrap.mjsWindows wrapper:
./bootstrap.ps1macOS/Linux wrapper:
./bootstrap.shBootstrap will:
- install or validate
packages/codex-memory-mcpdependencies - install
skills/portable-memoryinto your local Codex skills directory - create
workspace-memory/config/memory-config.jsonif it does not already exist - create
.codex/memory-profile.jsonif it does not already exist - print exact next-step commands for MCP registration and verification
The generated .codex/memory-profile.json is repo-local configuration, ignored by git, and safe to edit if you want a different default project scope.
Full install and troubleshooting notes live in docs/install.md.
Register the MCP server:
codex mcp add codex-memory -- node --import tsx <repo-root>/packages/codex-memory-mcp/src/server.tsRun the MCP backend checks:
cd <repo-root>/packages/codex-memory-mcp
npm test
npm run typecheckOptional workspace logging verification:
Invoke-Pester -Path <repo-root>\workspace-memory\testsworkspace-memoryis the file-first truth source.codex-memory-mcpis the semantic retrieval and governance layer.portable-memoryis the usage workflow for Codex.
Recommended flow:
- Write durable facts and session checkpoints into Markdown logs.
- Use MCP recall before substantial work.
- Store only high-value confirmed memories.
- Update or supersede old memories instead of duplicating them.
- Export/import when moving machines and compact periodically.
Suggested GitHub description, topics, and release notes are tracked in: