Symbol & node types
The graph is built from typed nodes joined by typed edges. This page is
the reference for every type raph emits and the properties code symbols carry.
Source links point at the indexer on the feat/major-revamp branch.
Node types
Section titled “Node types”type |
Domain | What it is | Produced by |
|---|---|---|---|
file |
code / documentation | One indexed file. | indexFile |
func |
code | A function or method. Go methods are receiver-qualified (e.g. (Indexer) Run). |
indexGoFile, indexTreeSitterFile |
type |
code | A class, struct, enum, trait, interface, or type alias. | same as func |
var |
code | A package-level / top-level variable. Indexed per name. | indexGoFile, tree-sitter globals pass |
const |
code | A package-level / top-level constant. Indexed per name. | same as var |
markdown_chunk |
documentation | A heading-delimited section of a Markdown/text file. | indexDocumentSections |
file_chunk |
code / documentation | A fixed-size chunk of a file with no language parser. | indexFallbackChunks |
Memory records, rules, local documents, and crawled web pages are also nodes,
produced by their own subsystems (internal/memory, internal/knowledge,
internal/crawler).
The variable kinds
Section titled “The variable kinds”var and const are the headline addition. Package-level globals are exactly
what an agent tends to guess at, so each declared name becomes its own node
rather than being folded into the file. For Go this comes from the
*ast.ValueSpec branch of
indexGoFile;
for tree-sitter languages it comes from the
globals pass in indexTreeSitterFile,
driven by each language’s globals set in
langSpecs.
Code-symbol properties
Section titled “Code-symbol properties”Every node carries a JSON properties map. Code symbols set:
| Property | Values | Meaning | Set in |
|---|---|---|---|
global |
"true" |
The symbol is a package-/module-level declaration. | Go · tree-sitter |
decl |
"var" | "const" |
Which keyword declared it. | same |
lang |
grammar name (python, typescript, rust, …) |
Source language, on tree-sitter symbols only (Go symbols omit it). | tree-sitter |
Edge types
Section titled “Edge types”type |
Meaning | Produced by |
|---|---|---|
DECLARES |
A file declares a symbol; a parent owns a chunk’s sibling. | saveSymbol |
USES |
An owning symbol references another symbol. | resolution tiers (below) |
MUTATES |
A reference that writes a variable (supersedes USES). |
go/types, SCIP |
HAS_SECTION |
A document file owns a Markdown section. | indexDocumentSections |
HAS_CHUNK |
A file owns a fallback chunk. | indexFallbackChunks |
RELATES_TO |
A memory/note relates to a node. | internal/knowledge |
HAS_PAGE / LINKS_TO |
Web corpus structure and inter-page links. | internal/crawler |
USES and MUTATES are the cross-file reference edges produced by the
resolution tiers — the higher the tier available for a
language, the more accurate they are.