kirograph 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +332 -93
  2. package/dist/bin/commands/caveman.js +19 -2
  3. package/dist/bin/commands/caveman.js.map +2 -2
  4. package/dist/bin/commands/compression.js +109 -0
  5. package/dist/bin/commands/compression.js.map +7 -0
  6. package/dist/bin/commands/context.js +31 -24
  7. package/dist/bin/commands/context.js.map +2 -2
  8. package/dist/bin/commands/exec.js +107 -0
  9. package/dist/bin/commands/exec.js.map +7 -0
  10. package/dist/bin/commands/gain.js +119 -0
  11. package/dist/bin/commands/gain.js.map +7 -0
  12. package/dist/bin/commands/help.js +16 -5
  13. package/dist/bin/commands/help.js.map +2 -2
  14. package/dist/bin/commands/install.js +8 -2
  15. package/dist/bin/commands/install.js.map +2 -2
  16. package/dist/bin/commands/query.js +5 -1
  17. package/dist/bin/commands/query.js.map +2 -2
  18. package/dist/bin/commands/serve.js +2 -2
  19. package/dist/bin/commands/serve.js.map +2 -2
  20. package/dist/bin/commands/uninit.js +65 -41
  21. package/dist/bin/commands/uninit.js.map +2 -2
  22. package/dist/bin/commands/utils.js +16 -0
  23. package/dist/bin/commands/utils.js.map +2 -2
  24. package/dist/bin/installer/cli-agent.js +5 -25
  25. package/dist/bin/installer/cli-agent.js.map +2 -2
  26. package/dist/bin/installer/common.js +154 -0
  27. package/dist/bin/installer/common.js.map +7 -0
  28. package/dist/bin/installer/config-prompt.js +9 -2
  29. package/dist/bin/installer/config-prompt.js.map +2 -2
  30. package/dist/bin/installer/hooks.js +19 -1
  31. package/dist/bin/installer/hooks.js.map +2 -2
  32. package/dist/bin/installer/index.js +104 -86
  33. package/dist/bin/installer/index.js.map +2 -2
  34. package/dist/bin/installer/instructions.js +60 -0
  35. package/dist/bin/installer/instructions.js.map +7 -0
  36. package/dist/bin/installer/mcp.js +6 -36
  37. package/dist/bin/installer/mcp.js.map +2 -2
  38. package/dist/bin/installer/steering.js +116 -40
  39. package/dist/bin/installer/steering.js.map +2 -2
  40. package/dist/bin/installer/targets/claude.js +79 -0
  41. package/dist/bin/installer/targets/claude.js.map +7 -0
  42. package/dist/bin/installer/targets/codex.js +77 -0
  43. package/dist/bin/installer/targets/codex.js.map +7 -0
  44. package/dist/bin/installer/targets/index.js +57 -0
  45. package/dist/bin/installer/targets/index.js.map +7 -0
  46. package/dist/bin/installer/targets/kiro.js +63 -0
  47. package/dist/bin/installer/targets/kiro.js.map +7 -0
  48. package/dist/bin/kirograph.js +7 -1
  49. package/dist/bin/kirograph.js.map +3 -3
  50. package/dist/compression/filters/aws.js +418 -0
  51. package/dist/compression/filters/aws.js.map +7 -0
  52. package/dist/compression/filters/docker.js +153 -0
  53. package/dist/compression/filters/docker.js.map +7 -0
  54. package/dist/compression/filters/files.js +150 -0
  55. package/dist/compression/filters/files.js.map +7 -0
  56. package/dist/compression/filters/generic.js +86 -0
  57. package/dist/compression/filters/generic.js.map +7 -0
  58. package/dist/compression/filters/git.js +272 -0
  59. package/dist/compression/filters/git.js.map +7 -0
  60. package/dist/compression/filters/github.js +137 -0
  61. package/dist/compression/filters/github.js.map +7 -0
  62. package/dist/compression/filters/lint.js +280 -0
  63. package/dist/compression/filters/lint.js.map +7 -0
  64. package/dist/compression/filters/misc.js +212 -0
  65. package/dist/compression/filters/misc.js.map +7 -0
  66. package/dist/compression/filters/package.js +151 -0
  67. package/dist/compression/filters/package.js.map +7 -0
  68. package/dist/compression/filters/test.js +266 -0
  69. package/dist/compression/filters/test.js.map +7 -0
  70. package/dist/compression/index.js +144 -0
  71. package/dist/compression/index.js.map +7 -0
  72. package/dist/compression/naive-cost.js +94 -0
  73. package/dist/compression/naive-cost.js.map +7 -0
  74. package/dist/compression/tracker.js +228 -0
  75. package/dist/compression/tracker.js.map +7 -0
  76. package/dist/compression/types.js +17 -0
  77. package/dist/compression/types.js.map +7 -0
  78. package/dist/config.js +18 -1
  79. package/dist/config.js.map +2 -2
  80. package/dist/mcp/tool-names.js +50 -0
  81. package/dist/mcp/tool-names.js.map +7 -0
  82. package/dist/mcp/tools.js +173 -4
  83. package/dist/mcp/tools.js.map +3 -3
  84. package/package.json +2 -2
package/README.md CHANGED
@@ -8,11 +8,13 @@ Semantic code knowledge graph for [Kiro](https://kiro.dev): fewer tool calls, in
8
8
 
9
9
  Inspired by [CodeGraph](https://github.com/colbymchenry/codegraph) by [colbymchenry](https://github.com/colbymchenry) for Claude Code, rebuilt natively for Kiro's MCP and hooks system.
10
10
 
11
+ > **Full support is for Kiro only.** Experimental integrations for other MCP-capable tools (Claude Code, Codex) are available but not fully tested. See [Other Tools (Experimental)](#other-tools-experimental) for details.
12
+
11
13
  ## Why KiroGraph?
12
14
 
13
15
  When you ask Kiro to work on a complex task, it explores your codebase using file reads, grep, and glob searches. Every one of those is a tool call, and tool calls consume context and slow things down.
14
16
 
15
- KiroGraph gives Kiro a semantic knowledge graph that's pre-indexed and always up to date. Instead of scanning files to understand your code, Kiro queries the graph instantly: symbol relationships, call graphs, type hierarchies, impact radius all in a single MCP tool call.
17
+ KiroGraph gives Kiro a semantic knowledge graph that's pre-indexed and always up to date. Instead of scanning files to understand your code, Kiro queries the graph instantly: symbol relationships, call graphs, type hierarchies, impact radius, all in a single MCP tool call.
16
18
 
17
19
  The result is fewer tool calls, less context used, and faster responses on complex tasks.
18
20
 
@@ -20,12 +22,12 @@ The result is fewer tool calls, less context used, and faster responses on compl
20
22
 
21
23
  KiroGraph uses [tree-sitter](https://tree-sitter.github.io/tree-sitter/) to parse your source files into an AST and extract:
22
24
 
23
- - **Nodes** functions, methods, classes, interfaces, types, enums, variables, constants, routes, components, and more (24 node kinds total)
24
- - **Edges** calls, imports, exports, extends, implements, contains, references, instantiates, overrides, decorates, type_of, returns
25
+ - **Nodes**: functions, methods, classes, interfaces, types, enums, variables, constants, routes, components, and more (24 node kinds total)
26
+ - **Edges**: calls, imports, exports, extends, implements, contains, references, instantiates, overrides, decorates, type_of, returns
25
27
 
26
28
  Everything is stored in a local SQLite database (`.kirograph/kirograph.db`). **Nothing leaves your machine.** No API keys. No external services.
27
29
 
28
- The index is kept fresh automatically via Kiro hooks no background watcher process needed.
30
+ The index is kept fresh automatically via Kiro hooks when using the Kiro integration; no background watcher process needed.
29
31
 
30
32
  ## How Indexing Works
31
33
 
@@ -53,7 +55,7 @@ These embeddings power natural-language search in `kirograph_context` and act as
53
55
  | `qdrant` | `.kirograph/qdrant/` | ANN (HNSW), sub-linear | `qdrant-local` (embedded binary) |
54
56
  | `typesense` | `.kirograph/typesense/` | ANN (HNSW), sub-linear | `typesense` (auto-downloaded binary) |
55
57
 
56
- Each engine owns its embedding store exclusively nothing is written to the SQLite `vectors` table when a non-cosine engine is active. If an engine's optional dependency is not installed, KiroGraph silently falls back to `cosine`.
58
+ Each engine owns its embedding store exclusively; nothing is written to the SQLite `vectors` table when a non-cosine engine is active. If an engine's optional dependency is not installed, KiroGraph silently falls back to `cosine`.
57
59
 
58
60
  Enable and configure via `kirograph install` (interactive arrow-key menu) or directly in `.kirograph/config.json`:
59
61
 
@@ -66,7 +68,7 @@ Enable and configure via `kirograph install` (interactive arrow-key menu) or dir
66
68
 
67
69
  ### Architecture analysis (opt-in)
68
70
 
69
- When `enableArchitecture: true` is set, KiroGraph detects the high-level structure of your project packages and architectural layers and computes coupling metrics between them. Results are stored in `arch_*` tables inside `kirograph.db` and exposed via dedicated MCP tools and CLI commands.
71
+ When `enableArchitecture: true` is set, KiroGraph detects the high-level structure of your project (packages and architectural layers) and computes coupling metrics between them. Results are stored in `arch_*` tables inside `kirograph.db` and exposed via dedicated MCP tools and CLI commands.
70
72
 
71
73
  Enable via `kirograph install` or directly in `.kirograph/config.json`:
72
74
 
@@ -109,15 +111,20 @@ kirograph --version
109
111
  ### Remove from a project
110
112
 
111
113
  ```bash
112
- kirograph uninit [path] # Remove .kirograph/, hooks, and steering file from the project
113
- kirograph uninit --force # Skip confirmation prompt
114
+ kirograph uninit [path] # Prompts to remove Kiro integration files and .kirograph/ data separately
115
+ kirograph uninit --force # Remove Kiro integration files + .kirograph/ data without confirmation
116
+ kirograph uninit --target all --force # Remove all integration files (Kiro + Claude + Codex) + .kirograph/ data
114
117
  ```
115
118
 
116
- This removes:
117
- - `.kirograph/` — index database, snapshots, and export directory
118
- - `.kiro/hooks/kirograph-*.json` all KiroGraph hooks
119
- - `.kiro/steering/kirograph.md` — the steering file
120
- - `.kiro/agents/kirograph.json` — the CLI agent config
119
+ `kirograph uninstall` is an alias for `kirograph uninit`.
120
+
121
+ Without `--force`, KiroGraph asks separately whether to remove the selected tool integration files and whether to remove the shared `.kirograph/` data. With `--force`, both are removed unconditionally.
122
+
123
+ This can remove:
124
+ - `.kirograph/`: index database, snapshots, and export directory
125
+ - Kiro target: `.kiro/hooks/kirograph-*.json`, `.kiro/steering/kirograph.md`, `.kiro/agents/kirograph.json`
126
+ - Claude target (experimental): `kirograph` from `.mcp.json`, plus the KiroGraph import from `CLAUDE.md`
127
+ - Codex target (experimental): the generated KiroGraph block from `AGENTS.md`
121
128
 
122
129
  ### Remove the CLI globally
123
130
 
@@ -138,10 +145,10 @@ npm uninstall -g .
138
145
 
139
146
  ```bash
140
147
  # In your project:
141
- kirograph install # wire up MCP + hooks + steering + CLI agent in .kiro/
148
+ kirograph install # wire up Kiro MCP + hooks + steering + CLI agent
142
149
  ```
143
150
 
144
- Restart Kiro IDE, or switch to the `kirograph` agent in Kiro CLI. It will now use KiroGraph tools automatically.
151
+ All Kiro integration files are written to `.kiro/`. Restart Kiro IDE, or switch to the `kirograph` agent in Kiro CLI. It will now use KiroGraph tools automatically.
145
152
 
146
153
  Or using the short alias:
147
154
 
@@ -172,11 +179,11 @@ kg install
172
179
  └───────────────────────────────────────────┘
173
180
  ```
174
181
 
175
- Kiro hooks mark the index dirty on every file save or create, then flush on agent idle batching changes efficiently with no overhead during active editing.
182
+ Kiro hooks mark the index dirty on every file save or create, then flush on agent idle, batching changes efficiently with no overhead during active editing.
176
183
 
177
184
  ## Using with Kiro
178
185
 
179
- `kirograph install` sets up four things in your Kiro workspace all coexist, so you can switch between IDE and CLI freely:
186
+ `kirograph install` or `kirograph install --target kiro` sets up four things in your Kiro workspace (all coexist, so you can switch between IDE and CLI freely):
180
187
 
181
188
  ### MCP Server (`.kiro/settings/mcp.json`)
182
189
 
@@ -193,7 +200,8 @@ Registers the KiroGraph MCP server. Used by both the IDE and the CLI agent:
193
200
  "kirograph_callees", "kirograph_impact", "kirograph_node",
194
201
  "kirograph_status", "kirograph_files", "kirograph_dead_code",
195
202
  "kirograph_circular_deps", "kirograph_path", "kirograph_type_hierarchy",
196
- "kirograph_architecture", "kirograph_coupling", "kirograph_package"
203
+ "kirograph_architecture", "kirograph_coupling", "kirograph_package",
204
+ "kirograph_hotspots", "kirograph_surprising", "kirograph_diff"
197
205
  ]
198
206
  }
199
207
  }
@@ -221,9 +229,9 @@ A custom agent for Kiro CLI that wires up the MCP server, inlines the steering i
221
229
 
222
230
  | Hook | Event | Action |
223
231
  |------|-------|--------|
224
- | `agentSpawn` | Agent starts | `kirograph sync-if-dirty --quiet` catches edits made between sessions |
225
- | `userPromptSubmit` | Each prompt | `kirograph sync-if-dirty --quiet` keeps graph fresh within a session |
226
- | `stop` | End of each turn | `kirograph sync-if-dirty --quiet` deferred flush, mirrors IDE `agentStop` |
232
+ | `agentSpawn` | Agent starts | `kirograph sync-if-dirty --quiet` (catches edits made between sessions) |
233
+ | `userPromptSubmit` | Each prompt | `kirograph sync-if-dirty --quiet` (keeps graph fresh within a session) |
234
+ | `stop` | End of each turn | `kirograph sync-if-dirty --quiet` (deferred flush, mirrors IDE `agentStop`) |
227
235
 
228
236
  Use it with:
229
237
 
@@ -243,13 +251,51 @@ Or swap to it inside an active session:
243
251
 
244
252
  Teaches the Kiro IDE to prefer graph tools over file scanning when `.kirograph/` exists. The CLI agent has the same instructions inlined directly in its `prompt` field.
245
253
 
254
+ ## Other Tools (Experimental)
255
+
256
+ > **⚠️ Not fully tested, community-contributed.** The integrations below are outside the original scope of KiroGraph. They are provided as-is. Issues and PRs related to these targets are welcome, but there is no guarantee they will be supported or merged without active help from the contributor.
257
+
258
+ KiroGraph can also be installed for other MCP-capable coding agents. All targets share the same `.kirograph/` data; if the project is already initialized, installing another target only writes that tool's integration files and reuses the existing graph.
259
+
260
+ ```bash
261
+ kirograph install --target claude # wire up Claude Code MCP + project memory
262
+ kirograph install --target codex # write Codex instructions and print MCP config
263
+ ```
264
+
265
+ ### Using with Claude Code
266
+
267
+ ```bash
268
+ kirograph install --target claude
269
+ ```
270
+
271
+ This writes:
272
+
273
+ - `.mcp.json`: project-scoped MCP server config for Claude Code
274
+ - `.kirograph/claude.md`: KiroGraph tool guidance
275
+ - `CLAUDE.md`: an import of `.kirograph/claude.md`
276
+
277
+ Claude Code prompts for project MCP approval the first time it sees `.mcp.json`.
278
+
279
+ ### Using with Codex
280
+
281
+ ```bash
282
+ kirograph install --target codex
283
+ ```
284
+
285
+ This writes:
286
+
287
+ - `.kirograph/codex.md`: KiroGraph tool guidance
288
+ - `AGENTS.md`: a generated KiroGraph instruction block
289
+
290
+ Codex MCP configuration is user-scoped, so the installer prints the exact `codex mcp add ...` command and equivalent `~/.codex/config.toml` snippet instead of editing files outside the project.
291
+
246
292
  ## MCP Tools
247
293
 
248
- All tools are auto-approved and available to Kiro once installed.
294
+ All tools are auto-approved in Kiro once installed. Other MCP clients can use the same tools after configuring their respective targets.
249
295
 
250
296
  ### `kirograph_context`
251
297
 
252
- Comprehensive context for a task or feature often sufficient alone without additional tool calls.
298
+ Comprehensive context for a task or feature, often sufficient alone without additional tool calls.
253
299
 
254
300
  | Parameter | Type | Default | Description |
255
301
  |-----------|------|---------|-------------|
@@ -267,7 +313,7 @@ Quick symbol search by name. Returns locations only, no code.
267
313
  | Parameter | Type | Default | Description |
268
314
  |-----------|------|---------|-------------|
269
315
  | `query` | string | required | Symbol name or partial name |
270
- | `kind` | string | | Filter: `function`, `method`, `class`, `interface`, `type_alias`, `variable`, `route`, `component` |
316
+ | `kind` | string | - | Filter: `function`, `method`, `class`, `interface`, `type_alias`, `variable`, `route`, `component` |
271
317
  | `limit` | number | 10 | Max results (1–100) |
272
318
  | `projectPath` | string | cwd | Project root path |
273
319
 
@@ -283,7 +329,7 @@ Find all functions/methods that call a specific symbol.
283
329
  | `limit` | number | 20 | Max results (1–100) |
284
330
  | `projectPath` | string | cwd | Project root path |
285
331
 
286
- **How it works:** BFS traversal of incoming `call` edges in the graph database. No vector engine involved.
332
+ **How it works:** BFS traversal of incoming `call` edges in the graph database; no vector engine involved.
287
333
 
288
334
  ### `kirograph_callees`
289
335
 
@@ -295,7 +341,7 @@ Find all functions/methods that a specific symbol calls.
295
341
  | `limit` | number | 20 | Max results (1–100) |
296
342
  | `projectPath` | string | cwd | Project root path |
297
343
 
298
- **How it works:** BFS traversal of outgoing `call` edges in the graph database. No vector engine involved.
344
+ **How it works:** BFS traversal of outgoing `call` edges in the graph database; no vector engine involved.
299
345
 
300
346
  ### `kirograph_impact`
301
347
 
@@ -307,7 +353,7 @@ Analyze what code would be affected by changing a symbol. Use before making chan
307
353
  | `depth` | number | 2 | Traversal depth |
308
354
  | `projectPath` | string | cwd | Project root path |
309
355
 
310
- **How it works:** BFS traversal of all incoming edges (`call`, `import`, `reference`, etc.) up to the specified depth. No vector engine involved.
356
+ **How it works:** BFS traversal of all incoming edges (`call`, `import`, `reference`, etc.) up to the specified depth; no vector engine involved.
311
357
 
312
358
  ### `kirograph_node`
313
359
 
@@ -321,7 +367,7 @@ Get details about a specific symbol, optionally including source code.
321
367
 
322
368
  Returns: kind, name, qualified name, file location, signature, docstring, and optionally source code.
323
369
 
324
- **How it works:** Single row lookup by symbol name in the graph database. If `includeCode` is true, reads the relevant lines directly from the source file on disk. No vector engine involved.
370
+ **How it works:** Single row lookup by symbol name in the graph database. If `includeCode` is true, reads the relevant lines directly from the source file on disk; no vector engine involved.
325
371
 
326
372
  ### `kirograph_type_hierarchy`
327
373
 
@@ -333,7 +379,7 @@ Traverse the type hierarchy of a class or interface.
333
379
  | `direction` | string | `both` | `up` (base types), `down` (derived types), `both` |
334
380
  | `projectPath` | string | cwd | Project root path |
335
381
 
336
- **How it works:** Recursive traversal of `extends` and `implements` edges in the graph database. No vector engine involved.
382
+ **How it works:** Recursive traversal of `extends` and `implements` edges in the graph database; no vector engine involved.
337
383
 
338
384
  ### `kirograph_path`
339
385
 
@@ -345,7 +391,7 @@ Find the shortest path between two symbols in the dependency graph.
345
391
  | `to` | string | required | Target symbol name |
346
392
  | `projectPath` | string | cwd | Project root path |
347
393
 
348
- **How it works:** BFS shortest-path search across all edge types in the graph database. No vector engine involved.
394
+ **How it works:** BFS shortest-path search across all edge types in the graph database; no vector engine involved.
349
395
 
350
396
  ### `kirograph_dead_code`
351
397
 
@@ -356,7 +402,7 @@ Find symbols with no incoming references (potential dead code). Only unexported
356
402
  | `limit` | number | 50 | Max results (1–100) |
357
403
  | `projectPath` | string | cwd | Project root path |
358
404
 
359
- **How it works:** Queries the graph database for nodes with zero incoming edges, filtered to non-exported symbols. No vector engine involved.
405
+ **How it works:** Queries the graph database for nodes with zero incoming edges, filtered to non-exported symbols; no vector engine involved.
360
406
 
361
407
  ### `kirograph_circular_deps`
362
408
 
@@ -366,7 +412,7 @@ Find circular import dependencies in the codebase.
366
412
  |-----------|------|---------|-------------|
367
413
  | `projectPath` | string | cwd | Project root path |
368
414
 
369
- **How it works:** Tarjan's strongly connected components algorithm over `import` edges in the graph database. No vector engine involved.
415
+ **How it works:** Tarjan's strongly connected components algorithm over `import` edges in the graph database; no vector engine involved.
370
416
 
371
417
  ### `kirograph_files`
372
418
 
@@ -374,14 +420,14 @@ List the indexed file structure with filtering and format options.
374
420
 
375
421
  | Parameter | Type | Default | Description |
376
422
  |-----------|------|---------|-------------|
377
- | `filterPath` | string | | Filter by directory prefix (e.g., `src/`) |
378
- | `pattern` | string | | Filter by glob pattern (e.g., `**/*.ts`) |
379
- | `maxDepth` | number | | Limit tree depth |
423
+ | `filterPath` | string | - | Filter by directory prefix (e.g., `src/`) |
424
+ | `pattern` | string | - | Filter by glob pattern (e.g., `**/*.ts`) |
425
+ | `maxDepth` | number | - | Limit tree depth |
380
426
  | `format` | string | `tree` | `tree`, `flat`, or `grouped` |
381
427
  | `includeMetadata` | boolean | true | Include language and symbol counts |
382
428
  | `projectPath` | string | cwd | Project root path |
383
429
 
384
- **How it works:** Reads file records from the graph database and builds a tree structure in memory. Filtering is applied before tree construction. No vector engine involved.
430
+ **How it works:** Reads file records from the graph database and builds a tree structure in memory. Filtering is applied before tree construction; no vector engine involved.
385
431
 
386
432
  ### `kirograph_status`
387
433
 
@@ -411,10 +457,10 @@ Get coupling metrics for all packages or a specific one.
411
457
 
412
458
  | Parameter | Type | Default | Description |
413
459
  |-----------|------|---------|-------------|
414
- | `packageId` | string | | Package ID (e.g. `pkg:npm:src/auth`). Omit for all packages. |
460
+ | `packageId` | string | - | Package ID (e.g. `pkg:npm:src/auth`). Omit for all packages. |
415
461
  | `projectPath` | string | cwd | Project root path |
416
462
 
417
- Returns per-package: **Ca** (afferent how many other packages depend on this one), **Ce** (efferent how many packages this one depends on), and **instability** (`Ce / (Ca + Ce)`, 0 = maximally stable, 1 = maximally unstable). When `packageId` is given, also returns the full list of incoming and outgoing package dependencies.
463
+ Returns per-package: **Ca** (afferent: how many other packages depend on this one), **Ce** (efferent: how many packages this one depends on), and **instability** (`Ce / (Ca + Ce)`, 0 = maximally stable, 1 = maximally unstable). When `packageId` is given, also returns the full list of incoming and outgoing package dependencies.
418
464
 
419
465
  ### `kirograph_package` *(requires `enableArchitecture: true`)*
420
466
 
@@ -447,7 +493,7 @@ Find non-obvious cross-file connections: direct edges between symbols in structu
447
493
  | `limit` | number | 20 | Max results (1–100) |
448
494
  | `projectPath` | string | cwd | Project root path |
449
495
 
450
- **How it works:** Queries all cross-file edges (excluding `contains` and `import`). Scores each by path distance between source and target files × edge-kind weight (`calls=1.0`, `references=0.8`, `type_of=0.7`, etc.). Returns the highest-scoring unique pairs the ones that represent the most unexpected coupling in the codebase.
496
+ **How it works:** Queries all cross-file edges (excluding `contains` and `import`). Scores each by path distance between source and target files × edge-kind weight (`calls=1.0`, `references=0.8`, `type_of=0.7`, etc.). Returns the highest-scoring unique pairs. the ones that represent the most unexpected coupling in the codebase.
451
497
 
452
498
  ### `kirograph_diff`
453
499
 
@@ -460,6 +506,31 @@ Compare the current graph state against a saved snapshot. Shows added/removed sy
460
506
 
461
507
  Use `kirograph snapshot save` (CLI) to save a snapshot before a refactor or PR. Run `kirograph_diff` after to see what changed structurally.
462
508
 
509
+ ### `kirograph_exec`
510
+
511
+ Run a shell command and return token-optimized output. Automatically filters noise from git, test runners, linters, build tools, docker, and package managers.
512
+
513
+ | Parameter | Type | Default | Description |
514
+ |-----------|------|---------|-------------|
515
+ | `command` | string | required | Shell command to execute |
516
+ | `cwd` | string | project root | Working directory |
517
+ | `level` | string | `normal` | Compression level: `normal`, `aggressive`, `ultra` |
518
+ | `timeout` | number | 60 | Timeout in seconds |
519
+ | `projectPath` | string | cwd | Project root path |
520
+
521
+ **How it works:** Executes the command, detects the command family (git, test, lint, etc.), applies the appropriate filter strategy, and returns compressed output with a savings footer. Error output is always preserved. Does not require KiroGraph to be initialized, works standalone.
522
+
523
+ ### `kirograph_gain`
524
+
525
+ Show token savings statistics from compressed command outputs.
526
+
527
+ | Parameter | Type | Default | Description |
528
+ |-----------|------|---------|-------------|
529
+ | `period` | string | `session` | Time period: `session`, `today`, `week`, `all` |
530
+ | `projectPath` | string | cwd | Project root path |
531
+
532
+ Returns total commands, original/compressed token counts, savings percentage, breakdown by command family, and recent command history.
533
+
463
534
  ## CLI Reference
464
535
 
465
536
  ### Setup
@@ -468,8 +539,8 @@ Use `kirograph snapshot save` (CLI) to save a snapshot before a refactor or PR.
468
539
  kirograph install # Wire up MCP + hooks + steering in .kiro/
469
540
  kirograph init [path] # Initialize .kirograph/ in a project
470
541
  kirograph init --index # Initialize and index immediately
471
- kirograph uninit [path] # Remove .kirograph/, hooks, and steering file
472
- kirograph uninit --force # Skip confirmation prompt
542
+ kirograph uninit [path] # Prompts to remove integration files and .kirograph/ data
543
+ kirograph uninit --force # Remove everything without confirmation
473
544
  ```
474
545
 
475
546
  ### Indexing
@@ -526,7 +597,7 @@ Extracts symbol tokens from the task description (CamelCase, snake_case, SCREAMI
526
597
 
527
598
  ### Affected Tests
528
599
 
529
- Find test files that depend on changed source files useful in CI or pre-commit hooks.
600
+ Find test files that depend on changed source files, useful in CI or pre-commit hooks.
530
601
 
531
602
  ```bash
532
603
  kirograph affected src/utils.ts src/api.ts # Pass files as arguments
@@ -561,7 +632,7 @@ fi
561
632
 
562
633
  Caveman mode compresses the agent's communication style, cutting token usage on responses without affecting tool calls or code output. Inspired by [caveman](https://github.com/JuliusBrussee/caveman) 🪨 by [JuliusBrussee](https://github.com/JuliusBrussee).
563
634
 
564
- **Why it's useful:** KiroGraph's graph tools return compact, structured data. The bottleneck in long coding sessions isn't the tool calls it's the verbose prose the agent wraps around them. Caveman mode strips that overhead so you get the signal without the filler. The rules are injected at session start via the steering file (IDE) and the inline agent prompt (kiro-cli), so they're always in context with no extra tool calls.
635
+ **Why it's useful:** KiroGraph's graph tools return compact, structured data. The bottleneck in long coding sessions isn't the tool calls; it is the verbose prose the agent wraps around them. Caveman mode strips that overhead so you get the signal without the filler. The rules are injected at session start via the steering file (IDE) and the inline agent prompt (kiro-cli), so they're always in context with no extra tool calls.
565
636
 
566
637
  Four levels:
567
638
 
@@ -582,10 +653,167 @@ kirograph caveman # show current mode
582
653
 
583
654
  Set during `kirograph install` (interactive arrow-key menu) or any time after. Takes effect on the next agent session.
584
655
 
585
- Caveman mode never touches code blocks, file paths, URLs, or technical terms only prose.
656
+ Caveman mode never touches code blocks, file paths, URLs, or technical terms, only prose.
586
657
 
587
658
  **Auto-clarity exceptions:** the agent temporarily reverts to normal prose for security warnings, confirmations of irreversible actions (delete, overwrite, force-push), and multi-step sequences where fragment order could cause misunderstanding. Compressed style resumes immediately after.
588
659
 
660
+ ### Shell Compression (`kirograph_exec`)
661
+
662
+ KiroGraph includes a built-in shell compression engine inspired by [rtk](https://github.com/rtk-ai/rtk). The `kirograph_exec` MCP tool runs shell commands and returns token-optimized output, saving 60-90% of tokens on verbose commands like git, test runners, linters, and build tools.
663
+
664
+ **Why it's useful:** LLM context is expensive. A raw `git status` might be 2,000 tokens; compressed it's 200. A passing test suite might be 25,000 tokens of noise; compressed it's a single "PASSED: 42/42 tests" line. The compression engine knows how to extract the signal from each command family.
665
+
666
+ Supported command families:
667
+
668
+ | Family | Commands | Typical savings |
669
+ |--------|----------|----------------|
670
+ | Git | status, log, diff, push, pull, commit, add, fetch, branch, stash | 75-96% |
671
+ | GitHub CLI | gh pr list/view, gh issue list, gh run list/view | 60-80% |
672
+ | Test runners | jest, vitest, pytest, cargo test, go test, rspec, minitest, playwright | 80-90% |
673
+ | Linters/build | eslint, tsc, ruff, clippy, cargo build, prettier, biome, golangci-lint, rubocop, next build | 70-85% |
674
+ | File listings | ls, find, tree | 60-80% |
675
+ | Search | grep, rg/ripgrep (grouped by file) | 60-80% |
676
+ | Diff | diff file1 file2 (condensed context) | 50-70% |
677
+ | Docker/k8s | docker ps, images, logs, compose ps, kubectl pods, logs, services | 70-80% |
678
+ | Package managers | npm/pnpm install/list, pip list/install/outdated, bundle install/list, prisma generate | 75-92% |
679
+ | AWS | sts, ec2, lambda, logs, cloudformation, dynamodb, iam, s3, ecs, sqs, sns | 60-88% |
680
+ | Network | curl (strip progress/headers), wget (strip progress bars) | 50-70% |
681
+
682
+ **Supported commands (full list):**
683
+
684
+ ```
685
+ # Git
686
+ kirograph exec git status # Compact status
687
+ kirograph exec git log -n 10 # One-line commits
688
+ kirograph exec git diff # Condensed diff
689
+ kirograph exec git add . # → "ok"
690
+ kirograph exec git commit -m "msg" # → "ok abc1234"
691
+ kirograph exec git push # → "ok main → origin/main"
692
+ kirograph exec git pull # → "ok 3 files +10 -2"
693
+
694
+ # GitHub CLI
695
+ kirograph exec gh pr list # Compact PR listing
696
+ kirograph exec gh pr view 42 # PR details + checks
697
+ kirograph exec gh issue list # Compact issue listing
698
+ kirograph exec gh run list # Workflow run status
699
+
700
+ # Test Runners
701
+ kirograph exec jest # Failures only
702
+ kirograph exec vitest run # Failures only
703
+ kirograph exec playwright test # E2E results (failures only)
704
+ kirograph exec pytest # Python tests (-90%)
705
+ kirograph exec go test ./... # Go tests (-90%)
706
+ kirograph exec cargo test # Cargo tests (-90%)
707
+ kirograph exec rake test # Ruby minitest (-90%)
708
+ kirograph exec rspec # RSpec tests (-60%+)
709
+
710
+ # Build & Lint
711
+ kirograph exec eslint . # Grouped by rule/file
712
+ kirograph exec tsc --noEmit # TypeScript errors grouped by file
713
+ kirograph exec next build # Next.js build compact
714
+ kirograph exec prettier --check . # Files needing formatting
715
+ kirograph exec cargo build # Cargo build (-80%)
716
+ kirograph exec cargo clippy # Cargo clippy (-80%)
717
+ kirograph exec ruff check # Python linting (-80%)
718
+ kirograph exec golangci-lint run # Go linting (-85%)
719
+ kirograph exec rubocop # Ruby linting (-60%+)
720
+ kirograph exec biome check . # Biome linting
721
+
722
+ # Files & Search
723
+ kirograph exec ls -la src/ # Structured directory listing
724
+ kirograph exec find . -name "*.ts" # Grouped by directory
725
+ kirograph exec tree # Truncated with summary
726
+ kirograph exec grep -r "pattern" . # Grouped search results
727
+ kirograph exec rg "pattern" # Grouped search results
728
+ kirograph exec diff file1 file2 # Condensed diff
729
+
730
+ # Package Managers
731
+ kirograph exec npm install # → "ok +5 packages"
732
+ kirograph exec npm list # Compact dependency tree
733
+ kirograph exec pip list # Python packages
734
+ kirograph exec pip install -r req.txt # Strip progress bars
735
+ kirograph exec bundle install # Strip "Using" lines
736
+ kirograph exec prisma generate # Strip ASCII art
737
+
738
+ # AWS
739
+ kirograph exec aws sts get-caller-identity # One-line identity
740
+ kirograph exec aws ec2 describe-instances # Compact instance list
741
+ kirograph exec aws lambda list-functions # Name/runtime/memory
742
+ kirograph exec aws logs get-log-events ... # Timestamped messages only
743
+ kirograph exec aws cloudformation describe-stack-events ... # Failures first
744
+ kirograph exec aws dynamodb scan ... # Unwraps type annotations
745
+ kirograph exec aws iam list-roles # Strips policy documents
746
+ kirograph exec aws s3 ls s3://bucket # Truncated listing
747
+
748
+ # Containers
749
+ kirograph exec docker ps # Compact container list
750
+ kirograph exec docker images # Compact image list
751
+ kirograph exec docker logs container # Deduplicated logs
752
+ kirograph exec docker compose ps # Compose services
753
+ kirograph exec kubectl get pods # Compact pod list
754
+ kirograph exec kubectl logs pod # Deduplicated logs
755
+ kirograph exec kubectl get svc # Compact service list
756
+
757
+ # Network
758
+ kirograph exec curl https://api.example.com/data # Strip progress/headers
759
+ kirograph exec wget https://example.com/file.zip # Strip progress bars
760
+ ```
761
+
762
+ Three compression levels:
763
+
764
+ | Level | Style |
765
+ |-------|-------|
766
+ | `normal` | Balanced: removes noise, keeps structure *(default)* |
767
+ | `aggressive` | More compact: groups by category, limits output |
768
+ | `ultra` | Maximum compression: counts and summaries only |
769
+
770
+ ```bash
771
+ kirograph compression normal # balanced (default)
772
+ kirograph compression aggressive # more compact
773
+ kirograph compression ultra # maximum compression
774
+ kirograph compression off # disable hook (tool still available)
775
+ kirograph compression # show current level
776
+ ```
777
+
778
+ Set during `kirograph install` (interactive arrow-key menu) or any time after. When set to anything other than `off`, a `preToolUse` hook reminds the agent to use `kirograph_exec` for supported commands. The configured level is used as the default when the agent doesn't specify one explicitly.
779
+
780
+ **Error preservation:** Failed commands always show full diagnostic output regardless of compression level. The engine detects error patterns and preserves detail when it matters.
781
+
782
+ **Token analytics:**
783
+
784
+ ```bash
785
+ kirograph gain # summary stats
786
+ kirograph gain --graph # ASCII graph (last 30 days)
787
+ kirograph gain --history # recent command history
788
+ kirograph gain --daily # day-by-day breakdown
789
+ kirograph gain --json # JSON export
790
+ ```
791
+
792
+ The `kirograph_gain` MCP tool exposes the same stats to the agent.
793
+
794
+ ### Savings Heuristics
795
+
796
+ `kirograph gain` tracks two types of savings: compression (measured exactly) and graph tools (estimated via heuristics). For graph tools, the system estimates what the agent *would have spent* doing the same work without KiroGraph, based on typical agent behavior:
797
+
798
+ | Tool | What the agent would do manually | Estimated naive cost |
799
+ |------|----------------------------------|---------------------|
800
+ | `kirograph_context` | Read 5-10 files to orient on a task | ~7,500-15,000 tokens |
801
+ | `kirograph_search` | Run grep + read top matches | ~3,300 tokens |
802
+ | `kirograph_callers` | Grep for symbol + read each calling file | ~8,300 tokens |
803
+ | `kirograph_callees` | Read function body + grep for each call | ~3,900 tokens |
804
+ | `kirograph_impact` | Recursive grep + read per depth level | ~6,900 × depth |
805
+ | `kirograph_node` | Read the full file containing the symbol | ~1,500 tokens |
806
+ | `kirograph_files` | Run `find` or `ls -R` | ~2,000 tokens |
807
+ | `kirograph_path` | Trace connections manually (multiple grep + read) | ~7,700 tokens |
808
+ | `kirograph_type_hierarchy` | Grep for extends/implements + read each file | ~5,400 tokens |
809
+ | `kirograph_dead_code` | Not feasible manually (read every file) | 5× output, min 15,000 |
810
+ | `kirograph_hotspots` | Not feasible manually (count edges for every symbol) | 5× output, min 15,000 |
811
+ | `kirograph_architecture` | Not feasible manually | 4× output, min 7,500 |
812
+
813
+ Constants used: 1,500 tokens per average source file (~200 lines), 800 tokens per grep result set, 2,000 tokens per directory listing. These are conservative estimates; in practice agents often read more files, retry failed searches, and explore dead ends.
814
+
815
+ **Coexistence with Caveman Mode:** Compression and caveman mode are complementary, they compress different things. Caveman mode compresses the agent's *prose responses* (the text it writes around tool results); it never touches code or tool output. Shell compression compresses *shell command output* (the raw data coming back from shell commands); it never touches how the agent communicates. They stack: with both enabled, shell commands return 60-90% fewer tokens *and* the agent's explanations around those results are also shorter. Pick both independently during `kirograph install`. The "ultra + ultra" combo gives maximum token savings on both fronts.
816
+
589
817
  ### Architecture Analysis *(requires `enableArchitecture: true`)*
590
818
 
591
819
  Visualize the detected package graph, architectural layers, and package dependencies.
@@ -630,9 +858,9 @@ kirograph coupling --format json # JSON output
630
858
  ```
631
859
 
632
860
  The table shows each package with:
633
- - **Ca** afferent coupling: how many packages depend on this one (higher = more stable)
634
- - **Ce** efferent coupling: how many packages this one depends on (higher = more unstable)
635
- - **Instability** `Ce / (Ca + Ce)`, rendered as a color-coded bar: green (stable) → yellow (neutral) → red (unstable)
861
+ - **Ca**: afferent coupling: how many packages depend on this one (higher = more stable)
862
+ - **Ce**: efferent coupling: how many packages this one depends on (higher = more unstable)
863
+ - **Instability** (`Ce / (Ca + Ce)`), rendered as a color-coded bar: green (stable) → yellow (neutral) → red (unstable)
636
864
 
637
865
  The `--package` detail view shows who depends on this package and what it depends on, with import counts for each relationship.
638
866
 
@@ -662,7 +890,7 @@ Score = path distance between files × edge-kind weight (`calls=1.0`, `reference
662
890
 
663
891
  ### Snapshots & Diff
664
892
 
665
- Save lightweight graph snapshots and compare them to track structural changes over time useful before/after refactors, or in CI to audit what a PR added or removed.
893
+ Save lightweight graph snapshots and compare them to track structural changes over time, useful before/after refactors, or in CI to audit what a PR added or removed.
666
894
 
667
895
  ```bash
668
896
  kirograph snapshot save [label] # Save current graph state with optional label
@@ -674,13 +902,13 @@ kirograph snapshot diff --format full # Show full added/removed symbol lists
674
902
  kirograph snapshot diff --format json # JSON output
675
903
  ```
676
904
 
677
- Snapshots are stored in `.kirograph/snapshots/` as JSON and include all node IDs and edge tuples. The diff is computed as a set operation O(n) regardless of codebase size.
905
+ Snapshots are stored in `.kirograph/snapshots/` as JSON and include all node IDs and edge tuples. The diff is computed as a set operation, O(n) regardless of codebase size.
678
906
 
679
907
  The `kirograph_diff` MCP tool exposes the same capability to the agent: compare the current graph against the latest (or a named) snapshot without leaving the conversation.
680
908
 
681
909
  ### Dead Code
682
910
 
683
- Find unexported symbols with zero incoming references candidates for removal.
911
+ Find unexported symbols with zero incoming references, candidates for removal.
684
912
 
685
913
  ```bash
686
914
  kirograph dead-code [path] # List dead code grouped by file
@@ -704,7 +932,7 @@ The command resolves symbol names using the same fuzzy search as `kirograph quer
704
932
 
705
933
  ### Graph Export
706
934
 
707
- Export the full graph as an interactive dashboard three files served from a local directory, no server required, works offline.
935
+ Export the full graph as an interactive dashboard. three files served from a local directory, no server required, works offline.
708
936
 
709
937
  ```bash
710
938
  kirograph export build [path] # Generate .kirograph/export/{index.html,app.css,app.js}
@@ -721,10 +949,10 @@ Output lands in `.kirograph/export/` by default. Open `index.html` in any browse
721
949
 
722
950
  - **Color-coded nodes** by kind (class, function, method, component…) with size proportional to degree
723
951
  - **Directed edges** with kind labels; dashed lines for imports and references
724
- - **Click a node** to zoom in and inspect it kind, file, line, degree, signature, and a copy button for the file reference
952
+ - **Click a node** to zoom in and inspect it. kind, file, line, degree, signature, and a copy button for the file reference
725
953
  - **Click two nodes** to instantly find and highlight the shortest path between them, with detail cards for both endpoints
726
- - **History** ‹ › navigation through previously inspected nodes
727
- - **Keyboard shortcuts** `f` to fit the graph, `Esc` to exit focus or path mode
954
+ - **History**: ‹ › navigation through previously inspected nodes
955
+ - **Keyboard shortcuts**: `f` to fit the graph, `Esc` to exit focus or path mode
728
956
 
729
957
  #### Controls
730
958
 
@@ -746,9 +974,9 @@ Type to search by name, qualified name, or file path. Matching nodes are highlig
746
974
 
747
975
  #### Legend & filters
748
976
 
749
- - **Node kind filter** Legend tab; click any kind to hide or show all nodes of that type
750
- - **Edge kind filter** Legend tab; click any edge kind to hide or show edges of that type
751
- - **Degree slider** Filters tab; hide nodes below N connections to surface the most-connected symbols
977
+ - **Node kind filter**: Legend tab; click any kind to hide or show all nodes of that type
978
+ - **Edge kind filter**: Legend tab; click any edge kind to hide or show edges of that type
979
+ - **Degree slider**: Filters tab; hide nodes below N connections to surface the most-connected symbols
752
980
 
753
981
  #### Minimap
754
982
 
@@ -766,7 +994,7 @@ The 📊 Charts button opens a panel with three charts:
766
994
  |-------|--------------|
767
995
  | **Bar** | The 15 most-connected symbols |
768
996
  | **Donut** | How node kinds are distributed across the codebase |
769
- | **Line** | How many symbols have each connection count reveals the overall connectivity shape of the graph |
997
+ | **Line** | How many symbols have each connection count. reveals the overall connectivity shape of the graph |
770
998
 
771
999
 
772
1000
  ### Dashboard
@@ -783,7 +1011,7 @@ kirograph dashboard stop [path] # Stop the running engine server
783
1011
  Reads `semanticEngine` from `.kirograph/config.json` and dispatches accordingly:
784
1012
 
785
1013
  - **qdrant**: Downloads the [Qdrant Web UI](https://github.com/qdrant/qdrant-web-ui) on first use (cached at `.kirograph/qdrant/dashboard/`), spawns the Qdrant server with `QDRANT__SERVICE__STATIC_CONTENT_DIR` set so the dashboard is served natively, and opens `http://127.0.0.1:<port>/dashboard` in your browser. If the server is already running with the dashboard, reconnects instead of restarting.
786
- - **typesense**: Downloads the [Typesense Dashboard](https://github.com/bfritscher/typesense-dashboard) static UI on first use (cached at `.kirograph/typesense/dashboard/`), starts the Typesense server if not already running, serves the dashboard locally via a Node HTTP server, and opens it in your browser. Press Ctrl+C to stop the dashboard server the Typesense server keeps running as a background daemon.
1014
+ - **typesense**: Downloads the [Typesense Dashboard](https://github.com/bfritscher/typesense-dashboard) static UI on first use (cached at `.kirograph/typesense/dashboard/`), starts the Typesense server if not already running, serves the dashboard locally via a Node HTTP server, and opens it in your browser. Press Ctrl+C to stop the dashboard server. the Typesense server keeps running as a background daemon.
787
1015
 
788
1016
  Both servers run as persistent daemons. The state file (`.kirograph/qdrant-server.json` or `.kirograph/typesense-server.json`) tracks the PID and port for reconnection across `kg` commands.
789
1017
 
@@ -816,10 +1044,11 @@ KiroGraph stores its config in `.kirograph/config.json`. You can edit it directl
816
1044
  | `semanticEngine` | string | `cosine` | Search engine: `cosine`, `sqlite-vec`, `orama`, `pglite`, `lancedb`, `qdrant`, or `typesense` |
817
1045
  | `useVecIndex` | boolean | `false` | Deprecated alias for `semanticEngine: "sqlite-vec"` |
818
1046
  | `enableArchitecture` | boolean | `false` | Enable architecture analysis (package graph + layer detection, opt-in) |
819
- | `architectureLayers` | object | | Custom layer definitions: `{ "layerName": ["glob/**"] }` |
1047
+ | `architectureLayers` | object | - | Custom layer definitions: `{ "layerName": ["glob/**"] }` |
820
1048
  | `minLogLevel` | string | `warn` | Log level: `debug`, `info`, `warn`, `error` |
821
1049
  | `fuzzyResolutionThreshold` | number | `0.5` | Name matching threshold for cross-file resolution (0.0–1.0) |
822
1050
  | `cavemanMode` | string | `off` | Agent communication style: `off`, `lite`, `full`, `ultra` |
1051
+ | `shellCompressionLevel` | string | `normal` | Shell command compression level: `off`, `normal`, `aggressive`, `ultra` |
823
1052
 
824
1053
  Default exclude patterns: `node_modules/**`, `dist/**`, `build/**`, `.git/**`, `*.min.js`, `.kirograph/**`
825
1054
 
@@ -833,7 +1062,7 @@ By default, KiroGraph uses exact name lookup and full-text search. Enable semant
833
1062
  }
834
1063
  ```
835
1064
 
836
- This generates vector embeddings for all functions, methods, classes, interfaces, type aliases, components, and modules using a local embedding model (downloaded automatically to `~/.kirograph/models/` on first use). Embeddings are kept in sync automatically via Kiro hooks on every file save, create, or delete.
1065
+ This generates vector embeddings for all functions, methods, classes, interfaces, type aliases, components, and modules using a local embedding model (downloaded automatically to `~/.kirograph/models/` on first use). Embeddings are kept in sync automatically via Kiro hooks. on every file save, create, or delete.
837
1066
 
838
1067
  Run `kirograph install` to be guided through model and engine selection interactively with arrow-key menus, or set the fields manually in `.kirograph/config.json`.
839
1068
 
@@ -847,7 +1076,7 @@ Run `kirograph install` to be guided through model and engine selection interact
847
1076
  | `onnx-community/embeddinggemma-300m-ONNX` | 768 | ~300MB | Google Gemma-based. Multilingual, 2048-token context window. |
848
1077
  | `Xenova/all-MiniLM-L6-v2` | 384 | ~23MB | Lightweight, fast. Lower accuracy. |
849
1078
  | `BAAI/bge-base-en-v1.5` | 768 | ~110MB | Strong general-purpose alternative to nomic. |
850
- | Custom | any | | Any HuggingFace `feature-extraction` model. Provide ID + output dimension. |
1079
+ | Custom | any | - | Any HuggingFace `feature-extraction` model. Provide ID + output dimension. |
851
1080
 
852
1081
  The embedding dimension is stored in `embeddingDim` in `.kirograph/config.json` and used to initialise all vector engines correctly. Switching models requires a full re-index (`kirograph index --force`).
853
1082
 
@@ -863,7 +1092,7 @@ Configure manually:
863
1092
 
864
1093
  #### Storage architecture
865
1094
 
866
- Each engine owns its embedding store exclusively there is no redundant write to the main graph database:
1095
+ Each engine owns its embedding store exclusively. there is no redundant write to the main graph database:
867
1096
 
868
1097
  | Engine | Graph store | Vector store |
869
1098
  |--------|-------------|--------------|
@@ -881,7 +1110,7 @@ The graph store (`kirograph.db`) always holds nodes, edges, files, and all struc
881
1110
 
882
1111
  | Engine | Search type | Extra deps | Native? | Best for |
883
1112
  |--------|-------------|------------|---------|----------|
884
- | `cosine` *(default)* | Exact cosine, linear scan | none | | Small / medium projects, zero setup |
1113
+ | `cosine` *(default)* | Exact cosine, linear scan | none | - | Small / medium projects, zero setup |
885
1114
  | `sqlite-vec` | ANN (approximate), sub-linear | `better-sqlite3`, `sqlite-vec` | yes | Large codebases, fast ANN search |
886
1115
  | `orama` | Hybrid (full-text + vector) | `@orama/orama`, `@orama/plugin-data-persistence` | no (pure JS) | Best result quality, no native deps |
887
1116
  | `pglite` | Hybrid (full-text + vector), exact | `@electric-sql/pglite` | no (pure WASM) | Exact results, no native deps, PostgreSQL semantics |
@@ -904,7 +1133,7 @@ In-process cosine similarity over all stored embeddings. No extra dependencies.
904
1133
 
905
1134
  #### sqlite-vec
906
1135
 
907
- Approximate nearest-neighbour (ANN) index stored in `.kirograph/vec.db`. Sub-linear search time ideal for large codebases with thousands of indexed symbols. The SQLite `vectors` table is not written to; `vec.db` is the sole embedding store.
1136
+ Approximate nearest-neighbour (ANN) index stored in `.kirograph/vec.db`. Sub-linear search time. ideal for large codebases with thousands of indexed symbols. The SQLite `vectors` table is not written to; `vec.db` is the sole embedding store.
908
1137
 
909
1138
  ```json
910
1139
  {
@@ -921,7 +1150,7 @@ Requires two native dependencies (compiled C extensions). If not installed, fall
921
1150
 
922
1151
  #### orama
923
1152
 
924
- Hybrid search powered by [Orama](https://github.com/oramasearch/orama) combines full-text relevance and vector similarity in a **single query**, producing higher-quality results than running the two searches separately. The index is persisted to `.kirograph/orama.json` and is the sole embedding store. Pure JS, no native compilation required.
1153
+ Hybrid search powered by [Orama](https://github.com/oramasearch/orama). combines full-text relevance and vector similarity in a **single query**, producing higher-quality results than running the two searches separately. The index is persisted to `.kirograph/orama.json` and is the sole embedding store. Pure JS, no native compilation required.
925
1154
 
926
1155
  ```json
927
1156
  {
@@ -938,7 +1167,7 @@ If not installed, falls back to `cosine`.
938
1167
 
939
1168
  #### pglite
940
1169
 
941
- Hybrid search powered by [PGlite](https://github.com/electric-sql/pglite) a WASM-compiled PostgreSQL with the [pgvector](https://github.com/pgvector/pgvector) extension. Combines **exact** nearest-neighbour vector search with full-text ranking (`ts_rank`) in a single SQL query. The database is persisted to `.kirograph/pglite/` using PostgreSQL's WAL-based storage and is the sole embedding store. Pure WASM no native compilation required.
1170
+ Hybrid search powered by [PGlite](https://github.com/electric-sql/pglite), a WASM-compiled PostgreSQL with the [pgvector](https://github.com/pgvector/pgvector) extension. Combines **exact** nearest-neighbour vector search with full-text ranking (`ts_rank`) in a single SQL query. The database is persisted to `.kirograph/pglite/` using PostgreSQL's WAL-based storage and is the sole embedding store. Pure WASM, no native compilation required.
942
1171
 
943
1172
  ```json
944
1173
  {
@@ -952,8 +1181,8 @@ npm install @electric-sql/pglite
952
1181
  ```
953
1182
 
954
1183
  Key advantages:
955
- - **Exact** vector results (not approximate) deterministic and reproducible
956
- - Native SQL `ON CONFLICT` upsert no remove+insert workaround
1184
+ - **Exact** vector results (not approximate). deterministic and reproducible
1185
+ - Native SQL `ON CONFLICT` upsert, no remove+insert workaround
957
1186
  - HNSW index (`vector_cosine_ops`) keeps search fast as the index grows
958
1187
  - Single dependency, zero native binaries
959
1188
 
@@ -961,7 +1190,7 @@ If not installed, falls back to `cosine`.
961
1190
 
962
1191
  #### LanceDB
963
1192
 
964
- ANN vector search powered by [LanceDB](https://github.com/lancedb/lancedb) stores embeddings in Apache Lance columnar format at `.kirograph/lancedb/`. Sub-linear search time using cosine distance. Pure JS, no native compilation required.
1193
+ ANN vector search powered by [LanceDB](https://github.com/lancedb/lancedb). stores embeddings in Apache Lance columnar format at `.kirograph/lancedb/`. Sub-linear search time using cosine distance. Pure JS, no native compilation required.
965
1194
 
966
1195
  ```json
967
1196
  {
@@ -975,9 +1204,9 @@ npm install @lancedb/lancedb
975
1204
  ```
976
1205
 
977
1206
  Key characteristics:
978
- - **Columnar storage** (Apache Lance format) efficient for batch reads and writes
979
- - **ANN cosine search** fast, sub-linear query time
980
- - Pure JS no native binaries or WASM required
1207
+ - **Columnar storage** (Apache Lance format). efficient for batch reads and writes
1208
+ - **ANN cosine search**: fast, sub-linear query time
1209
+ - Pure JS, no native binaries or WASM required
981
1210
 
982
1211
  If not installed, falls back to `cosine`.
983
1212
 
@@ -997,11 +1226,11 @@ npm install qdrant-local
997
1226
  ```
998
1227
 
999
1228
  Key characteristics:
1000
- - **HNSW index** high-quality ANN search with Qdrant's native indexing
1001
- - **Embedded binary** no separate server setup; the process is spawned and managed automatically
1002
- - **Persistent daemon** the server stays running between `kg` commands; state tracked in `.kirograph/qdrant-server.json`
1003
- - **Built-in dashboard** run `kg dashboard start` to download the [Qdrant Web UI](https://github.com/qdrant/qdrant-web-ui) and open it (cached at `.kirograph/qdrant/dashboard/`, served via Qdrant's built-in static content feature)
1004
- - **Async startup** polls `/readyz` instead of blocking with a fixed sleep
1229
+ - **HNSW index**: high-quality ANN search with Qdrant's native indexing
1230
+ - **Embedded binary**: no separate server setup; the process is spawned and managed automatically
1231
+ - **Persistent daemon**: the server stays running between `kg` commands; state tracked in `.kirograph/qdrant-server.json`
1232
+ - **Built-in dashboard**: run `kg dashboard start` to download the [Qdrant Web UI](https://github.com/qdrant/qdrant-web-ui) and open it (cached at `.kirograph/qdrant/dashboard/`, served via Qdrant's built-in static content feature)
1233
+ - **Async startup**: polls `/readyz` instead of blocking with a fixed sleep
1005
1234
  - **Cosine distance** metric
1006
1235
  - Data persists across restarts in `.kirograph/qdrant/`
1007
1236
 
@@ -1030,11 +1259,11 @@ npm install typesense
1030
1259
  ```
1031
1260
 
1032
1261
  Key characteristics:
1033
- - **HNSW index** high-quality ANN search with Typesense's native indexing
1034
- - **Auto-downloaded binary** no manual server setup; the binary is fetched and cached at `~/.kirograph/bin/` on first run
1035
- - **Persistent daemon** the server stays running between `kg` commands; state tracked in `.kirograph/typesense-server.json`
1036
- - **Local dashboard** run `kg dashboard start` to open the built-in Typesense Dashboard UI (served locally, cached at `.kirograph/typesense/dashboard/`)
1037
- - **Async startup** polls `/health` instead of blocking with a fixed sleep
1262
+ - **HNSW index**: high-quality ANN search with Typesense's native indexing
1263
+ - **Auto-downloaded binary**: no manual server setup; the binary is fetched and cached at `~/.kirograph/bin/` on first run
1264
+ - **Persistent daemon**: the server stays running between `kg` commands; state tracked in `.kirograph/typesense-server.json`
1265
+ - **Local dashboard**: run `kg dashboard start` to open the built-in Typesense Dashboard UI (served locally, cached at `.kirograph/typesense/dashboard/`)
1266
+ - **Async startup**: polls `/health` instead of blocking with a fixed sleep
1038
1267
  - **Cosine distance** metric
1039
1268
  - Data persists across restarts in `.kirograph/typesense/`
1040
1269
 
@@ -1053,12 +1282,12 @@ When `enableArchitecture: true` is set, KiroGraph analyses the high-level struct
1053
1282
 
1054
1283
  #### What it detects
1055
1284
 
1056
- **Packages** logical groupings of files. Detected two ways:
1285
+ **Packages**: logical groupings of files. Detected two ways:
1057
1286
 
1058
- 1. **Manifest-based** parsed from `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`/`setup.py`/`setup.cfg`, `pom.xml`, `build.gradle`/`build.gradle.kts`, and `.csproj` files. Produces IDs like `pkg:npm:src/auth`.
1059
- 2. **Directory fallback** for files not covered by any manifest, groups them by their nearest ancestor directory. Produces IDs like `pkg:dir:src/utils`.
1287
+ 1. **Manifest-based**: parsed from `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`/`setup.py`/`setup.cfg`, `pom.xml`, `build.gradle`/`build.gradle.kts`, and `.csproj` files. Produces IDs like `pkg:npm:src/auth`.
1288
+ 2. **Directory fallback**: for files not covered by any manifest, groups them by their nearest ancestor directory. Produces IDs like `pkg:dir:src/utils`.
1060
1289
 
1061
- **Layers** architectural tiers detected from file paths using per-language glob patterns:
1290
+ **Layers**: architectural tiers detected from file paths using per-language glob patterns:
1062
1291
 
1063
1292
  | Layer | Examples |
1064
1293
  |-------|---------|
@@ -1070,12 +1299,12 @@ When `enableArchitecture: true` is set, KiroGraph analyses the high-level struct
1070
1299
 
1071
1300
  Layer detection is per-language (TypeScript/JS, Python, Go, Java, Ruby, Rust, C#) with framework-specific patterns where applicable (Django, Rails, Spring MVC, ASP.NET, etc.). Custom layer overrides are supported via `architectureLayers` in config.
1072
1301
 
1073
- **Package dependencies** rolled up from existing `imports` edges in the graph. No re-parsing required.
1302
+ **Package dependencies**: rolled up from existing `imports` edges in the graph. No re-parsing required.
1074
1303
 
1075
- **Coupling metrics** computed per package:
1076
- - **Ca** (afferent) how many other packages depend on this one
1077
- - **Ce** (efferent) how many packages this one depends on
1078
- - **Instability** `Ce / (Ca + Ce)`: 0 = maximally stable (everyone depends on it, it depends on nothing), 1 = maximally unstable (depends on everything, nobody depends on it)
1304
+ **Coupling metrics**: computed per package:
1305
+ - **Ca** (afferent). how many other packages depend on this one
1306
+ - **Ce** (efferent). how many packages this one depends on
1307
+ - **Instability** (`Ce / (Ca + Ce)`): 0 = maximally stable (everyone depends on it, it depends on nothing), 1 = maximally unstable (depends on everything, nobody depends on it)
1079
1308
 
1080
1309
  #### Custom layer definitions
1081
1310
 
@@ -1215,10 +1444,20 @@ Ansible
1215
1444
 
1216
1445
  Detected frameworks are stored in config and used to improve symbol extraction and resolution.
1217
1446
 
1447
+ ## Credits
1448
+
1449
+ KiroGraph is inspired by [CodeGraph](https://github.com/colbymchenry/codegraph) by [Colby McHenry](https://www.linkedin.com/in/colby-mchenry/). the original concept of building a semantic code graph for AI coding agents comes from his work.
1450
+
1451
+ ### Contributors
1452
+
1453
+ - [Alessandro Franceschi](https://www.linkedin.com/in/alessandrofranceschi/). Claude Code and Codex integration, Elixir/Phoenix language and framework support.
1454
+ - [Mauro Argo](https://www.linkedin.com/in/argomauro/). original idea for the architecture layer analysis feature.
1455
+
1218
1456
  ## Requirements
1219
1457
 
1220
1458
  - Node.js >= 18
1221
- - Kiro IDE
1459
+ - Kiro IDE (fully supported)
1460
+ - Other MCP-capable tools (experimental. see [Other Tools](#other-tools-experimental))
1222
1461
 
1223
1462
  ## License
1224
1463