By the end of this lesson, you'll have a working knowledge graph of your DocumentDB Performance Test infrastructure and understand what the three output files are for.
After this lesson, your next Kiro CLI session on the DocumentDB project can start with /graphify and skip the discovery phase entirely.
When you point an AI assistant at a large codebase, it has two bad options: read every file (blowing the context window) or guess which files matter (missing connections). Graphify gives it a third option: read a structured map of your code's relationships — classes, functions, imports, call chains — then only read the actual files it needs.
The mechanism is tree-sitter AST parsing. It pulls structure from your code locally (nothing leaves your machine) and writes three files:
graph.json — the full graph: nodes (entities) and edges (relationships). This is what the AI queries.GRAPH_REPORT.md — a human-readable summary: key concepts, surprising connections, suggested questions to ask.graph.html — interactive visualization: click nodes, filter by type, search.Navigate to your DocumentDB project root and run:
cd ~/path/to/documentdb-perf-tests
graphify kiro install
This writes a .kiro/skills/graphify/ directory and a steering file into the project so Kiro CLI knows about the /graphify command.
kiro install is project-scoped by default. The skill lives in the repo, not globally. Other repos won't have it until you run the same command there (or use graphify install --platform kiro globally — but project-scoped is better for team repos).
From the project root:
graphify .
Or, if you want to run it from elsewhere:
graphify /absolute/path/to/project
This takes 10–60 seconds depending on codebase size. Tree-sitter parses every Python file and extracts:
# WHY: and # HACK: prefixes)After extraction, Graphify clusters related nodes into communities (groups of tightly-connected code). This is what makes the report useful — it names the clusters so you can navigate by concept, not by file.
Open the visualization:
open graphify-out/graph.html
And read the report:
cat graphify-out/GRAPH_REPORT.md
The report will show you:
Start a new Kiro CLI session in the project and type:
/graphify
The AI assistant will load graph.json as context instead of reading your entire codebase. It can then answer structural questions like:
execute_command()?"assertResult helper"BaseTestCase to the actual test runner?"The graph is a snapshot. If you add new files or refactor significantly, run graphify update . to refresh it without a full rebuild. For automatic freshness, consider graphify hook install which adds a post-commit git hook.
What does graphify update . do differently from graphify .?
Which output file does the AI assistant primarily consume during a session?
graphify kiro installgraphify .graphify-out/graph.html in your browser and explore the communitiesgraphify-out/GRAPH_REPORT.md — note which clusters it foundRead the BetterStack guide: Building a Knowledge Graph of Your Codebase for a deeper walkthrough of what tree-sitter extracts and how the clustering works.