How jayzeng/agentmemory works
AgentMemory is a local-first memory layer for coding agents: users or agent clients submit memory commands, which read, write, organize, and retrieve Markdown memory, then return context or search results. CLI and MCP are distinct entry points into shared core behavior; agent hooks support installation and capture checks for several environments. The README also documents optional qmd search and skills installation. Core storage and qmd behavior are supported by the excerpts, but details of individual write/read operations and some CLI dispatch are unsampled, so uncertain internal links are omitted.
Main entry points: core.ts Memory core · cli.ts CLI · mcp-server.ts MCP server · hooks.ts Hook installer
Components 16
Entry points
- CLI
src/cli.ts - MCP server
src/mcp-server.ts
Memory operations
- Memory core
src/core.ts - Markdown memory
- Secret redaction
src/core.ts - Scratchpad
src/core.ts
Agent integrations
- Skills install
src/cli.ts - Hook installer
src/hooks.ts - Agent configs
- Capture checks
src/capture-check.ts - Codex transcript check
src/codex-capture-check.ts - Cursor capture
src/cursor-capture.ts
Retrieval
- Context builder
src/core.ts - qmd search
Other components
- Developer / agent
- Coding agents
Connections 20
- Developer / agent → CLI: runs commands
- Developer / agent → MCP server: sends tool calls
- CLI → Memory core: calls operations
- MCP server → Memory core: calls operations
- Memory core → Markdown memory: reads and writes
- Memory core → Secret redaction: redacts content
- Memory core → Scratchpad: manages items
- Memory core → qmd search: invokes search
- CLI → Context builder: builds context
- MCP server → Context builder: builds context
- CLI → Skills install: installs skills
- CLI → Hook installer: installs hooks
- Hook installer → Agent configs: updates configs
- Coding agents → Capture checks: provides transcripts
- Capture checks → Codex transcript check: checks Codex
- Coding agents → Cursor capture: provides events
- Cursor capture → Memory core: uses memory directory
- Coding agents → CLI: uses CLI
- Coding agents → MCP server: calls tools
- qmd search → Markdown memory: indexes files