Skip to content

Graph Model

NexGraph stores code relationships in an Apache AGE property graph. Each repository gets its own named graph.

Node Labels

Folder

Represents a directory in the source tree.

PropertyTypeDescription
pathstringRelative path from repo root
namestringDirectory name

File

Represents a source file.

PropertyTypeDescription
pathstringRelative path from repo root
languagestringDetected programming language
sizenumberFile size in bytes

Function

A standalone function or arrow function.

PropertyTypeDescription
namestringFunction name
file_pathstringFile containing this function
linenumberStart line number
exportedbooleanWhether the function is exported
asyncbooleanWhether the function is async
parametersstringParameter signature

Class

A class declaration.

PropertyTypeDescription
namestringClass name
file_pathstringFile containing this class
linenumberStart line number
exportedbooleanWhether the class is exported
decoratorsstringComma-separated decorator names

Interface

An interface declaration.

PropertyTypeDescription
namestringInterface name
file_pathstringFile containing this interface
linenumberStart line number
exportedbooleanWhether the interface is exported

Method

A method within a class.

PropertyTypeDescription
namestringMethod name
class_namestringParent class name
file_pathstringFile containing this method
linenumberStart line number
visibilitystringpublic, private, or protected
staticbooleanWhether the method is static
asyncbooleanWhether the method is async

CodeElement

A catch-all for other symbols (constants, etc.).

PropertyTypeDescription
namestringElement name
kindstringSpecific kind (const, variable, etc.)
file_pathstringFile containing this element
linenumberStart line number
exportedbooleanWhether the element is exported

RouteHandler

An HTTP route handler detected via AST analysis (Express, NestJS, Flask, FastAPI, Spring, Go net/http, etc.).

PropertyTypeDescription
namestringHandler function name
http_methodstringHTTP method (GET, POST, PUT, DELETE, etc.)
url_patternstringURL path pattern
frameworkstringDetected framework (express, nestjs, flask, etc.)
file_pathstringFile containing this handler
start_linenumberStart line number

Struct

A struct declaration (Go, Rust, C#).

PropertyTypeDescription
namestringStruct name
file_pathstringFile containing this struct
linenumberStart line number
exportedbooleanWhether the struct is exported

Enum

An enum declaration.

PropertyTypeDescription
namestringEnum name
file_pathstringFile containing this enum
linenumberStart line number
exportedbooleanWhether the enum is exported

Trait

A trait or protocol declaration (Rust, Swift).

PropertyTypeDescription
namestringTrait name
file_pathstringFile containing this trait
linenumberStart line number
exportedbooleanWhether the trait is exported

TypeAlias

A type alias declaration (type X = ...).

PropertyTypeDescription
namestringType alias name
file_pathstringFile containing this type alias
linenumberStart line number
exportedbooleanWhether the type alias is exported

Namespace

A namespace or module block declaration.

PropertyTypeDescription
namestringNamespace name
file_pathstringFile containing this namespace
linenumberStart line number
exportedbooleanWhether the namespace is exported

Community

A functional cluster detected via Leiden community detection on the CALLS graph.

PropertyTypeDescription
community_idstringUnique community identifier
labelstringHeuristic label (folder name, common prefix, or fallback)
symbol_countnumberNumber of member symbols
cohesionnumberInternal edge ratio (0.0–1.0)
keywordsstringComma-separated keywords from member names

Process

A detected execution flow traced from an entry point through CALLS edges.

PropertyTypeDescription
process_idstringUnique process identifier
entry_namestringEntry point symbol name
terminal_namestringTerminal symbol name
step_countnumberNumber of steps in the flow
typestringintra_community or cross_community

Edge Labels

EdgeFromToDescription
CONTAINSFolder/FileFile/SymbolParent contains child
DEFINESFileSymbolFile defines a symbol
EXPOSESFileSymbolFile exports a symbol
IMPORTSFileFileFile imports from another file
CALLSSymbolSymbolSymbol calls another symbol
EXTENDSClassClassClass inheritance
IMPLEMENTSClassInterfaceInterface implementation
OVERRIDESMethodMethodChild method overrides parent method
HANDLESFunctionRouteHandlerFunction handles an HTTP route
MEMBER_OFSymbolCommunitySymbol belongs to a community cluster
STEP_IN_PROCESSSymbolProcessSymbol is a step in an execution flow

CALLS Edge Properties

PropertyTypeDescription
confidencenumberResolution confidence (0.0–1.0)
tiernumberResolution tier (1, 2, or 3)

STEP_IN_PROCESS Edge Properties

PropertyTypeDescription
stepnumberOrder of this step in the process (0-based)

Released under the MIT License.