docbrain-ai/docbrain: DocBrain makes documentation improve itself. Contribute to docbrain-ai/docbrain development by creat

github.com · 2026-07-23 · by Long Nguyen ·github
DocBrain makes documentation improve itself. Contribute to docbrain-ai/docbrain development by creating an account on GitHub.

docbrain-ai/docbrain

DocBrain makes documentation improve itself. Contribute to docbrain-ai/docbrain development by creating an account on GitHub.

22 stars · 4 forks · HTML

README

The institutional memory layer for your organization. DocBrain captures the decisions, fixes, and expertise that live in conversations, tickets, incidents, and people's heads — connects them across the tools you already use, keeps them accurate, and preserves them when people leave. Self-hosted. Read-only. Every answer cited to its source.

Website • Docs • Quickstart • The Problem • How It Works • Features • Architecture • Security

Project Status: pre-source release. What's open right now: production Docker images, full Helm charts, complete configuration, the threat model, and all the docs you need to self-host and run DocBrain in production today. What's not open yet: the source code. We're publishing it once a few internal APIs stabilize, targeting the first half of 2026, under the BSL 1.1 terms below. Until then, contributions land best as documentation fixes, configuration improvements, and bug reports. We'd rather tell you this plainly than dress it up.

The Problem Every organization runs on knowledge that never gets written down. The decision made in a meeting. The fix someone found at 2am. The workaround only one person knows. The reason it was built this way and not the obvious way. It lives in PRs, chat threads, tickets, and people's heads — and it was never going to end up in a wiki. Then it leaves. Someone changes teams or quits, and years of context walk out with them. A new hire spends months re-asking questions that were answered long ago. Two teams solve the same problem a quarter apart because neither could find the other's work. During an incident, the one runbook that matters is six months stale and the person who wrote it is gone. The root cause isn't laziness, and it isn't missing docs. Knowledge written down after the work is done is written from memory, without context, under competing priorities — a tax nobody wants to pay, and the result decays the moment it's written. Every tool in the market solves the wrong half of the problem. They index the knowledge you already wrote down and put a chatbot on top. Now you retrieve your stale, incomplete, scattered wiki slightly faster. The knowledge that actually runs your organization was never captured in the first place. And it's getting worse: people change roles faster, teams are distributed, and AI now produces work faster than any human can absorb the reasoning behind it. The gap between what your organization does and what it remembers widens every quarter. This isn't only an engineering problem. The same amnesia hits operations, support, and any team whose expertise lives in its people. DocBrain starts where knowledge decays fastest, and its language-agnostic Connector SDK extends the same memory layer to any source you have.

How DocBrain Works DocBrain is a memory layer. It doesn't wait for someone to write a doc — it captures knowledge at the point of creation, connects it into one searchable memory, preserves the reasoning behind it, and keeps it accurate over time. Capture happens at the source, the same principle that made shift-left testing work: move the capture upstream, to where the knowledge actually exists. WHERE KNOWLEDGE IS CREATED ─────────────────────────

Someone merges a change ──→ DocBrain extracts the decisions, caveats, procedures A team works through chat ──→ DocBrain distills the answer from the conversation A deploy goes out ──→ DocBrain captures what changed and why On-call resolves an incident ──→ DocBrain captures the fix and the root cause Any other system you run ──→ DocBrain ingests it via the Connector SDK

│ ▼

HOW KNOWLEDGE BECOMES MEMORY ────────────────────────────

┌─────────┐ ┌──────────┐ ┌───────────┐ ┌──────────┐ │ Capture │───→│ Connect │───→│ Preserve │───→│ Keep │ │ │ │ │ │ │ │ current │ └─────────┘ └──────────┘ └───────────┘ └──────────┘

At the source, Linked into Decisions and Freshness the moment it's one graph by the "why" kept tracked; stale created — no topic, people, with provenance and conflicting wiki to maintain and dependencies knowledge flagged

This is what makes DocBrain different. Other tools organize the knowledge you already wrote down and answer questions about it. DocBrain captures the knowledge you didn't — the PR decisions, the chat explanations, the deployment gotchas, the incident resolutions — and turns it into memory your whole organization can draw on. The result: knowledge born from real work, not written from memory. Connected into one memory, not scattered across ten tools. Preserved with its context, so the why survives the people who knew it. And kept current, so you can trust what it tells you.

Quickstart git clone https://github.com/docbrain-ai/docbrain.git && cd docbrain ./scripts/setup.sh # interactive wizard: picks provider, sets keys, starts services Or manually: cp .env.example .env # set LLM_PROVIDER and API keys docker compose up -d

Get the auto-generated admin API key

docker compose exec server cat /app/admin-bootstrap-key.txt

Open the web dashboard

open http://localhost:3001

Or ask a question via API (same origin as the UI — /api/* is proxied to the server)

curl -H "Authorization: Bearer <key>" \ -H "Content-Type: application/json" \ -d '{"question":"How do I deploy to production?"}' \ http://localhost:3001/api/v1/ask The Web UI at http://localhost:3001 gives you the full experience: dashboard, knowledge capture, governance, quality scores, review workflows, predictive analytics, and more. Full setup guide: docs/quickstart.md

Why DocBrain For Engineers

Zero extra work. Knowledge is captured from PRs, commits, Slack threads, and CI pipelines you're already using. No context-switching to a wiki. Capture from your IDE. docbrain_annotate, docbrain_suggest_capture, and docbrain_commit_capture via MCP. Works in Claude Code, Cursor, and any MCP-compatible editor. Quality gates in CI. Lint docs with custom style rules, enforce structure, catch stale content before it ships. POST /api/v1/quality/lint plugs into any CI pipeline. Ask, don't search. Query your entire knowledge base with confidence-scored answers that cite sources. No more digging through Confluence.

For Team Leads & Managers

Know what's documented and what isn't. Governance dashboards show coverage per space, per team. See exactly where the gaps are. SLA enforcement. Per-space policies ensure gaps are acknowledged within 24h and resolved within 7 days. Automated breach detection with notifications. ROI tracking. Documentation velocity, time saved per query, resolution rates, and knowledge half-life, per team, in dollars. Review workflows. Multi-stage approval pipelines (SME Review → Writer Review → Publish) with threaded comments, so nothing goes live without oversight.

For Platform & Operations

Self-hosted, single binary. Rust backend, no JVM, no Python dependency hell. Docker, Kubernetes, or bare metal. Sub-100ms API responses. 14 LLM providers. Anthropic, OpenAI, AWS Bedrock, Ollama (fully local), Gemini, and 9 more. Swap providers without changing a line of code. 13+ knowledge sources. Confluence, Slack, Teams, GitHub, GitLab, Jira, PagerDuty, and more. Connector SDK for anything else. Full OpenAPI spec. Swagger UI at /api/docs. Auto-generated OpenAPI 3.1 spec. 150+ API endpoints. RBAC, SSO, space isolation. GitHub/GitLab/OIDC SSO, 4-tier role system (viewer/editor/analyst/admin), per-space access restrictions. Event-driven. Real-time event bus with SSE streaming. Outbound webhooks with HMAC-SHA256 signing, exponential backoff, and circuit breakers.

"My IDE already has MCP. Why DocBrain?" Fair question. Cursor and Claude Code can hit your tools over MCP too. The difference is what happens after the answer: they forget it, DocBrain keeps it.

IDE + MCP DocBrain

Reads live tools at answer time Yes Yes

Remembers the answer after you close the tab No Yes

Learns from everyone, not just you No Yes

Maps who owns what, what depends on what No Yes

Turns answers into durable, quality-scored docs No Yes

Scope One developer's session One shared brain for the org, with RBAC

An IDE asks your tools a question. DocBrain turns every question your organization has ever asked into a system that gets smarter. The 100th person asking about a topic gets a better answer because of the first 99.

Features Knowledge Capture at the Source The core of DocBrain. Every integration point captures knowledge where it's created, before anyone has to remember to document it.

Capture Point How It Works

Merged PRs POST /api/v1/ci/analyze: LLM extracts decisions, facts, caveats, and procedures from diffs and commit messages. Hook it into GitHub Actions or GitLab CI.

Deployments POST /api/v1/ci/deploy-capture: Captures deployment context, environment changes, and rollback procedures.

Slack & Teams Capture threads via message shortcut, @DocBrain capture mention, or /docbrain capture: distills conversations into knowledge fragments with confidence scoring.

IDE (MCP) docbrain_annotate links knowledge to exact code locations. docbrain_commit_capture captures intent at commit time. 10 MCP tools total.

Conversations Auto-distillation extracts fragments from Q&A sessions. When someone asks a question and gets a good answer, that answer becomes a fragment automatically.

Manual POST /api/v1/fragments: Teams can submit fragments directly. CLI: docbrain capture.

What happens after capture: Every fragment is confidence-scored and routed automatically:

High confidence (>0.7): Auto-indexed into search, immediately available for Q&A Medium confidence (0.4–0.7): Queued for human review Low confidence (<0.4): Discarded as noise

Knowledge Quality Pipeline Every fragment and document is scored across three independent layers. No unscored content enters the system:

Layer Method What It Measures

Structural Deterministic (no LLM cost) Heading structure, section completeness, code examples, link density, readability

Style Rule engine Banned terms, heading depth, sentence length, required sections, custom regex

Semantic LLM-assessed (budget-controlled) Accuracy, clarity, completeness, actionability

Composite score: structural × 0.4 + style × 0.3 + semantic × 0.3 Quality scores drive automation: low-scoring docs trigger maintenance suggestions, stale docs trigger freshness alerts, and contradictions between docs are flagged automatically. Custom Style Rules: Your Style Guide, Enforced Automatically Every team has a style guide. Nobody follows it. DocBrain enforces it on every document and draft:

Export your rules as YAML, version-control them, import across spaces

  • rule_type: terminology
  • name: no-simple description: "Don't assume expertise. Avoid 'simple' and 'easy'" config: wrong: "simple" right: "straightforward" match_whole_word: true severity: warning

  • rule_type: formatting
  • name: short-sentences description: "Keep sentences under 40 words for readability" config: max_words: 40 severity: info

  • rule_type: structure
  • name: require-intro description: "Every doc needs an introduction before the first heading" config: min_words_before_first_heading: 10 severity: warning

  • rule_type: custom_pattern
name: no-internal-urls description: "Don't leak internal URLs in public docs" config: pattern: "https?://internal\\." message: "Remove internal URL before publishing" severity: error Four rule types: terminology (banned/preferred terms), formatting (heading depth, sentence length), structure (required sections, intro paragraphs), and custom_pattern (regex for anything else). Per-space scoping: Different rules for API docs vs. runbooks vs. onboarding guides. YAML import/export: Version-control your rules. GET /api/v1/style-rules/export → commit to git → POST /api/v1/style-rules/import on deploy. Lint any text on demand: POST /api/v1/quality/lint with raw text → get violations with line numbers, severity, and fix suggestions. Wire it into CI to block PRs that break your style guide. GitOps for style policy: Check .docbrain/style.md into your team's repo; DocBrain pulls it on a schedule and applies the rules to every draft for that space. Policy changes go through normal PR review. See docs/style-policy.md and the working examples/style/ example. Governance & Accountability Documentation without ownership decays. DocBrain makes ownership and accountability explicit:

Space ownership: Owners, maintainers, and topic stewards per knowledge space. Clear responsibility chains. SLA policies: Per-space deadlines for gap acknowledgment (24h), resolution (7d), draft review (48h), and document freshness. Configurable per space. Breach detection: Automated scanning surfaces SLA violations. Breaches trigger events, notifications, and webhook deliveries. Governance dashboard: Coverage percentages, SLA compliance trends, quality distribution, capture velocity, and top contributors, all in one view. Notifications: In-app notification center with unread tracking. SLA breaches, review assignments, and gap alerts delivered to the right people.

See Governance Guide for setup and configuration. Review Workflows Configurable multi-stage review pipelines for documentation drafts:

Define stages per space: e.g., SME Review → Technical Writing → Publish Approval. Each stage has assigned reviewers and required approvals. Submit for review: Autopilot drafts, manually written docs, or composed fragments can all enter the review pipeline. Approve / Request Changes / Reject: Reviewers act on drafts with threaded comments for inline feedback. Personal review queue: Every reviewer sees their pending items in one place. Auto-publish on approval: When all stages pass, the document publishes to your configured target (Confluence, etc.).

See Review Workflows Guide for configuration and API details. Source-System Access Control (ACL) DocBrain enforces source-system permissions at query time. Restrict a Confluence page to your Finance team and DocBrain respects it; lock down a private Slack channel and DocBrain won't surface its content to users outside that channel.

Per-source extraction: Confluence page restrictions, GitHub repo visibility + collaborators, Slack channel membership, Jira issue security levels. Each source's real permission model is mirrored, not flattened. Three enforcement modes: off (default, fully backwards-compatible), warn (logs would-have-denied chunks for coverage validation), enforce (drops denied chunks before they reach the LLM). Side-channel mitigations: when the filter wipes out results, the answer text, confidence score, and source list are all sanitized so the response doesn't leak the existence of denied content via context-derived synthesis. Three denial UX modes: silent (MNPI-safe, generic message), disclosed_no_count (default, tells the user the filter is on, no specifics leak), disclosed (full transparency for open-collaboration orgs). Per-source / per-role overrides with strictest-wins resolution. Mixing public and restricted content in one query never weakens the response. Audit log for HIPAA / FedRAMP / SOC2 compliance. Every full or partial denial persisted with policy provenance. Structured access metadata in every API response so any client (web UI, Slack bot, CLI, custom integration) can render denials appropriately.

acl: mode: enforce sources: confluence: { mode: mirror } github: { mode: mirror } slack: { mode: mirror } jira: { mode: mirror } denial: mode: disclosed_no_count # silent | disclosed_no_count | disclosed referral: "your administrator" audit: false # flip true for compliance contexts Default off. Opt in source by source. See Access Control (ACL) for the full guide. Intelligent Q&A (RAG)

Confidence-scored answers: High confidence returns sourced answers with citations. Low confidence asks clarifying questions instead of guessing. Intent classification: Adapts response format to query type: find, how-to, troubleshoot, who-owns, explain. Each gets a different answer structure. Hybrid search: OpenSearch with both vector (k-NN) and keyword (BM25) retrieval, combined for precision. 4-tier memory: Working, episodic, semantic, and procedural memory that compounds over time. The system gets smarter with use. Document freshness: 5-signal scoring (time decay, engagement, content currency, link health, contradiction detection) with staleness alerts. Auto-detects archived / historical / reference docs from Confluence labels and excludes them from scoring. Old isn't the same as wrong. See exclusion rules.

Documentation Autopilot The autonomous documentation engine that finds and fills gaps without human intervention:

Gap detection: Clusters unanswered questions and low-confidence answers by semantic similarity. Severity scoring based on user count, negative signal ratio, and recency. Draft generation: AI composes missing documentation grounded in existing docs, fragments, and conversation context. No hallucination. Every claim must be sourced. Review routing: Generated drafts automatically enter the review workflow for human approval. Nothing publishes without oversight. Weekly digest: Summary of gaps detected, drafts generated, and coverage changes delivered to space owners. Forecast: Predictive gap analysis shows where documentation gaps are likely to appear next.

See Autopilot Guide for configuration and tuning. Grounded Doc Generation (docbrain generate) Produce a documentation draft grounded in your org's own reality — your runbooks, incidents, tickets, PRs, and Slack threads — with per-claim provenance, and honest about what it doesn't know. A frontier model with no access to your systems writes fluent, generic prose; generate writes what is true for you, or says it can't. Where Autopilot is automatic and gap-driven, generate is on-demand: you name the doc, hand it the source material, and get the markdown back.

Provenance, not vibes. Every section is attributed to the corpus, episode, or live connector it was built from. Same gates as every other DocBrain doc. Secret/PII redaction, hostname scrub, prompt-injection quarantine, and structural + style scoring all apply — a template can shape sections and tone but can never carry or disable a safety rule. Honest when it doesn't know. Instead of fabricating, it emits needs_input — the open questions the available knowledge couldn't answer. Returns, never publishes. Stateless. stdout is pipe-clean (markdown only); diagnostics go to stderr; non-zero exit on error-severity violations unless --allow-violations (CI-native).

Runbook from local notes, redirected to a file (pipe-clean stdout)

docbrain generate "runbook for cert rotation" --source notes.md > out.md

Postmortem grounded in a real Slack incident thread

docbrain generate "postmortem from this incident" \ --source-url https://acme.slack.com/archives/C123/p1700000000123 > postmortem.md

API reference grounded in a GitHub PR's changes

docbrain generate "API reference for the changed endpoints" \ --source-url https://github.com/acme/repo/pull/42 --type reference

--source-url (repeatable) names a link as primary material — DocBrain fetches it via the connected MCP connector (Confluence page, Jira issue, Slack thread, GitHub PR or file). It is all-or-nothing: if any named URL can't be fetched the whole run aborts and names the failed source — never a doc silently built from a subset. Fetched content is size-bounded (per-source + aggregate byte caps) just like inline sources. --target augments an existing doc instead of rewriting it; --templa

source

github.com · 6 images · 151 links

Comments (0)

No comments yet