Agent Memory Bridge
Agent Memory Bridge
An MCP-native memory layer for coding agents that turns coding sessions into reusable engineering memory.
Built for Codex-first workflows.
Agent Memory Bridge captures what chat history usually loses:
durable decisions
known fixes
cross-session handoffs
reusable gotchas
compact domain knowledge
The core idea is simple: keep the memory layer small, reliable, and inspectable. Let higher-level orchestration sit on top.
The system reshapes session output into durable memory:
sessions become reusable
learnrepeated failures become
gotchaclusters of lessons become compact
domain-note
Why This Exists
Most agent memory systems drift into one of three patterns:
memory trapped inside one app or one model
heavier hosted infrastructure before retrieval basics are proven
transcript dumping instead of reusable operational knowledge
Agent Memory Bridge takes a narrower path:
MCP-native from day one
local-first runtime
SQLite + FTS5 instead of heavier infrastructure
automatic promotion from session traces into reusable memory
At its core, it is a memory shaping pipeline:
session -> summary -> learn -> gotcha -> domain-note
Positioning
Agent Memory Bridge is intentionally narrow.
If you want a broader memory platform with SDKs, dashboards, connectors, and multi-surface application support, projects like OpenMemory or Mem0 are closer to that shape.
This project is different on purpose:
It is built for coding-agent workflows, not generic note storage.
It keeps the MCP surface intentionally small:
storeandrecall.It promotes raw session output into compact machine-readable memory instead of treating summaries as the final artifact.
It is local-first and inspectable by default.
For a longer positioning note, see docs/COMPARISON.md.
How It Works
The runtime has four main pieces:
MCP server
exposes
storeandrecall
watcher
observes Codex rollout files
writes
session-seen,checkpoint, andcloseout
reflex
promotes summaries into
learn,gotcha, andsignal
consolidation
synthesizes recurring
learnandgotcharecords into domain notes
This keeps the system understandable:
raw sessions are not final memory
summaries are not final memory
durable memory is machine-first
synthesis happens after promotion
Quick Start
Requirements:
Python 3.11+
Codex with MCP enabled
SQLite with FTS5 support
1. Install
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .[dev]2. Create bridge config
Copy config.example.toml to:
$CODEX_HOME/mem-bridge/config.tomlRecommended setup:
keep the live SQLite database local on each machine
keep shared profile or source vaults on NAS or shared storage if needed
move to a hosted backend later if you want true multi-machine live writes
3. Register the MCP server in Codex
Add this to $CODEX_HOME/config.toml:
[mcp_servers.agentMemoryBridge]
command = "D:\\path\\to\\agent-memory-bridge\\.venv\\Scripts\\python.exe"
args = ["-m", "agent_mem_bridge"]
cwd = "D:\\path\\to\\agent-memory-bridge"
[mcp_servers.agentMemoryBridge.env]
CODEX_HOME = "%USERPROFILE%\\.codex"
AGENT_MEMORY_BRIDGE_HOME = "%USERPROFILE%\\.codex\\mem-bridge"
AGENT_MEMORY_BRIDGE_CONFIG = "%USERPROFILE%\\.codex\\mem-bridge\\config.toml"4. Start the service
Start the MCP server:
.\.venv\Scripts\python.exe -m agent_mem_bridgeRun the background bridge service:
.\.venv\Scripts\python.exe .\scripts\run_mem_bridge_service.pyRun one cycle only:
$env:AGENT_MEMORY_BRIDGE_RUN_ONCE = "1"
.\.venv\Scripts\python.exe .\scripts\run_mem_bridge_service.pyOptional startup install:
.\scripts\install_startup_watcher.ps1Optional: build a local Docker image
docker build -t agent-memory-bridge:local .
docker --context desktop-linux run --rm -i agent-memory-bridge:localThe container entrypoint starts the stdio MCP server with python -m agent_mem_bridge.
Core API
The MCP surface is intentionally small:
storerecall
Common store fields:
namespacecontentkindtagssession_idactortitlecorrelation_idsource_app
Common recall fields:
namespacequerykindtags_anysession_idactorcorrelation_idsincelimit
Typical Namespaces
project:<workspace>globaldomain:<name>imported profile namespaces when a team wants them
The framework is profile-agnostic. A specific operator profile can be layered on top, but the bridge itself is not tied to one persona or one protocol.
Day-to-Day Usage
The intended layering is:
system-level operator profile
system-level memory substrate:
agentMemoryBridgeproject-local overrides: AGENTS.md
The startup protocol is documented in docs/STARTUP-PROTOCOL.md.
In short:
recall global operating memory
recall relevant specialization memory
if a workspace exists, recall
project:<workspace>for issue-like work, check local memory and gotchas before external search
inspect live code before trusting recalled implementation details
Useful Commands
Run tests:
.\.venv\Scripts\python.exe -m pytestRun the stdio smoke test:
.\.venv\Scripts\python.exe .\scripts\verify_stdio.pyRun the benchmark:
.\.venv\Scripts\python.exe .\scripts\run_benchmark.pyRun the bridge health check:
.\.venv\Scripts\python.exe .\scripts\run_healthcheck.py --report-path .\examples\healthcheck-report.jsonForce a checkpoint from the latest rollout:
.\.venv\Scripts\python.exe .\scripts\sync_now.pyProject Structure
The repo is intentionally small:
src/agent_mem_bridge/ canonical implementation
scripts/ operational entrypoints
tests/ verification
docs/ design and roadmap
examples/ sanitized demo artifactsThe files that matter most:
Design Choices
Small MCP surface
The bridge exposes only store and recall. This keeps the contract stable and easy to integrate.
Local-first runtime
The live DB stays local by default because SQLite on shared network storage is a reliability trap.
Machine-first memory
Agents are the primary readers, so memory favors:
compact fields
stable tags
low token cost
over polished prose.
Layered promotion
The system tries to move upward:
summarylearngotchadomain-note
instead of treating raw summaries as the final artifact.
Status
The current foundation is working:
MCP autoload works in Codex
project and session sync work
recall-first workflows work
reflex promotion works
first-pass domain consolidation works
Reality check and roadmap:
Profile Imports
The framework can host imported operator profiles, but the framework itself stays profile-agnostic.
Documentation
License
MIT. See LICENSE.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zzhang82/Agent-Memory-Bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server