How it works

Five stages, one engine.

A pipeline you can audit end-to-end — sources in, grounded context out. No black-box magic; every cited chunk is reproducible.

↓ scroll

The pipeline at a glance

1 · SOURCES2 · INGEST3 · STORE4 · RETRIEVE5 · SURFACEGoogle DocsMarkdown/PDFFigma framesMeeting notesJira / LinearPR threadsCode chunksSlack (soon)Chunkerheading-aware+ EmbedderKnowledge graphpgvector + recursive CTERole-awareretrieval+ citation engine[1][2][3]Memoryorg · project · sessionEvalrecall · MRR · grade👨‍💻 Developer🎨 Designer🧪 QA📋 PM💼 Client chat🤖 AI agent → PR🔌 Claude Code MCPHost PM app💬 Embedded chatSOURCES → INGEST → STORE → RETRIEVE → SURFACE · 6S LOOP
1

Stage 1

Sources

Software work happens across seven kinds of artifacts.

Modern software work happens across seven kinds of artifacts: code in your repo, documents in Drive or Notion, designs in Figma, tickets in Jira or Linear, threads in Slack, meeting transcripts, and PR review comments. Each one tells part of the story; none of them tells all of it.

ContextBrain reads every one of them. Connect a GitHub or GitLab repo and we index the code. Upload a PDF, paste a Google Doc URL, or connect Figma — we read those too. Sync Jira and Linear with one OAuth click. Drop a Granola transcript in. PR descriptions stream in via webhook. Everything lands in one project space.

2

Stage 2

Ingest

Reading is easy. Understanding is the work.

Every source goes through a normalize-to-markdown adapter and a heading-aware chunker, then an embedder (your choice of OpenAI or Voyage models). Chunks are sized to a token budget — small enough to retrieve precisely, large enough to carry meaning.

For code, we go further: a dependency graph is built incrementally on every push, with module-level layout cached for instant rendering. Architecture is no longer a stale diagram in Confluence — it's a live artifact.

3

Stage 3

Store

Postgres-native. No second database to operate.

Most AI-context tools require you to operate two new databases: one for vectors, one for the graph. ContextBrain is Postgres-native: vectors live in pgvector, the graph lives in a code_edges table walked with recursive CTEs. One backup target. One disaster-recovery story. One thing to monitor.

Want to scale? Add read replicas. Want to self-host?docker compose up. Same stack from your laptop to a 500-engineer enterprise.

4

Stage 4

Retrieve

Role-aware, audience-filtered, citation-engine-ready.

When a developer asks "how does session refresh work?", ContextBrain doesn't just embed the query and dump the top-10. It runs a role-aware retriever: code chunks for developers, ticket + spec docs for PMs, designs + UI tickets for designers, client-shareable docs only for clients. Same query, different ranking, every time.

Documents you've linked to a feature path (or that a previous agent run cited) get a boost score. Stale chunks lose to fresh ones. The result is a token-budgeted context pack with a confidence score, ready for any consumer.

5

Stage 5

Surface

The pack is the primitive. Everything else is a surface on top of it.

The Chat UI streams cited answers over SSE with role-aware system prompts. The shareable client chat at /chat/[token] lets a client self-serve project status from a 7-day read-only link, role hard-clamped to client on the server.

The embed widget ships the same chat surface as a drop-in <script> tag, mounting inside any PM application via a sandboxed iframe + Web Component. The agent runner reads a pack and ships a PR. The MCP server exposes the pack to Claude Code.

A new surface — say a Slack-bot or VS Code panel — is a thin layer over the same pack. Build once, serve every role.

Citations are first-class — not a footnote

Every assistant turn carries a JSON array of [n] → {kind, id} tuples — parsed tail-buffered so an SSE delta that splits [1] across the boundary still resolves. The chip below the answer is clickable: in admin it routes to the source file, in the public surface it shows a preview.

What this means in practice

You can prove every claim in every answer back to a specific chunk. Compliance teams love it. Devs love it more.

Claude Code in seconds

MCP server, ready in one curl

ContextBrain ships an MCP server (stdio + SSE). Install the shim and Claude Code reads the same role-aware retrieval, the same audience filter, the same cited packs your team uses in the chat surface.

curl -fsSL https://app.contextbrain.io/install/mcp.sh | bash

See /help/set-up-claude-code-mcp for Cursor and stdio configurations.

Want to see the pipeline running on a real project?

We index a public open-source project for the live chat demo on the /chat page — ask it any question and watch the citations resolve in real time.

Try the live chat demo

From spec to ship, one engine.

Connect a repo, upload a spec, watch the graph form. Five minutes, no card.