Stay updated — Join the build list for tutorials and AI insights. No spam.

Node IDs Explained

Understanding Graphify node identifiers — formats, resolution, and usage in queries.

Node IDs Explained

Understanding Graphify node identifiers — the keys to querying, explaining, and tracing your codebase.

🔑 What is a Node ID?

A Node ID is a unique identifier for any node in the Graphify knowledge graph. Every file, function, class, variable, and symbol gets a Node ID.


📋 Node ID Formats

FormatExampleResolves To
File pathscripts/dictionary/yt-to-content-v2.pyFile node
File + linescripts/dictionary/yt-to-content-v2.py:L100Symbol at line 100
Symbol namemergeParamsFunction/class by name
Qualified symbolscripts/dictionary/yt-to-content-v2.py:mergeParamsSpecific symbol in file
Class.methodConfig.loadMethod on class

🎯 Usage in Commands

graphify explain

 1# File (shows all symbols, imports, structure)
 2graphify explain scripts/dictionary/yt-to-content-v2.py
 3
 4# Specific function
 5graphify explain mergeParams
 6
 7# Qualified (disambiguates same-name functions)
 8graphify explain scripts/dictionary/yt-to-content-v2.py:mergeParams
 9
10# Line-specific
11graphify explain scripts/dictionary/yt-to-content-v2.py:L100

graphify path

1# File to file
2graphify path tasks/content.yaml scripts/dictionary/yt-to-content-v2.py
3
4# Function to file
5graphify path mergeParams scripts/dictionary/yt-to-content-v2.py
6
7# Qualified to file
8graphify path scripts/dictionary/yt-to-content-v2.py:mergeParams tasks/content.yaml

graphify query

1# Natural language (Graphify resolves internally)
2graphify query "explain the mergeParams function"
3graphify query "what does scripts/dictionary/yt-to-content-v2.py do?"

🔍 Resolution Rules

1. Exact File Path

scripts/dictionary/yt-to-content-v2.py

→ Resolves to file node if exists in graph.

2. Symbol Name (Fuzzy Match)

mergeParams

→ Finds all symbols named mergeParams. If multiple, shows all.

3. Qualified Symbol

scripts/dictionary/yt-to-content-v2.py:mergeParams

→ Exact match: symbol mergeParams in that specific file.

4. Line Reference

scripts/dictionary/yt-to-content-v2.py:L100

→ Symbol at or near line 100 in that file.


🎯 Best Practices

Use Qualified IDs for Precision

1# ❌ Ambiguous (multiple parse_args in codebase)
2graphify explain parse_args
3
4# ✅ Precise
5graphify explain scripts/dictionary/yt-to-content-v2.py:parse_args

Use File Paths for Architecture

1# ✅ Good for "how does this file work?"
2graphify explain scripts/dictionary/yt-to-content-v2.py
3
4# ✅ Good for "what's in this module?"
5graphify explain scripts/dictionary/

Use Symbol Names for Exploration

1# ✅ Good for "where is this function used?"
2graphify query "what calls mergeParams?"
3
4# ✅ Good for "show me the function"
5graphify explain mergeParams

🔍 Finding Node IDs

From Query Output

1graphify query "what calls mergeParams?"
2# Output includes: "scripts/dictionary/yt-to-content-v2.py:mergeParams"

From Explain Output

1graphify explain scripts/dictionary/yt-to-content-v2.py
2# Output lists: mergeParams (L121), parse_args (L138), etc.

From Path Output

1graphify path A B
2# Output shows intermediate node IDs

From Graph.html

  1. Open graphify-out/graph.html
  2. Search for symbol/file
  3. Click node → Node ID shown in panel

🎯 Special Node Types

TypeID PatternExample
Filepath/to/file.pyscripts/dictionary/yt-to-content-v2.py
Functionfile.py:functionscripts/dictionary/yt-to-content-v2.py:mergeParams
Classfile.py:Classscripts/dictionary/yt-to-content-v2.py:Config
Methodfile.py:Class.methodscripts/dictionary/yt-to-content-v2.py:Config.load
Variablefile.py:VARscripts/dictionary/yt-to-content-v2.py:ARGS
Importfile.py:import:modulescripts/dictionary/yt-to-content-v2.py:import:argparse

🚨 Common Issues

IssueSolution
“Node not found”Check spelling; use graphify query to find correct ID
Multiple matchesUse qualified ID: file.py:symbol
Line reference wrongLine numbers shift; use symbol name instead
Symbol not in graphRebuild: graphify update . --code-only

Next Steps