Built for the Cognee 2026 Hackathon β Targeting the "Best Use of Open Source" Track
DevBrain is a sovereign, persistent memory layer for developers.
Today's AI coding assistants have a "Vegas Hangover" problem: What happens in the chat tab, stays in the chat tab. Every time you open a new chat window or restart your IDE, the AI forgets all of your architectural decisions, structural dependencies, and coding patterns.
DevBrain solves this by decoupling your project's memory from the AI compute layer. It uses a background harvester and manual capture tools to build a local Knowledge Graph of your entire codebase using the Cognee framework. Any AI assistant (like Cursor, Claude, or Antigravity) can plug into DevBrain to instantly recall the exact architectural context of your project before it writes a single line of code.
DevBrain has evolved into a premium developer engine that gives engineers complete control over both their storage topology and their model intelligence layer.
graph TD
A[devbrain.py CLI] --> B(harvester.py Watcher)
A --> C(dashboard/ Next.js UI)
B -- Git Diffs --> D[devbrain_core.py Memory Engine]
C -- API Calls --> D
E[MCP IDE Plugin Cursor/Claude] -- Tool Calls --> D
D -- cognee.remember --> F[(Local Kuzu Graph DB)]
D -- cognee.recall --> F
F -- Context --> G{LLM Reasoning Layer}
G -- Offline --> H[Ollama: smollm3]
G -- High-Velocity --> I[Groq: qwen3.6-27b]
local(Default): Guarantees privacy-first isolation for secure internal repos. Operates 100% locally on embedded SQLite, LanceDB, and Kuzu Graph databases.
Developers can explicitly choose their intelligence tier while keeping Cognee storage local:
openai-compatible: High-velocity cloud-hybrid tier. Routes reasoning to Groq's OpenAI-compatible API, while keeping graph storage local.ollama: Sovereign local tier. Runs 100% offline through Ollama withalibayram/smollm3for absolute privacy.
DevBrain's entire intelligence is powered by Cognee, which acts as the orchestration layer for building the local knowledge graph. We utilized Cognee's exact four primitives to manage the memory lifecycle:
- Role: Ingestion Engine.
- How DevBrain Uses It: When the background Harvester detects a git diff, or when a developer explicitly captures an architectural note via the CLI (
devbrain note), DevBrain passes the raw text tocognee.remember(). Cognee automatically extracts the semantic meaning and injects the nodes into the vector space and Kuzu graph.
- Role: Retrieval Engine.
- How DevBrain Uses It: When a user queries the DevBrain Assistant in the Dashboard, or when an AI agent requests context via MCP, DevBrain calls
cognee.recall(query_text). Cognee traverses the Kuzu graph to retrieve relevant structural decisions, which DevBrain formats into a Markdown manifest to guide the LLM's response.
- Role: Graph Defragmenter.
- How DevBrain Uses It: Over time, memory can become tangled. DevBrain exposes an
optimizeCLI command and API route that triggerscognee.improve(). This prunes stale nodes, re-evaluates schema connections, and re-balances graph weights to maintain a clean repository ontology.
- Role: Surgical Purge.
- How DevBrain Uses It: If a developer creates a prototype branch and wants to wipe the slate clean, DevBrain's "Wipe Matrix" UI button triggers
cognee.forget(dataset_name). This safely clears out all experimental nodes from the LanceDB vector store and Kuzu graph without corrupting the local project setup.
DevBrain exposes your memory graph universally, supporting developers no matter what tools they use:
- MCP (Model Context Protocol) Server: Run
devbrain mcpto connect DevBrain directly to Cursor, Claude Code, or Antigravity IDE. The AI tools can actively search the graph and write their own decisions into memory. - The Context Compiler: Run
devbrain exportto compile the entire graph into a Markdown manifest. DevBrain automatically copies it to your clipboard so you can paste it into ChatGPT or Claude web.
Ensure you have Python 3.10+ and Node.js installed. Instead of just installing requirements, you can install DevBrain as a global CLI tool so it's accessible from any directory:
pip install -e .This automatically installs all dependencies and registers the devbrain command globally on your system.
Create a .env file in the project root. For absolute privacy, use the Ollama offline tier:
DEVBRAIN_MODE="local"
DEVBRAIN_LLM_PROVIDER="ollama"
DEVBRAIN_MODEL_NAME="alibayram/smollm3"
DEVBRAIN_BASE_URL="http://localhost:11434"Verify the database migrations and schema run successfully:
devbrain initOpen the interactive Next.js visual dashboard:
devbrain dashboardNext.js will automatically launch on http://localhost:3000.
During development, we encountered limitations with small context windows in offline LLMs (e.g., smollm3). We proactively patched the devbrain_core.py to intercept InstructorRetryException loops, implementing a regex-salvage mechanism that extracts valid JSON payloads directly from error logs to prevent 8-minute hallucination loops on low-spec hardware.
In compliance with the Cognee Hackathon rules, I am formally declaring the use of AI assistants in the creation of DevBrain:
- Gemini: Used for high-level project strategy, architectural brainstorming, and refining the core value proposition of decoupling memory from compute.
- Antigravity IDE: Used as the primary AI pair-programmer for hands-on development, debugging edge cases, patching backend routing logic, and generating UI layout structures.
Both tools were utilized to accelerate development while the core logic and integration with the Cognee framework were meticulously designed and verified by the developer.