Query Commands
FreshOverview
Once a graph exists at graphify-out/graph.json, you can query it without rebuilding. All query commands work as slash commands and direct terminal commands.
Query Types
Semantic Search
/graphify query "what handles authentication"
/graphify query "how is data validated"
/graphify query "database connection setup"Returns nodes and edges relevant to the question. The graph uses the community structure from Leiden clustering to contextualize results.
DFS Path Tracing
/graphify query "authentication flow" --dfsUses depth-first search to trace a specific path through the graph rather than returning a ranked list.
Shortest Path Between Nodes
/graphify path "UserController" "Database"
/graphify path "AuthMiddleware" "SessionStore"
/graphify path "NodeA" "NodeB"Returns the shortest connection path between two named nodes. Useful for understanding how two seemingly unrelated components interact.
Node Names
Node names are case-sensitive and must match exactly as they appear in GRAPH_REPORT.md or the graph.html visualization.
Node Explanation
/graphify explain "SwinTransformer"
/graphify explain "AuthMiddleware"
/graphify explain "ConceptName"Returns everything Graphify knows about a specific node: its relationships, community membership, confidence scores, and source files.
Understanding Query Results
flowchart LR
Q[Query String] --> S[Semantic Match]
S --> N1[Node: AuthService]
S --> N2[Node: JWTMiddleware]
S --> N3[Node: SessionStore]
N1 --> E1[EXTRACTED edge to Database]
N2 --> E2[INFERRED edge to AuthService]
N3 --> E3[AMBIGUOUS edge to RedisCache]Edge Confidence
Every result includes edge confidence:
| Edge Type | Meaning | Trust Level |
|---|---|---|
EXTRACTED | Directly found in source | High |
INFERRED | Reasonable inference from context | Medium |
AMBIGUOUS | Found but low confidence | Verify before acting |
Querying Without an Assistant
All query commands work directly from the terminal:
graphify query "authentication flow"
graphify path "UserController" "Database"
graphify explain "AuthMiddleware"This lets you explore the graph without opening your AI assistant.
Practical Query Patterns
Onboarding a New Codebase
/graphify explain "main" # Entry point
/graphify query "data flow" # How data moves
/graphify query "external deps" # Third-party integrationsDebugging
/graphify path "ErrorSource" "ErrorHandler"
/graphify query "error handling"
/graphify explain "the failing component"Architecture Review
/graphify query "database layer"
/graphify query "API boundaries"
/graphify query "authentication"Token Efficiency
Using /graphify query before asking your AI assistant a complex architecture question can reduce the tokens needed by 71x — the graph gives the assistant a precise subgraph instead of requiring it to read dozens of files.