Skip to main content

The All-in-One Local Memory Bridge for AI Agents

Project description

🇨🇳 中文 | 🇬🇧 English

🧠 ContextBridge (cbridge-agent)

The All-in-One Local Memory Bridge for AI Agents.
Instantly feed real-world documents (PDFs, Office files, Markdown) to your local AI Agents (like OpenClaw, Claude Desktop, Cursor). Batteries included, zero configuration required.

License: MIT Python 3.9+ PyPI version

💡 Why ContextBridge?

Most local AI Agents are great at reading code, but they are completely blind to the real-world business data hidden in your .pdf, .docx, and .xlsx files.

In the past, building a document retrieval system for your local Agent meant entering "configuration hell": Install Node -> Install a Vector DB -> Configure environment variables -> Write parsing scripts -> Connect them all together...

ContextBridge ends all of this. We packaged high-fidelity parsers (MarkItDown, Docling) and a blazing-fast embedded vector database (ChromaDB) into a single, standalone tool. No external dependencies, no complex setup. Just pip install, and your Agent instantly gets a memory.


✨ Core Features

  • 🔋 Batteries Included: Built-in embedded ChromaDB vector database. No need to manually install environments or worry about vector index initialization. We handle it all under the hood.
  • 👁️ Zero-Touch Sync: Just drop a file into your watched folder. ContextBridge uses a debounced Watchdog to monitor changes, automatically parses them in an asynchronous background queue, and instantly rebuilds the local vector index without blocking your workflow.
  • 🧹 Ghost Data Cleanup: Automatically detects and cleans up "ghost data" (files deleted while the bridge was offline) during full indexing, ensuring your AI's memory is always perfectly synchronized with your local disk.
  • 📄 Multi-Format Parsing: Flawlessly extracts text from PDFs (via Docling), Word, Excel, PPTX, and more (via MarkItDown).
  • 🔌 MCP & API Ready: Exposes a clean local API and natively supports the Model Context Protocol (MCP). Seamlessly integrates with Claude Desktop, Cursor, and OpenClaw.
  • 🌐 i18n Support: Fully supports both English and Chinese interfaces (cbridge lang en / cbridge lang zh).
  • 🔒 100% Local & Private: Does not rely on any cloud LLM APIs for storage. Your financial reports and core business documents never leave your hard drive.

🚀 Quick Start

Forget about tedious vector database setups. Everything is handled for you.

1. Installation

Install ContextBridge directly from PyPI (requires Python 3.9+):

pip install cbridge-agent

(On the first run, ContextBridge will automatically download and initialize the built-in embedding models in the background).

2. Initialize Workspace

cbridge init

Follow the interactive prompts to set up your workspace (defaults to ~/ContextBridge_Workspace).

3. Add Folders to Watch

Tell ContextBridge which folders contain your documents:

cbridge watch add /path/to/your/documents

4. Start the Bridge

cbridge start

That's it! The background watcher and API server are now running silently. Any files you add, modify, or delete in your watched folders will be instantly synced to the vector database.

5. Manual Indexing & Cleanup (Optional)

If you made changes while the bridge was offline, you can force a full sync and clean up ghost data:

cbridge index

🤖 Connect Your AI Agent (MCP)

ContextBridge natively supports the Model Context Protocol (MCP), making it the perfect plug-and-play memory module for modern AI Agents.

For Claude Desktop / Cursor / OpenClaw: Simply add the ContextBridge MCP server to your Agent's configuration file:

{
  "mcpServers": {
    "context-bridge": {
      "command": "cbridge",
      "args": ["mcp"]
    }
  }
}

Once connected, whenever your AI Agent needs to recall information from your office documents, it will autonomously query ContextBridge for precise, semantic retrieval.


🛠️ CLI Command Reference

ContextBridge provides an elegant CLI for managing your knowledge base:

  • cbridge init: Interactively initialize configuration.
  • cbridge watch add <dir>: Add a directory to monitor.
  • cbridge watch list: List all monitored directories.
  • cbridge watch remove <dir>: Stop monitoring a directory.
  • cbridge index: Run a full index and clean up ghost data.
  • cbridge start: Start the real-time watcher and API server.
  • cbridge serve: Start only the API server.
  • cbridge search "your query": Test semantic search directly from the terminal.
  • cbridge status: View current configuration and running status.
  • cbridge lang <en|zh>: Switch display language.

🤝 Contributing

We welcome contributions of all kinds! If you are passionate about local AI, RAG technologies, and ultimate Developer Experience (DX), join us in building the strongest AI memory bridge.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📜 License

This project is licensed under the MIT 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

cbridge_agent-0.1.8.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

cbridge_agent-0.1.8-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file cbridge_agent-0.1.8.tar.gz.

File metadata

  • Download URL: cbridge_agent-0.1.8.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cbridge_agent-0.1.8.tar.gz
Algorithm Hash digest
SHA256 adee582b8d8b7c1134c3db56082185f4c1357d20fca0df67992fd1b3d369487b
MD5 1e23eaaf7dd0dca1815271a82f2885b1
BLAKE2b-256 f641500ba19a5dfdd56fd48b21f29325cba1bdb2305c24051994d97ee08a7aff

See more details on using hashes here.

File details

Details for the file cbridge_agent-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: cbridge_agent-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cbridge_agent-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9986bb5448982eb0716f604790fa41b833a1dc6cc2a805c569115c43d53db791
MD5 a67fbf423b1caab81081ebfb52c78aec
BLAKE2b-256 7a12a0bdd650c39f42776f7f061c72e43d4e8178313114446cf09cb80ac0b11b

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