docbrain
by docbrain-ai
README.md
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/brand/jot-dark.png" />
<img src="assets/brand/jot-light.png" alt="DocBrain" width="200" />
</picture>
</p>
<p align="center">
<strong>Decision guardrails for coding agents.</strong><br/>
Your coding agent doesn't know why your code is the way it is, or that the doc it just trusted went stale. DocBrain does, and stops it. It runs on your infrastructure, with MIT client tooling and read-only access to your systems.
</p>
<p align="center">
<a href="https://docbrainapi.com"><img src="https://img.shields.io/badge/website-docbrainapi.com-6366f1" alt="Website" /></a>
<a href="https://github.com/docbrain-ai/docbrain/stargazers"><img src="https://img.shields.io/github/stars/docbrain-ai/docbrain?style=social" alt="Stars" /></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License" /></a>
<img src="https://img.shields.io/badge/built_with-Rust-orange" alt="Rust" />
<a href="https://github.com/docbrain-ai/docbrain/actions/workflows/clients.yml"><img src="https://github.com/docbrain-ai/docbrain/actions/workflows/clients.yml/badge.svg" alt="clients CI" /></a>
<a href="https://glama.ai/mcp/servers/docbrain-ai/docbrain"><img src="https://glama.ai/mcp/servers/docbrain-ai/docbrain/badge" alt="MCP" height="20" /></a>
</p>
<p align="center">
<a href="https://docbrainapi.com"><strong>Website</strong></a> •
<a href="https://docbrainapi.com/docs"><strong>Docs</strong></a> •
<a href="#quickstart">Quickstart</a> •
<a href="#how-it-works">How it works</a> •
<a href="#architecture">Architecture</a> •
<a href="#navigate">Navigate</a>
</p>
---
<p align="center">
<a href="https://youtu.be/DeiP74HuVDc">
<img src="assets/agent-in-the-editor.gif" alt="A coding agent calls docbrain_context before a commit, reads a captured decision it could not have known, and refuses the change" width="720" />
</a>
<br/>
<em>A one-line chart bump that takes checkout down, and the agent that refuses it: <a href="https://youtu.be/DeiP74HuVDc">watch the 54-second clip</a></em>
</p>
---
## Why decisions get broken
Most engineering decisions live outside the repository, in Slack threads, pull request comments, design docs, and tickets. A coding agent editing a file only sees the code and comments in git. If a constraint was agreed in a pull request or a Slack channel, the agent doesn't know about it, and tests only fail if someone wrote a test for that constraint.
## How it works
DocBrain connects those decisions to the files they affect, checks whether the facts they depend on are still true, and shows them before the file changes:
1. Read-only connectors pull decisions from Slack, GitHub, GitLab, Confluence, Jira, PagerDuty, and custom plugins. In an editor session, you can also say "capture this" and approve the draft before anything is saved.
2. Between sessions, DocBrain checks each decision's premises against its source (for example, `cert-manager is pinned to chart version 1.21.1`) and records when a value changes.
3. Before an edit and on every pull request, DocBrain shows the decisions and broken-premise warnings for the touched files. It warns by default and blocks when you configure it to. Active records sync to `.knowledge/` as plain Markdown so checks also run offline.
| State | Meaning |
|---|---|
| `holds` | the source still matches the premise |
| `broken` | the source changed; includes the new value and the date |
| `uncheckable` | the source couldn't be read on the last check |
| `dormant` | checks are paused for this premise |
When a source can't be read, DocBrain marks the premise `uncheckable` instead of `broken` so a network error doesn't produce a false alert.
<p align="center">
<a href="https://youtube.com/shorts/sq0zkHxWIaA">
<img src="assets/reason-expired.gif" alt="The same docbrain ask command run twice; the second answer opens with a dated stale-claim warning" width="620" />
</a>
<br/>
<em>Running the same query before and after an upstream change: <a href="https://youtube.com/shorts/sq0zkHxWIaA">watch the answer update</a></em>
</p>
## Quickstart
### 1. Start the server
```bash
git clone https://github.com/docbrain-ai/docbrain.git && cd docbrain
./scripts/setup.sh
```
`./scripts/setup.sh` configures your model provider (local Ollama with no API key, or any of 14 cloud providers), generates keys, creates your account, and starts the web app and API at http://localhost:3001. For manual Docker Compose or Kubernetes setup, see the [quickstart](docs/quickstart.md) and [Kubernetes guide](docs/kubernetes.md).
### 2. Connect your coding agent
```bash
claude plugin marketplace add docbrain-ai/docbrain --scope project && claude plugin install docbrain@docbrain --scope project
claude mcp add --transport http --scope project docbrain http://localhost:3001/api/v1/mcp
```
Run `/mcp` in Claude Code, pick `docbrain`, and click **Allow** in your browser. Add these lines to `CLAUDE.md` or `AGENTS.md` so the agent checks DocBrain before editing:
```markdown
Before editing files you have not worked in before, call docbrain_context
with their repo-relative paths and read what comes back first.
```
For Cursor, VS Code, or stdio setup, see [coding agents](docs/agents.md) and [`examples/mcp-configs/`](examples/mcp-configs/).
## Architecture
<p align="center">
<img src="assets/architecture.png" alt="Connected sources feed DocBrain, which serves your editor, pull requests, Slack, and the CLI while re-checking premises against the original sources" width="860" />
</p>
DocBrain runs a Rust server, PostgreSQL, OpenSearch, and Redis behind a single origin. On Kubernetes, the default Helm chart requests 500m CPU and 2 GiB of memory for PostgreSQL and a few hundred megabytes each for the server and web app; the optional learning trainer is capped at 8 GiB.
Everything runs in your network and reads your connected sources without writing to them. Confluence restrictions, Slack channel membership, and repository visibility apply to queries, and API keys are hashed with Argon2. Client and verification code in [`crates/`](crates/) and [`tools/`](tools/) is MIT licensed; see [architecture](docs/architecture.md), [access control](docs/access-control.md), and [THREAT_MODEL.md](THREAT_MODEL.md).
## Navigate
| Task | Start here |
|---|---|
| Run locally with Ollama or cloud models | [Quickstart](docs/quickstart.md), [LLM providers](docs/providers.md), [Configuration](docs/configuration.md) |
| Deploy on Kubernetes with SSO and permissions | [Kubernetes Helm guide](docs/kubernetes.md), [Access control](docs/access-control.md), [RBAC](docs/rbac.md), [SSO](docs/sso.md) |
| Wire up Claude Code, Cursor, VS Code, or the CLI | [Coding agents](docs/agents.md), [MCP configs](examples/mcp-configs/), [Claude Code plugin](plugins/docbrain/README.md), [CLI reference](docs/cli.md) |
| Connect Slack, GitHub, Confluence, or custom tools | [Ingestion guide](docs/ingestion.md) (13 built-in sources), [Connector SDK](docs/connectors.md) |
| Inspect `.knowledge/`, premise checks, and `.dbev` proofs | [Premise checks](docs/premises.md), [`docbrain-knowledge`](crates/docbrain-knowledge/), [Evidence bundles](docs/evidence.md) |
| Audit security, data retention, and open client crates | [Threat model](THREAT_MODEL.md), [Data retention](docs/data-retention.md), [`crates/`](crates/), [Roadmap](ROADMAP.md) |
| Use cited Q&A, Slack, doc drafting, or the REST API | [API reference](docs/api-reference.md), [MCP tools](docs/mcp-tools.md), [Slack](docs/slack.md), [Knowledge intelligence](docs/knowledge-intelligence.md), [Autopilot](docs/autopilot.md), [Generate](docs/generate.md), [Governance](docs/governance.md), [Reviews](docs/reviews.md), [Style policy](docs/style-policy.md), [Learning](docs/learning.md) |
## See it in action
| | |
|---|---|
| [What is DocBrain?](https://youtu.be/S4aSTmevvOQ), 5-min overview | [Deep Dive Podcast](https://youtu.be/GN4SC6L8YmI), 20-min deep dive |
| [MCP Preview](https://youtu.be/9mZLoQnGLl8), 30-sec IDE demo | [Full Proof Demo](https://youtu.be/yqj5BCVOLHw), Downvote → Gap → Draft |
## Contributing and license
Code pull requests are welcome in [`crates/`](crates/), [`plugins/`](plugins/), and [`helm/`](helm/), and bug reports, configuration fixes, and documentation improvements are welcome across the repository. Read the [contributing guide](CONTRIBUTING.md), [security policy](SECURITY.md) (don't file public issues for vulnerabilities), and [code of conduct](CODE_OF_CONDUCT.md). For questions or feedback, open a [GitHub Issue](https://github.com/docbrain-ai/docbrain/issues), start a [Discussion](https://github.com/docbrain-ai/docbrain/discussions), or email [hello@docbrainapi.com](mailto:hello@docbrainapi.com).
This repository is [MIT licensed](LICENSE). DocBrain server binaries and container images are distributed under the [Business Source License 1.1](LICENSE-SERVER), which permits production use except offering DocBrain as a hosted service; for alternative licensing, email [licensing@docbrainapi.com](mailto:licensing@docbrainapi.com).
This server cannot be deployed
Maintenance
ActivityActive
ResponsivenessMixed handling