When Structure Needs Meaning
Understand Anything's second job is to turn a structural graph into an explanation a person can use. This chapter examines the semantic layer: what language models add to parser output, how summaries and relationships become layers and guided tours, and how the shared schema constrains that generated material. The practical result is a way to read a graph as a set of informed hypotheses attached to source evidence—not as a collection of fluent statements that have become true merely because a model wrote them.
What a model contributes that syntax cannot
A parser can identify a function, a class, an import, or a call site. It cannot reliably answer a reader's ordinary question: “What role does this file play in the system?” Names and locations are necessary, but they do not tell a newcomer whether a module is an entry point, a shared service, a boundary adapter, or a piece of infrastructure that is important only in deployment. That is the gap the semantic analysis stage is meant to fill.
The LLM analyzer receives a file together with project context and is asked to produce a concise file summary, relevant tags, a complexity category, summaries for functions and classes, and optional language-specific notes. At the project level, it can synthesize a description, identify frameworks, and propose logical layers. These outputs are not replacements for the structural records. They are annotations on them. The file remains identified by its path; a function remains anchored by its name and line range; the summary explains why a reader might follow that node.
That distinction changes how a model's contribution should be judged. A useful summary is not the one with the most confident prose. It is the one that makes a source-backed relationship easier to interpret. “This module handles authentication state and coordinates the login path” is useful if the source and its neighboring edges support that role. A vague statement such as “This is an important utility for the application” adds little, even if it sounds plausible. The project asks for purpose and role because those are the missing dimensions between syntax and understanding.
Tags perform a similar but more compact function. They give the dashboard searchable terms for concepts that may not appear in a filename: an entry point, an API handler, a validation boundary, a hook, a factory, a test, or a deployment artifact. Complexity labels help a reader estimate how much attention a node may require. Neither is a formal metric of code quality. A complex file can be well designed; a simple file can be strategically important. These fields are navigation signals, not verdicts.
Language notes add another layer of context. A TypeScript component may use a generic type or a discriminated union. A Python module may rely on decorators or a context manager. A Rust file may make ownership or trait relationships central to its behavior. The language-lesson system detects concepts from tags, summaries, and language notes, then asks for a beginner-friendly explanation in the context of the selected component. This is different from a general language tutorial: the lesson is valuable only when it clarifies a pattern that the reader is already encountering in this project.
The semantic stage therefore has an interpretive responsibility with a constrained input. It can explain a known function; it should not invent a function that the structural extraction did not find. It can describe a likely architectural role; it should not silently rewrite the graph's file identity or turn an unresolved relationship into a confirmed edge. The structural layer gives the model a set of attachment points and a bounded neighborhood. The model supplies a reader-facing account of why those points matter.
From annotations to an architectural learning path
A collection of summaries is still not a learning system. Readers need to know which ideas are foundational, which components depend on them, and where to go after the first explanation. Understand Anything addresses that problem through layers and tours.
Layers group file-level nodes into logical responsibilities such as an API surface, services, data, user interface, utilities, configuration, tests, documentation, or infrastructure. The current architecture analysis considers directory patterns, import direction, cohesion within groups, cross-category edges, and non-code artifacts. An LLM can refine those signals into named layers with descriptions, but the assignment still has a structural basis. This is important because a layer is not merely a color on the screen. It proposes a boundary: these files belong together for the purpose of understanding the system.
The boundary is also necessarily imperfect. Real projects do not always follow a clean layered architecture. A shared utility may be imported by nearly every group. A configuration file may influence several areas. A monorepo may contain several applications that share little beyond tooling. The layer analyzer therefore has to assign every file somewhere, including documents, infrastructure, and data definitions, while accepting that a logical grouping is a useful perspective rather than a discovery of the one true architecture.
Tours add sequence to grouping. The tour builder looks for likely entry points, ranks nodes by how much they connect to the rest of the graph, follows import and call relationships outward, identifies tightly coupled clusters, and includes relevant non-code stops. It then turns those signals into steps with titles, descriptions, node references, and optional language lessons. The sequence answers a pedagogical question: if a reader has not seen this codebase before, what should they understand first so that the next area is no longer opaque?
A dependency order is not automatically a teaching order. A low-level utility may be imported early but make no sense until the reader understands the service that uses it. Conversely, a project README or entry point can explain the system's vocabulary before the reader follows a deeper edge. The tour system uses graph topology as a backbone, then adds summaries and descriptions to make the path intelligible. Its output is a recommended route, not a proof that every important concept appears in the right place.
This is where the project's central theme becomes concrete. Complexity becomes navigable when the graph gives a reader both a relationship and a reason to follow it. A layer says where a component belongs in the broad organization. A tour says why this component appears at this point in the route. A node summary says what to expect. A line range or child-symbol list gives the reader somewhere to verify the explanation. Each field reduces a different kind of uncertainty.
Validation prevents shape errors, not meaning errors
Because semantic output is generated, the project treats its shape as a system concern. The graph schema defines the allowed node and edge types, required fields, directions, weights, layers, and tour steps. Normalization handles common vocabulary differences: an LLM may call a function a method, an edge an invocation, or a document a doc; the schema can map recognized aliases to canonical forms. Complexity labels and direction values receive similar normalization.
The validator also applies bounded repairs. Missing optional collections can become empty arrays. A missing summary or complexity value can receive a default. Invalid edges whose endpoints do not exist are dropped. Duplicate or malformed records can be removed, and edge weights are constrained to their permitted range. Those operations protect the graph consumer from malformed JSON and inconsistent vocabulary. They make it possible for the dashboard to load a partially imperfect result without treating every recoverable formatting error as a total failure.
But a valid shape is not a valid interpretation. If a model writes a grammatically correct summary claiming that a component handles payments, the schema can confirm that the summary is a string and that the node has a recognized type. It cannot confirm the payment claim. If an inferred relationship points to an existing node, referential integrity can pass even when the relationship is semantically wrong. A graph can be syntactically valid, internally connected, and still teach a misleading story.
The project distinguishes these layers of confidence. Structural extraction and graph construction provide source-linked observations. Normalization and validation protect the data contract. Semantic analysis proposes meaning. Human inspection remains necessary when a conclusion matters. The dashboard's design supports that inspection by exposing source paths, line ranges, contained symbols, neighboring connections, and the original or summarized content where appropriate. A reader can move from a claim to the evidence that should bear its weight.
This distinction also explains why aliases and defaults should be modest. They repair predictable differences in representation; they should not invent missing architecture. Defaulting a missing tag to an uninformative value keeps a node renderable, but it does not make the node well understood. Dropping a dangling edge protects the graph from a reference to nowhere, but it does not recover the relationship that was intended. The system's safe behavior is to preserve what can be represented and make the loss visible when it affects integrity.
Use generated meaning as a hypothesis
The right way to use a semantic graph is neither to distrust every explanation nor to accept every one. Start with the question the reader is trying to answer. If the question is “where does this application begin?”, an entry-point label and a tour step may be a useful guide. If the question is “does this change affect authorization?”, a summary can identify candidate areas, but the reader should follow the relevant edges and inspect the source. The semantic layer helps prioritize attention; it does not remove the need for judgment.
A practical check has four parts. First, ask whether the claim is attached to the right object: a file, function, class, configuration artifact, or domain step. Second, inspect the relationship that supports it. “Calls,” “imports,” “contains,” and “documents” have different meanings, and a broad semantic related edge should not be read as a causal dependency. Third, open the source range or connected nodes when the conclusion is consequential. Finally, check whether the graph is current; a perfectly generated summary of yesterday's repository can still mislead today's investigation.
The same habit applies to layers and tours. A layer can be a useful first cut through a tangled repository, but cross-layer imports may reveal that the actual behavior spans several responsibilities. A tour can offer a sensible sequence, but it may omit dynamic behavior, unsupported files, or a component whose importance is not visible in static fan-in. The reader should treat the route as a way to choose the next piece of evidence, then adjust it when the evidence suggests a different path.
Understand Anything's semantic layer is therefore best seen as a controlled handoff. The parser supplies the nouns and edges of the map. The model supplies explanations of role, purpose, and teaching order. The schema keeps those explanations attached to recognized objects and keeps malformed output from breaking the graph. None of those steps alone equals understanding. Together they give a reader a navigable hypothesis that can be tested against the repository.
Once that hypothesis is stored, the dashboard determines whether it actually helps someone move through the system. The next chapter turns layers, tours, summaries, and source anchors into concrete interactions: overview versus detail, aggregation versus expansion, search versus focus, and a source viewer that lets the reader close the loop between what the graph says and what the code contains.
References
- README: Tree-sitter + LLM hybrid
- Tree-sitter plugin
- LLM analyzer prompts and parsing
- Shared graph types
- Graph schema and validation
- Graph builder
- Tour-builder contract
- Tour generator
- Learn panel
- Node information panel
- Project overview panel
- Graph normalization
- Understand skill: incremental validation
- Symbol retry preparation
- Symbol-loss validation notes
- Fingerprints
- Graph freshness
- Embedding search engine
- Dashboard store
- Unsupported-outcome benchmark design