@wiolett/agent-memory-mcp
v0.1.5
Published
MCP server backing the Agent Memory Codex plugin.
Readme
Agent Memory
Persistent memory for Codex with separate global and project scopes.
agent-memory helps Codex retain durable knowledge without turning every session into prompt archaeology. It gives the model a structured way to store and retrieve:
- user preferences and long-lived behavior rules
- cross-project coding patterns
- repository-specific workflows and conventions
- deployment notes, credentials, setup steps, and operational gotchas
The plugin is powered by a bundled MCP server and a Codex skill.
Highlights
- global memory stored under
~/.agents/agent-memory/ - project memory stored under
<repo>/.memory/ - deep and lite memory layers
- semantic and keyword search
- meaningful memory filenames
- weighted links between deep memories
- automatic project-memory setup on first use
Memory Scopes
Global Memory
Global memory is for information that should follow the user across repositories:
- response style preferences
- coding habits and tool choices
- cross-project requirements for model behavior
- reusable personal workflows
Global memory is always available through global_memory_* tools.
Project Memory
Project memory is for repository-specific knowledge:
- setup and bootstrap steps
- deployment and release workflows
- project conventions
- undocumented dependencies
- credentials and environment-specific instructions
Project memory now auto-initializes on first project-memory use in a repository.
Storage Model
Global memory:
~/.agents/agent-memory/
memories/
embeddings/
graph/
memory.dbProject memory:
.memory/
memories/
embeddings/
graph/
memory.db
memory.db-shm
memory.db-walMarkdown memory files, embedding files, and graph files are the source of truth. SQLite is used as local cache for fast lookup.
Tool Surface
Project tools:
memory_writememory_getmemory_read_litememory_searchmemory_deletememory_linkmemory_unlinkmemory_neighborsmemory_subgraphmemory_read_all
Optional manual maintenance tool:
memory_setupfor explicit initialization or repair, though normal use no longer requires it
Global tools:
global_memory_writeglobal_memory_getglobal_memory_read_liteglobal_memory_searchglobal_memory_deleteglobal_memory_linkglobal_memory_unlinkglobal_memory_neighborsglobal_memory_subgraphglobal_memory_read_all
Install
Register the Wiolett marketplace in Codex:
npx @wiolett/marketplace installThen install agent-memory from that marketplace in Codex.
To enable semantic search and AI-generated memory names, either:
export OPENAI_API_KEY="your-key"
codexor save the key once through the marketplace installer or the agent_memory_configure MCP tool. Agent Memory stores the saved key in:
~/.agents/agent-memory/config.jsonAt runtime, Agent Memory uses this precedence:
OPENAI_API_KEYfrom the environment- stored key from
~/.agents/agent-memory/config.json - no key, which disables embeddings and AI naming
For non-interactive installs, the CLI also supports:
npx @wiolett/marketplace install --openai-api-key-env OPENAI_API_KEY --yesUsage
At conversation start, the bundled skill tells Codex to read global lite memory first:
global_memory_read_lite()When a repository should use project memory, just start using project memory tools. The first project-memory call will initialize the local .memory/ store automatically.
From there, use memory tools to store and retrieve reusable knowledge as needed.
Development
Requirements:
- Node.js 22.5+
- optional
OPENAI_API_KEYfor semantic search and AI-generated memory slugs
Useful commands:
npm run typecheck
npm run build
npm test