SourceBrain

A versioned knowledge base for your codebase. Capture lessons learned, document system rules, and export context bundles that any developer or AI model can use, without reading every file every time.

What is SourceBrain?

SourceBrain lets you build a structured, versioned collection of knowledge about your codebase. Each piece of knowledge lives at a path like auth/jwt or api/rate-limiting. Paths form a tree that you can browse in the CLI or web UI, and every time you update a lesson a new version is saved, so you can see how your understanding evolved over time.

SourceBrain is designed to feed that knowledge to AI agents. Run sourcebrain context "authentication" to get a clean markdown document of every relevant lesson to paste into a prompt, or connect the built-in MCP server so tools like Claude Desktop and Cursor can search, read, and even write lessons on their own. See the AI Integration guide.

Two modes

πŸ—‚ Local mode

Works like git. Run sourcebrain init in any project directory to create a .sourcebrain/ folder with a local SQLite database. No login, no server, works offline. Add the folder to .gitignore: it is a database, not diffable text, and lessons are versioned inside SourceBrain itself.

☁️ Cloud mode

Sign up, create a workspace, and every lesson you add is stored on the server. Invite teammates to the same workspace. Use the web UI to browse and edit. Use push and pull to sync with a local copy.

πŸ’‘
You can use both modes at once. Start with sourcebrain init for local work, then sourcebrain login + sourcebrain push to share it with your team.

What to read next

SourceBrain Docs Β· SourceBrain