Codebase memory (code graph)

Structural memory of your codebase - a native knowledge graph of symbols, imports and cross-file references, built by enigma itself.

Codebase memory gives your agents a structural map of your code: a knowledge graph of the symbols each file defines (functions, classes, interfaces, types, …), the modules it imports, and cross-file symbol references. Your agent can search it or read a project’s architecture instead of grepping and reading dozens of files.

This is structural memory of your code - complementary to Recall, which is session memory of what you did. It is off by default; everything runs locally and your code never leaves your machine.

Native, no dependencies

The engine is built into enigma - a zero-dependency TypeScript indexer. There is no external binary, no npx, no third-party package: extraction is deterministic (regex-per-language over the common languages - TS/JS, Python, Go, Rust, Java, Ruby, PHP, C#, Kotlin, C/C++). It is honest “structural-lite”, not a compiler-grade AST, but enough to map a codebase with nothing to install and nothing to fetch.

Turning the setting on exposes enigma’s code-graph tools (enigma_codegraph_index, enigma_codegraph_search, enigma_codegraph_architecture, enigma_codegraph_projects) to your agents through enigma’s own MCP server. The graph is stored per project as JSON under ~/.enigma/codegraph, so the CLI, the MCP tools and the dashboard all read the same store.

Enable it

enigma config code-graph on

Expose the code-graph tools to your agents (restart them to load), then index a project. Your agent can also index on its own via enigma_codegraph_index.

$ enigma config code-graph on
$ enigma codegraph index

You can also toggle it and index a project from the dashboard’s Code graph tab, which lists your indexed projects and each project’s architecture and graph schema.

Use it

enigma codegraph [action]

index [path] builds the graph for a project (defaults to the current directory); projects lists indexed projects; arch [project] prints the architecture overview (languages, entry points, hotspots, packages, external deps); search <name> finds symbols by name; on/off toggle the tools.

$ enigma codegraph index
$ enigma codegraph projects
$ enigma codegraph arch
$ enigma codegraph search Handler
$ enigma codegraph off

Once it’s on, your agent queries the graph directly over MCP - locating where a symbol is defined, reading a project’s shape, or listing hotspots - which typically replaces many grep/read cycles with a single structural query.

Privacy

Everything runs in-process and is stored locally under ~/.enigma/codegraph. Turning the setting off removes the tools from your agents; the dashboard reads the graph from the local store, never over the network.