The central data structure that Understand Anything builds to represent your codebase — its nodes, edges, layers, and guided tour.
The knowledge graph is the heart of Understand Anything. When you run /understand, a multi-agent pipeline analyzes your project and produces a single JSON file at .understand-anything/knowledge-graph.json that encodes every file, function, class, and the relationships between them.The graph is not just a static snapshot — it is a structured, schema-validated representation that powers the interactive dashboard, semantic search, guided tours, and diff analysis.
The optional languageNotes field carries a brief explanation of language-specific patterns found in the node — for example, noting that a TypeScript file uses generics, or that a Python file relies on decorators. These surface in the dashboard’s Learn panel.
Layers are architectural groupings of file nodes. They are detected by the architecture-analyzer agent and power the color-coded legend in the dashboard.
The id follows a layer:<kebab-case-name> convention (e.g., layer:api-layer). The nodeIds array contains the IDs of file-type nodes that belong to this layer.See Architectural Layers for a full explanation of how layers are detected and what common layers look like.
The tour is an ordered sequence of steps that guides a reader through the codebase from entry points to utilities. Each step focuses attention on a set of nodes.
The optional languageLesson field contains a brief explanation of a programming concept visible in the highlighted nodes — useful for onboarding developers who are new to the language or pattern.
Both files are project-specific — they live inside your project, not globally. You can safely commit .understand-anything/ to version control so teammates inherit the pre-built graph, or add it to .gitignore if you prefer to build it locally.
The graph is validated with Zod on every load. The dashboard displays an error banner if the schema check fails. You can validate a graph programmatically:
import { validateGraph } from "@understand-anything/core";const result = validateGraph(rawJson);if (!result.success) { console.error(result.errors);}