Understand, decide, synthesise, write
Reads the request, picks which tools to call, combines results, plans the implementation, and hands back new knowledge worth keeping.
ContextBrain parses your repositories into a symbol graph and stores what the code can't tell you — the library versions you're pinned to, the business rules, the patterns you expect every agent to follow. Agents reach all of it through 71 MCP tools.
Training data contains every version of every library and none of your decisions. Left alone, an agent averages over all of it. These are the four ways that shows up in a diff.
ContextBrain does no reasoning about your task. It doesn't rank your intent, plan your work or summarise your code into something lossy. It stores, indexes and returns — the agent decides what to ask for and what to do with it.
Reads the request, picks which tools to call, combines results, plans the implementation, and hands back new knowledge worth keeping.
Keeps the symbol graph and three knowledge layers, answers exactly the query asked, and holds it all across sessions, agents and machines.
The layer decides where a fact comes from, whether it can change, and how it is weighted at retrieval time. Nothing is stored without one.
Crawled from official sources, chunked and indexed per library version. Search adds a version filter from your project's tech stack, so a Prisma 5 project never sees Prisma 4 answers.
Domain logic an agent cannot infer from the code: approval thresholds, tenancy constraints, what must never be deleted. Filterable by domain and priority.
How this codebase does things — error handling, auth boundaries, data access. Detected by static analysis over your repo, and added by agents when they learn something worth repeating.
Tree-sitter parses TypeScript, JavaScript, Python and Java — including .tsx and
.jsx — into files, symbols, imports, calls and dependency edges. Everything else about
your repo is built on top of that table.
Functions, classes, interfaces and types with their locations, plus the directory tree, entry points and config files.
References to a symbol, dependents of a file, its own dependencies, and the call hierarchy above and below a function.
Impact analysis crosses static dependents with git co-change history: the files that break, and the files that always move together anyway.
Commits and their diffs are indexed too — search them by message, author or path, see blame-style history for a file, and find the files that churn.
A PostgreSQL schema can be indexed into the same graph — tables and relations become symbols and edges — without storing the credential.
Semgrep rule packs for architecture, database access, frameworks, security and validation propose L3 patterns from what the code actually does.
Lexical and semantic search run against Elasticsearch and merge by reciprocal rank fusion. What comes back is graded, traceable, and checkable against the code it claims to describe.
Both retrievers return a ranking; RRF merges them at k=60. Results from your project's own index get 1.2×, architecture patterns get 1.5×. No opaque re-ranker in between.
Search a single project, or every project you own at once. A separate graph query walks code dependencies, knowledge anchors, rules, documents and git co-changes in one call.
Ask what knowledge covers a file, or what code implements a rule. Each link carries a confidence score, so weak claims look weak.
Anchors are re-checked against current code by an LLM after changes. A health report lists coverage gaps, stale rules and contradictions; an index report shows exactly what is indexed for full-text, vectors, both, or failed.
Eleven document types — architecture, ADR, API reference, runbook, requirements and more — each with version history, full-text search, and a drift check that reports CURRENT, OUTDATED, AHEAD or CONFLICT against the codebase.
Architecture, sequence, flowchart, ERD and class diagrams stored as Mermaid, PlantUML, D2 or Graphviz source. Document templates carry {{variables}} and render on demand.
A cross-project store organised by namespace and tags. Entries are voted on, which moves a reliability score, and every edit keeps history — so what one project learns the rest can use, with a signal of how much to trust it.
An agent can open an investigation session, record findings as it goes, and get back coverage and budget state. Sessions detect stalls and end with a result, instead of an agent wandering until its context fills.
GitHub, GitLab, Gitea and Bitbucket, public or private. Credentials are encrypted at rest, and a push webhook can be registered for you so new commits re-index without anyone remembering to.
Repo fetched with a stored, encrypted credential. Multiple repos per project.
Source files selected, generated output and vendor directories skipped.
Tree-sitter extracts symbols, imports and calls; edges are written to the graph.
Tech stack and versions detected; static rules propose architecture patterns.
Chunks embedded and indexed for full-text and vector search.
Push webhook triggers incremental re-index; anchors get re-verified.
Served over MCP, and each one also reachable from the cb command line. Single purpose, composable in any order, no hidden orchestration.
cb_symbolsfind functions, classes, typescb_structuredirectory tree, entry pointscb_filefile content with line numberscb_graphreferences, dependents, dependencies, callscb_code_searchhybrid lexical + semantic code searchcb_code_statschunks by language and symbol kindcb_impactblast radius for a filecb_historyhotspots and recent commitscb_commitssearch indexed commitscb_blamecommits that touched a pathcb_indexqueue a re-indexcb_db_indexindex a PostgreSQL schemacb_cross_searchsearch every project you owncb_quickstartonboard a repo in one callcb_searchunified search across all sourcescb_rulesL2 business rules, with relationscb_patternsL3 patterns: list, deprecate, deletecb_teachstore a business rulecb_learnstore an architecture patterncb_rule_relatelink rules to each othercb_extract_rulespull rules out of prosecb_knowledge_graphcode, knowledge and git in one querycb_anchorswhat knowledge covers this filecb_verifyre-check anchors against the codecb_healthgaps, stale rules, contradictionscb_docsversion-locked docs for a librarycb_index_docsqueue documentation indexingcb_library_listlibraries linked or availablecb_library_addlink a library versioncb_library_removeunlink a library versioncb_library_statuscrawl state and chunk countscb_research_startdiscover and crawl a library's docscb_research_statusprogress of a research jobcb_research_listresearch jobs for this projectcontext_searchsearch knowledge by layercontext_addadd knowledge to a layercontext_updatereplace a document's contentcontext_deprecateretire without deletingcontext_crawlcrawl a URL into contextcontext_researchdeep research on a librarycontext_build_orientationhints before starting a taskcontext_build_deep_divemulti-facet explorationdocument_listdocuments by type or statusdocument_searchfull-text across documentsdocument_geta document, any versiondocument_writecreate or version a documentdocument_drift_checkis this still true of the codedocument_deletearchive or removediagram_listdiagrams by type or formatdiagram_getdiagram source and metadatadiagram_writecreate or update a diagramdiagram_deleteremove a diagramtemplate_listtemplates for the projecttemplate_gettemplate with placeholderstemplate_writecreate or update a templatetemplate_renderfill a template's variablestemplate_deleteremove a templatecb_global_searchcross-project entries by namespacecb_global_getan entry, with history and votescb_global_addshare knowledge across projectscb_global_updateedit, keeping an audit trailcb_global_votemove an entry's reliabilitystart_investigationopen a budgeted sessionrecord_findinglog a result as you goend_investigationclose with a conclusionget_investigation_statusbudget, coverage, resultcb_statusstack, indexing, knowledge countscb_techstackread or set pinned versionscb_git_configrepos, and push webhookscb_credentialencrypted git tokenscb_index_healthwhat is indexed, what is staleThe MCP server speaks streamable HTTP, so any MCP client — Claude Code, Claude Desktop, your own runner — connects with a URL and a key. People sign in through BitBot's device flow; agents and CI use a project API key.
71 tools at my.contextbrain.ai/api/mcp, authenticated per project.
cb command line35 commands over the same tools, with JSON and quiet output for scripts.
Knowledge, code graph, documents, libraries and webhooks over plain HTTP.
Projects, indexing state, knowledge and keys in the web console.
// .mcp.json { "mcpServers": { "contextbrain": { "type": "http", "url": "https://my.contextbrain.ai/api/mcp", "headers": { "X-API-Key": "proj_yourproject_…" } } } }
# install; the checksum is verified before anything lands curl -fsSL https://contextbrain.ai/cli/install.sh | bash # sign in, pick a project, look around cb login cb project join myapp cb status # the same tools your agents call cb symbols createOrder cb impact src/services/order-service.ts cb rules --domain billing cb search "how do we handle refunds" -o json | jq
A TypeScript monorepo: API, MCP server, background worker, web dashboard and CLI, over Postgres, Elasticsearch and Redis. Nothing in the hot path waits on a model.
ContextBrain is one of the tools behind the BitBot ecosystem — identity, deployment, testing, task management and memory, built to be run together. It is not self-serve, and there is no free tier to click through. If you want a project on the hosted instance, or want to run it in your own cluster, say what you're building and we'll answer.
accounts BitBot — one identity across every tool people cb login — device flow, no password in a terminal agents & CI CB_API_KEY=proj_… — non-interactive, scoped to one project limits per-project rate limits, set by the plan on the account repos GitHub · GitLab · Gitea · Bitbucket, public or private