Skip to main content

A SQLite-backed MCP server that gives your AI coding agents a shared memory bus.

Project description

AgenticBridge

A SQLite-backed MCP server that gives your AI coding agents a shared memory bus.

PyPI distribution name: AgenticBridge. The Python module remains agent_bridge, the installed CLI remains agent-bridge, and the source repository remains agent-bridge.

You run more than one coding agent now. Maybe Claude Code in one terminal and Codex in another. Maybe a planner model in a chat window dispatching work to executors on your machine. The problem isn't the agents — it's that none of them know what the others did. Every session starts cold. Work gets redone. Handoffs happen by copy-paste.

agent-bridge is the missing shared state. It's a single Model Context Protocol server backed by one SQLite file, exposing a small set of tools that any MCP-speaking agent can call:

  • Context sections — long-lived shared notes with single-writer ownership.
  • Activity log — a rolling "what happened" feed across every agent.
  • Handoffs — a dispatch queue: one agent assigns work, another picks it up, whoever finishes clears it.
  • Snapshots — periodic per-agent state captures.
  • Recall — one full-text (FTS5) search across all of the above.
  • Health / status — observability over the bridge itself.

No server to host. No vector DB. No cloud. One file, one process, stdio transport.


Why this exists

This is the genericized, open-source distillation of the coordination spine from a working one-person "AI operating system" — the piece that let a planning model, two terminal coding agents, and a few background jobs operate as a team instead of four amnesiacs. The original is personal; this is the reusable pattern, rebuilt clean with no machine-specific anything.

The design bet: agents don't need a knowledge graph to coordinate. They need a shared scratchpad with ownership rules and good search. Everything here serves that and stops there.


Relationship to bridge-db

agent-bridge is the generic, reusable shared-state bus extracted from a more opinionated local operating system. If you are working on the author's machine, that production local spine is bridge-db: it adds machine-specific integrations such as principal/auth rollout, source trust, Claude.ai file fallback sync, shipped-event receipts, Notion sync contracts, cost records, audit logs, and richer observability.

Use agent-bridge when you want the portable core pattern: context sections, activity, handoffs, snapshots, lexical recall, and health over one local SQLite file. Do not register it as a second live bridge next to an existing bridge-db deployment unless you intentionally want a separate, isolated state store.


Install

Requires Python 3.12+ and uv.

From PyPI:

uvx --from AgenticBridge agent-bridge --status

From source:

git clone https://github.com/saagpatel/agent-bridge
cd agent-bridge
uv sync --extra dev
uv run pytest
uv run ruff check .

Register it with any MCP client. For Claude Code:

claude mcp add --scope user agent-bridge -- uv run --directory /abs/path/to/agent-bridge python -m agent_bridge

For Claude Desktop / other clients, point them at the command uv run --directory /abs/path/to/agent-bridge python -m agent_bridge over stdio.

For Codex, add a stdio server block to ~/.codex/config.toml:

[mcp_servers.agent-bridge]
command = "uv"
args = ["run", "--directory", "/abs/path/to/agent-bridge", "python", "-m", "agent_bridge"]

If this machine already has a production bridge such as bridge-db, keep agent-bridge unregistered or point it at a deliberately separate test DB. Running both against normal agent workflows will split coordination state.


Release Notes

0.1.2

  • Refresh locked transitive runtime dependencies flagged by Dependabot: cryptography, starlette, and the mcp SDK path that brings in Starlette.

Configure (all optional)

Everything machine-specific is an environment variable. Defaults are sensible.

Variable Default Purpose
AGENT_BRIDGE_DB_PATH ~/.local/share/agent-bridge/bridge.db Where the SQLite file lives
AGENT_BRIDGE_MARKDOWN_PATH next to the DB Where the markdown mirror is written
AGENT_BRIDGE_AGENTS claude-code,codex,claude-ai,human Allowlist of agent identities that may write
AGENT_BRIDGE_ACTIVITY_RETENTION 50 Activity rows kept per agent
AGENT_BRIDGE_SNAPSHOT_RETENTION 10 Snapshots kept per agent

Agent identities are not baked into the schema — set AGENT_BRIDGE_AGENTS to whatever your fleet is called (cursor, aider, windsurf, human, …).


CLI

The same code runs as diagnostics without a live MCP client:

uv run python -m agent_bridge --status         # compact status JSON
uv run python -m agent_bridge --doctor         # environment + DB diagnostics
uv run python -m agent_bridge --export         # regenerate the markdown mirror
uv run python -m agent_bridge --rebuild-index  # repair FTS index drift
uv run python -m agent_bridge                  # start the MCP server (stdio)

The tools

Tool What it does
update_section / get_section / get_all_sections Owned context sections (first writer owns it)
log_activity / get_recent_activity Append + read the cross-agent activity feed
create_handoff / get_pending_handoffs / pick_up_handoff / clear_handoff The work-dispatch queue
save_snapshot / get_latest_snapshot Per-agent state captures
recall_search FTS5 search across everything
export_markdown Render a human-readable mirror
health / status / rebuild_index Observability + index repair

How it's built

The interesting parts are documented in docs/architecture.md, and the story of the system it came from is in docs/one-person-ai-operating-system.md. Three ideas carry the whole thing:

  1. One write path per table, FTS mirror updated in the same transaction. This single invariant is what keeps search honest — there's no separate "reindex" step that can fall behind. health checks it; rebuild_index repairs it.
  2. Core logic is transport-free. Every tool is a plain async function over a database connection. The MCP server is a thin wrapper. That's why the test suite never needs a live MCP client — it calls the functions directly.
  3. Ownership in the app layer, not the schema. Agent identities are config, so the same schema serves any team without a migration.

Scope (what this is not)

It is not a knowledge base, a vector store, or a RAG system. It's coordination state plus lexical search. That boundary is deliberate — the original system tried the knowledge-store path and walked it back when most "missed" searches turned out to be for content that was never in the bridge to begin with. If you need semantic memory, put it behind its own MCP server and let the agents call both.


License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agenticbridge-0.1.2.tar.gz (63.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agenticbridge-0.1.2-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file agenticbridge-0.1.2.tar.gz.

File metadata

  • Download URL: agenticbridge-0.1.2.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for agenticbridge-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d597938396168b32ac371ada3242cc755064e445c2753a02af06bade880cd262
MD5 bc78ecfdf8f336db9bb02cc71ee127d7
BLAKE2b-256 b56dc1edf80bae9bc8ad49b51142c9b0fa30f1c7978efcdeb6403ff07c9c6071

See more details on using hashes here.

File details

Details for the file agenticbridge-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: agenticbridge-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for agenticbridge-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b2344686a27dea68498565cd321e735968ca2d99038326fdfcec95332e09feb
MD5 bb53f55c486e4eade13a157148308a64
BLAKE2b-256 9de84cafaf658f11fa011ea7a538133eae7bada0f1b04f82654631daee99aabe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page