ContextBridge
Portable, privacy-conscious memory for LLMs. Extracts typed memory from ChatGPT and Claude conversations, redacts secrets before storage, and retrieves only what the next task needs, with every pick explained.
- Position
- Sole developer
- Period
- 2026
- Stack
- Python 3.11 to 3.13
- Pydantic 2
- FAISS
- SQLite
- Flask
- Click
- Chrome extension (MV3)
- ruff
- GitHub Actions
- Status
- v0.2.0, MIT, 201 offline tests, CI on Python 3.11 to 3.13
- Repo
- github.com/TirthPatel6104/ContextBridge
The problem
You spend an afternoon in ChatGPT designing a schema. The next morning you open Claude to write the migration and it knows nothing: not the stack, not the decisions you already argued through, not the tasks still open. The workaround is pasting the transcript. That burns the context window, leaks whatever secrets were in the chat, and still loses the thread.
The idea
Memory is data with a schema, and you own it. A conversation is decomposed into six typed categories (identity, projects, facts, decisions, open tasks, preferences). Every item keeps its confidence, the excerpt it came from, and its source. You review it, remove what is wrong, and every removal is versioned and reversible.
The pipeline
- Import. A transcript, ChatGPT export ZIP, saved page, PDF, or Markdown file is parsed locally. A rule-based extractor works fully offline; an LLM extractor is there when you want quality over privacy.
- Redact. Secrets and personal data are masked before anything is stored.
- Retrieve. Hybrid retrieval: BM25 with optional embedding blending. Each selected item reports its score, the terms it matched, and why it was picked, plus the tokens saved against the full memory and the raw transcript.
- Export. The selection renders the way the target model prefers (XML for Claude, Markdown for ChatGPT, plain text for local models) with a provenance footer.
Merging folds several conversations into one memory. Near-duplicates collapse with their origins kept. Statements that might conflict (“deadline is Q3” and “deadline is Q4”) are flagged, and both stay until you decide.
<context>
<identity>
<item>Tirth, software engineer in Toronto</item>
</identity>
<projects>
<item>ContextBridge: portable memory for LLMs (Python, FAISS)</item>
</projects>
<decisions>
<item>BM25 first, embeddings blended in optionally</item>
<item>Redact secrets before storage</item>
</decisions>
<open_tasks>
<item>Raise retrieval precision@3 above 76.7%</item>
</open_tasks>
<preferences>
<item>Clean architecture; small modules</item>
</preferences>
</context>Measured, in CI
cb eval runs offline against a labelled set, and CI asserts regression floors, so a commit that makes retrieval worse fails the build.
| Metric | Result |
|---|---|
| Retrieval precision@3 | 76.7% |
| Retrieval recall@3 | 93.3% |
| Mean reciprocal rank | 86.7% |
| Duplicate detection F1 | 75.0% |
| Redaction recall | 100%, 0 false positives |
| Injected context vs raw transcript | 93.2% smaller |
| Injected context vs full memory | 81.5% smaller |
Precision@3 is the weakest number on the board, and it is printed anyway.
Surfaces
One service layer serves three surfaces.
- CLI
cb import,cb inspect,cb retrieve,cb prompt,cb eval,cb rollback. Scriptable.- Dashboard
- A local Flask app on 127.0.0.1. Drop a file, review and redact, tune top-k, categories, minimum score, and a token budget, then copy the prompt.
- Extension
- A Chrome extension adds a button to chatgpt.com and claude.ai, sends the open conversation to the local server, and returns a paste-ready prompt for the other model.
A transcript leaves the machine only when you choose a vendor extraction engine.