Brain-Graph Memory.

The Intern uses a Brain-Graph (Memgraph) knowledge graph architecture. This is what makes agents feel like they actually know your business — tracking relationships, dependencies, and complex interactions.

Layer 1 — Workspace files

Markdown files in the workspace_files table. Loaded on every conversation via buildWorkspaceContext(). The agent always has your constitution, identity, current priorities, open threads, and recent events in context. These are the "long-term memory" that never expires.

Layer 2 — Graph extraction

After every conversation, the memory engine extracts key facts, preferences, and entities, storing them as nodes and relationships in Memgraph. This allows the agent to traverse relationships (e.g., finding all employees of a specific client).

Layer 3 — Consolidation

Periodically, the consolidation process merges extracted graph knowledge back into workspace files. High-importance, high-confidence insights get promoted to IDENTITY.md or NOW.md. This keeps workspace files current without manual updates.

Code Review Graph & MCP

For development tasks, the Brain-Graph integrates with the Code Review Graph. Agents use MCP tools (query_graph, get_impact_radius, get_affected_flows) to structurally explore the codebase rather than relying purely on text search.

Semantic retrieval

Before every response, the memory engine queries the Brain-Graph to find the most relevant nodes and relationships for the current context, injecting them into the system prompt as [SEMANTIC RECALL].