Purpose
briefd is a self-hosted context compiler designed specifically for AI coding teams. The core problem it solves is: the knowledge teams accumulate across multiple projects—terminology, business rules, architecture decisions, and conventions—is usually scattered across CLAUDE.md / AGENTS.md files; loading all of it in every session consumes a large number of tokens, and the portion that exceeds the budget is omitted. briefd stores knowledge in Markdown form in a Git repository, compiles it on demand into context packs that do not exceed a set token budget, and provides them to coding agents through the MCP protocol.
Main capabilities
- On-demand context: Agents call through MCP
search_contextorcompile_bundle, and briefd returns compiled, deduplicated context packs strictly limited bymax_tokens. - Hybrid retrieval: Uses SQLite FTS5 (BM25) and multilingual embeddings (multilingual-e5-small, supporting 100+ languages) for hybrid retrieval, fused via reciprocal rank fusion, with no external services required (no Postgres, vector database, ONNX runtime, or CGO).
- Git as the source: The knowledge repository is a Git repository; the index is a disposable cache that can be rebuilt from a clone. Agents cannot write to the index;
propose_updatecreates reviewable branches/PRs, and only after a human merges them does the content provided by briefd change. - Hard token budget: All APIs that return context accept
max_tokensand never exceed it. - Knowledge graph and maintenance signals: Supports Obsidian-style
[[wikilinks]]and relative links to build a link graph; the dashboard shows orphan documents, broken links, knowledge gaps, document age, code coverage, and more. - Code change tracking: Documents can be associated with code paths through the front matter
refs; briefd tracks the history of code repositories, counts commits to managed paths since a document was last modified, and indicates whether the document lags behind the code. - Optional Jira/Confluence integration: Reads Atlassian Cloud Confluence pages and Jira issues in real time through the same MCP endpoint (read-only, not indexed or stored).
- Dashboard and metrics: The built-in dashboard shows overview, knowledge graph, maintenance, activity, and instance configuration;
/metricsprovides Prometheus-format metrics, and/api/statsprovides JSON. - Multilingual support: The default embedding model supports 100+ languages; English-speaking teams can switch to all-MiniLM-L6-v2 to speed up indexing.
Usage
- Quick trial: Run
briefd demoto start without a repository; the first run downloads the embedding model (about 470 MB), which can be skipped with--embeddings none. - Connect an agent: Configure through
claude mcp add --transport http briefd http://127.0.0.1:7788/mcpor project-level.mcp.json; any MCP client that supports streamable HTTP can be used. - Single-user stdio mode:
briefd mcpprovides MCP through stdio, suitable for direct startup by Claude Desktop, Cursor, and similar tools. - Team shared instance: Use
briefd serveProvides dashboards, metrics, webhooks, and a REST API. - Knowledge repository structure: expects a Git repository or directory containing Markdown, organized by
domain/、conventions/、projects/<name>/; documents are split by##/###headings into sections of about 200–800 tokens with stable IDs. - Configuration: configured via
briefd.yamlorBRIEFD_*environment variables, with command-line flags taking precedence. - Deployment: provides a distroless pure Go image (about 34 MB, linux/amd64 + arm64), supports Compose and systemd, can mount a local directory and set
BRIEFD_SOURCE=/knowledge.
Use cases
- Multi-project teams need unified terminology, business rules, and architecture decisions.
- Want to reduce token consumption and cost per session while maintaining answer coverage.
- Teams need synchronized review of the knowledge base and code, with traceable changes.
- Use Obsidian to manage the knowledge base and want agents to navigate by the link graph.
- Teams need multilingual knowledge bases (such as Turkish, German, and Japanese).
Limitations
- The current version v0.1 is feature-complete but may have rough edges before 1.0.
- Jira/Confluence only supports Atlassian Cloud, not Data Center / Server.
- Does not index the code itself; relies on the agent's grep and LSP.
- The embedding model is about 470 MB on first download; offline use requires prefetching.
- Single-user stdio mode has no port and token; team sharing requires
servemode. - Some planned features (such as usage-driven relevance tuning, contradiction detection, Turkish stemming, and multiple knowledge repositories) are not yet available.