Skip to main content

Banner

🇨🇳 中文 | 🇬🇧 English

ContextBridge (cbridge-agent)

Connect AI Agents to your Local Documents

Local knowledge base for OpenClaw, Cursor and AI assistants. Read your documents instantly—Word, Excel, PDF. No uploads. Privacy first.

License: MIT Python 3.9+ PyPI version

🌐 Official Website: https://contextbridge.chat

OpenClaw Skill

Native skills for ContextBridge local-context-bridge are available on clawhub.ai.

clawhub install local-context-bridge

Once installed, OpenClaw will automatically detect ContextBridge — no additional configuration needed to search your local documents.

Quick Start

Installation

pip install cbridge-agent

The vector model will be downloaded automatically on the first run.

Initialization

cbridge init

Follow the interactive wizard to complete the configuration (the default workspace is at ~/.cbridge).

Add a Document Directory

cbridge watch add /path/to/your/documents

File changes in this directory will be automatically synced to the vector database.

Search Document Content

cbridge search ContextBridge

Core Feature: Intelligent Text Chunking

ContextBridge uses a three-tier progressive retrieval architecture to ensure AI can precisely locate document content:

L0 Layer: Document Abstract

Automatically extracts document title and first paragraph core content for quick relevance assessment.

L1 Layer: Structural Outline

Parses document heading hierarchy (H1-H3) to build a complete content navigation map.

L2 Layer: Semantic Chunking

  • Default chunk size: 800 characters
  • Smart overlap: 150 characters (maintains context continuity)
  • Paragraph-aware: Splits at natural paragraph boundaries to avoid semantic fragmentation
  • Markdown-friendly: Recognizes code blocks, lists, and other structures to preserve formatting integrity

Retrieval Process

  1. Intent Filtering: Quickly match relevant documents at L0/L1 layers
  2. Fine-grained Retrieval: Precisely search relevant fragments in L2 layer of matched documents
  3. Context Assembly: Return document abstract + relevant excerpts to provide complete context

This design allows AI to quickly locate target documents while obtaining precise contextual information, avoiding the "can't see the forest for the trees" problem of traditional RAG systems.

Other AI Clients

In addition to OpenClaw, ContextBridge also works with Claude Desktop, Cursor, and other MCP-compatible clients:

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

CLI Commands

Command Description
cbridge init Interactive initialization (the service starts automatically; no need to run cbridge start manually)
cbridge watch add <dir> Add a directory to watch
cbridge watch list List watched directories
cbridge watch remove <dir> Remove a watched directory
cbridge start Start the watcher service
cbridge serve Start both the API and watcher services
cbridge index Rebuild the index from scratch
cbridge search "query" Test semantic search
cbridge status Check running status
cbridge lang <zh|en> Switch language
cbridge logs -f View logs

FAQ

Q: How do I switch the PDF parsing strategy? A: Edit the configuration file at ~/.cbridge/config.yaml, and set parser.pdf.strategy to docling (higher accuracy but slower) or markitdown (lightweight default).

Q: What file formats are supported? A: PDF, DOCX, XLSX, PPTX, MD, TXT, and more. MarkItDown covers the vast majority of office document formats.

Q: Where is the indexed data stored? A: All data is stored locally in the ~/.cbridge/ directory, including the vector database and configuration files.

Contributing

Issues and Pull Requests are welcome.

License

MIT License

Metadata

Release files for cbridge-agent 0.1.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cbridge-agent 0.1.21
File Size Uploaded Provenance
cbridge_agent-0.1.21.tar.gz 59.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cbridge-agent 0.1.21
File Interpreter ABI Platform
cbridge_agent-0.1.21-py3-none-any.whl Python 3 none any Details

Total release size: 126.0 kB

Release files / cbridge_agent-0.1.21.tar.gz

Download URL cbridge_agent-0.1.21.tar.gz
Size 59.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2063c618622981b3706475b077e5291593b3c8b2b9f3e2cc0417a2cbf5fa2313
BLAKE2b-256 checksum
How to use checksums
c74d47ab7b7385c03f510ad87d9903feeac2e5efb4a2003c44f01b351467f241
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / cbridge_agent-0.1.21-py3-none-any.whl

Download URL cbridge_agent-0.1.21-py3-none-any.whl
Size 66.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcb928639dcdb14987242991e72d89f596a6dcd0236aca6555fba39828b55647
BLAKE2b-256 checksum
How to use checksums
a615e77a557e50e3af3d57dc563e68a2fee8654c1d153ef0ac643a70a4e559b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Security for cbridge-agent 0.1.21

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page