Reference
Graph Model
Overview
Synapses builds a relational graph from your codebase. The graph consists of nodes (code entities) connected by edges (relationships). This graph powers context carving, impact analysis, and all code intelligence features.
Node Types
Code Entities
Type Description Example functionFunctions and procedures ValidateToken()methodStruct/class methods (s *Server) Start()structStruct definitions type Config structinterfaceInterface definitions type Handler interfacevariableVariables and constants const MaxRetries = 3fileSource files (root containers) auth.gopackageLanguage packages/modules internal/auth
Synthetic Nodes
Type Description Source routeHTTP/RPC routes Injected by route heuristic pass
Documentation Nodes
Type Description sectionMarkdown heading (ATX # through ######)
Knowledge Nodes
Type Description conceptAbstract ideas (e.g., “token bucket”, “eventual consistency”) entityReal-world entities (people, organizations, products) artifactDocuments, specs, standards (RFC 7519, GDPR Article 17) decisionArchitectural/design decisions (from ADRs)
Node Properties
ID string // Stable UUID v4
Type string // One of the types above
Name string // Entity name
Package string // Language package
File string // Absolute file path
Line int // Source line number
Exported bool // Public/exported?
StableID string // UUID preserved across renames
Provenance string // "user-authored" | "generated" | "vendored" | "external"
Domain string // "code" | "infra" | "api" | "docs" | "issues" | "knowledge"
Metadata map // Flexible attributes (churn, coverage, cpu_pct, confidence)
Edge Types
Code Edges
Type Weight Description CALLS1.0 Function calls another function DATA_FLOWS0.95 Data dependency chain (source → sink) IMPLEMENTS0.9 Type implements an interface HANDLES0.9 Route → handler function (synthetic) EMBEDS0.85 Struct embeds another struct DEPENDS_ON0.8 Package dependency IMPORTS0.7 Module/package import EXPORTS0.5 Exported symbol DEFINES0.15 File → entity containment
Documentation Edges
Type Weight Description CONTAINS0.15 Document → section containment EXPLAINS0.7 Documentation section → code entity DOCUMENTED_BY0.6 Code entity → documentation section LINKS_TO0.3 Cross-document markdown links
Cross-Domain Edges
Type Weight Description DEPLOYS0.75 Code → infrastructure resource CONSUMES0.75 Code → API endpoint/service CONFIGURED_BY0.65 Code → config resource DOCUMENTS0.65 Docs → code (broader than EXPLAINS) MENTIONS0.55 Synthetic name-match edges (0.0-1.0 confidence) MANUAL0.5 User-defined via link_entities
Knowledge Edges
Type Weight Description CONTRADICTS0.6 Conflicting information CAUSED_BY0.5 Effect → cause relationship INSTANCE_OF0.4 Specific → general type RELATES_TO0.3 Generic fallback relationship
Storage
The graph is stored in SQLite with these key tables:
nodes : All graph nodes with properties
edges : All relationships (from_id, to_id, type)
manual_edges : User-created edges via link_entities
edge_learned_weights : Weight adjustments from agent feedback
call_sites : Unresolved call sites for deferred resolution
node_embeddings : Vector embeddings for semantic search
nodes_fts : FTS5 full-text search index
The graph is also kept in memory for fast traversal, with an optional FlatGraph (SoA layout) for cache-friendly PPR computation.
Previous CLI ReferenceNext Language Parsers