Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/davide-desio-eleva/kirograph/llms.txt

Use this file to discover all available pages before exploring further.

KiroGraph’s docs module indexes your project’s written documentation alongside the code graph, making it queryable at section granularity. Instead of loading entire files, the agent retrieves only the sections it needs — achieving 92–97% token savings on typical doc-heavy codebases. All tools require enableDocs: true in .kirograph/config.json and a completed kirograph index run.
Supported formats: Markdown (.md), MDX (.mdx), reStructuredText (.rst), AsciiDoc (.adoc), and OpenAPI specs (.yaml/.json). Sections are split at heading boundaries and addressed by stable heading-path IDs.

Stable Section IDs

Every indexed section receives a stable ID — a deterministic string derived from the file path and the full ancestor heading chain. Because the ID encodes the structural position rather than a byte offset, it survives file reformatting and minor edits elsewhere in the file as long as the heading text and hierarchy don’t change. The ID format is: {file-path}::{ancestor-slug/.../heading-slug}#{level}, for example docs/auth.md::authentication/jwt-strategy#2.
  • file-path — project-relative path to the doc file.
  • ancestor-slug/.../heading-slug/-joined slugified titles of all ancestor headings down to the section itself (GitHub-style slugification: lowercase, spaces→hyphens, special chars removed).
  • level — heading level (1–6).
Stable IDs are returned by kirograph_docs_toc, kirograph_docs_search, and kirograph_docs_outline. Pass them directly to kirograph_docs_section to retrieve the full section content without re-running a search query.

kirograph_docs_toc

Get the table of contents for the entire project or a specific file. Each entry includes the heading text, heading level, file path, section summary (when available), and the stable section ID.
file
string
Filter to a specific doc file. Omit for a project-wide TOC.
tree
boolean
Return a nested tree structure (children nested under parent headings). Defaults to false (flat list).
projectPath
string
Project root path. Defaults to the current working directory.
{
  "tool": "kirograph_docs_toc",
  "arguments": {}
}
Example output (flat)
## Authentication [docs/auth.md]
  ID: docs/auth.md::authentication#2

### JWT Strategy [docs/auth.md]
  ID: docs/auth.md::authentication/jwt-strategy#3

### Session Cookies [docs/auth.md]
  ID: docs/auth.md::authentication/session-cookies#3

Search documentation sections by a natural-language query or keyword. Uses full-text search (FTS) and, when a vector engine is configured, semantic search as a fallback. Returns sections ranked by relevance with their summaries and stable IDs.
query
string
required
Natural-language or keyword search query.
file
string
Narrow the search to a specific doc file.
limit
number
Maximum sections to return. Defaults to 10.
projectPath
string
Project root path. Defaults to the current working directory.
Example: find sections about rate limiting
{
  "tool": "kirograph_docs_search",
  "arguments": {
    "query": "rate limiting configuration",
    "limit": 5
  }
}
Example output
1. Rate Limiting [docs/api/limits.md]
   Configure per-endpoint rate limits using the sliding window algorithm.
   ID: docs/api/limits.md::rate-limiting#2

2. Global Rate Limit Middleware [docs/api/middleware.md]
   Apply a global limit before route handlers with applyRateLimit().
   ID: docs/api/middleware.md::global-rate-limit-middleware#2

kirograph_docs_section

Retrieve the full content of a documentation section by its stable ID. This is the token-efficient retrieval path: you first scan the TOC or run a search to find section IDs, then fetch only the sections you need. Pass context: true to include the ancestor heading chain and child section summaries alongside the content.
id
string
required
Stable section ID from kirograph_docs_toc, kirograph_docs_search, or kirograph_docs_outline.
context
boolean
When true, includes the breadcrumb (ancestor headings) and a list of immediate child sections with their summaries. Defaults to false.
projectPath
string
Project root path. Defaults to the current working directory.
Example: fetch a section by ID
{
  "tool": "kirograph_docs_section",
  "arguments": {
    "id": "docs/api/limits.md::rate-limiting#2",
    "context": true
  }
}
Example output (with context: true)
Breadcrumb: API Reference > Rate Limiting

## Rate Limiting

Configure per-endpoint rate limits using the sliding window algorithm.
Each endpoint can define its own `rateLimit` option:

```ts
router.get('/search', { rateLimit: { max: 30, window: '1m' } }, handler)

Child sections:

  • Configuring Headers — return X-RateLimit-* headers (ID: docs/api/limits.md::rate-limiting/configuring-headers#3)
  • Per-user vs Global limits (ID: docs/api/limits.md::rate-limiting/per-user-vs-global-limits#3)

---

## `kirograph_docs_outline`

Get the complete heading hierarchy for a single documentation file as a nested tree. Lighter than the full TOC when you only need the structure of one file.

<ParamField body="file" type="string" required>
  Relative path to the documentation file.
</ParamField>

<ParamField body="projectPath" type="string">
  Project root path. Defaults to the current working directory.
</ParamField>

```json title="Example"
{
  "tool": "kirograph_docs_outline",
  "arguments": { "file": "docs/api/limits.md" }
}
Example output
Outline: docs/api/limits.md

# API Rate Limiting
  ## Rate Limiting — configure per-endpoint limits
    ### Configuring Headers
    ### Per-user vs Global limits
  ## Burst Allowance
  ## Error Responses

kirograph_docs_refs

Bidirectional cross-reference lookup. Given a section ID, returns the code symbols that section references. Given a symbol qualified name, returns the documentation sections that mention it — with relevance scores. This is the bridge between the graph and the docs index.
sectionId
string
Section ID — returns code symbols referenced by this section.
nodeId
string
Code symbol qualified name — returns documentation sections that reference this symbol.
projectPath
string
Project root path. Defaults to the current working directory.
Provide either sectionId or nodeId, not both. Providing neither returns an error.
{
  "tool": "kirograph_docs_refs",
  "arguments": { "sectionId": "docs/api/limits.md::rate-limiting#2" }
}
Example output (nodeId lookup)
[mention] ← Rate Limiting (confidence: 0.92)
[example] ← Middleware Configuration (confidence: 0.81)
[api_ref] ← applyRateLimit API (confidence: 0.76)

Token-Efficient Retrieval Pattern

The typical three-step workflow uses only the content you need, never loading full documentation files:
1

Search or browse for relevant sections

Run a semantic search to find section IDs without fetching content:
{
  "tool": "kirograph_docs_search",
  "arguments": { "query": "authentication middleware options", "limit": 5 }
}
Note the section IDs from the results (e.g. docs/auth.md::authentication#2).
2

Fetch only the sections you need

Retrieve the content of a specific section by its stable ID — no full-file load:
{
  "tool": "kirograph_docs_section",
  "arguments": { "id": "docs/auth.md::authentication#2", "context": true }
}
A 200-section documentation file might be 180 KB; the targeted section is typically 800–2 000 bytes.
3

Bridge to the code graph

Check which code symbols the section references to jump directly to the implementation:
{
  "tool": "kirograph_docs_refs",
  "arguments": { "sectionId": "docs/auth.md::authentication#2" }
}
Then use kirograph_node to fetch the implementation of any referenced symbol.
Use kirograph_docs_outline instead of kirograph_docs_toc when you already know which file to look at — it’s faster and returns a clean nested tree without project-wide noise.

Build docs developers (and LLMs) love