> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stratta.ch/llms.txt
> Use this file to discover all available pages before exploring further.

# TreeRAG

> Why Stratta navigates a norm's real structure instead of matching embeddings — and why that gives deterministic citations.

TreeRAG is the reasoning model behind Stratta. It explains why answers come with citations you
can open and verify, rather than approximate references.

## RAG, briefly

"RAG" (retrieval-augmented generation) means giving an AI the right source text before it
answers, so it reasons from documents instead of memory. The question is *how* you retrieve the
right text. Stratta's answer is **TreeRAG**.

## The usual way: vector embeddings

The common approach splits a document into many small chunks, converts each into a numeric
vector, and at query time retrieves the chunks whose vectors are closest to the question's
vector. It's fast and general, but for engineering norms it has two costs:

* **Citations get fuzzy.** A chunk boundary rarely lines up with a clause or page, so the
  reference back to the norm is approximate.
* **Structure is lost.** Norms are hierarchical and cross-referenced. Flat chunks discard the
  chapter → section → clause tree that tells you where a rule lives.

## Stratta's way: navigate the tree

Stratta stores each norm as its **actual table of contents** — a tree of chapters, sections,
sub-sections, and annexes, inspired by the
[PageIndex](https://github.com/VectifyAI/PageIndex) approach. There are **no embeddings**.

Claude navigates that tree like an engineer with the printed norm:

| Step | What Claude does                           | Tool             |
| ---- | ------------------------------------------ | ---------------- |
| 1    | See which norms exist                      | `list_norms`     |
| 2    | Read the chapter structure                 | `get_toc`        |
| 3    | Drill into a chapter                       | `get_subtree`    |
| 4    | Read a section's full content              | `get_section`    |
| 5    | Search by keyword when the path is unknown | `search_in_norm` |
| 6    | Follow links to other norms                | `get_cross_refs` |
| 7    | Open a diagram                             | `get_figure`     |

Each section retains its **exact path and page range**. So when Claude cites
`[SIA 261, 8.2, p. 44]`, that location is real and openable — what we call a **deterministic
citation**.

## Why cross-references matter

SIA standards deliberately distribute a single rule across several norms: the action in SIA 261,
the safety factors and combinations in SIA 260, the material rules in the domain norm (concrete
in 262, steel in 263…). Stratta records these links explicitly so Claude can follow them. Missing
cross-references is the most common cause of incomplete answers — TreeRAG is built to avoid it.

## Trade-offs

TreeRAG is excellent for **structured, citation-critical** documents like norms. It does require
a high-quality table-of-contents tree, which is why ingestion is careful and agent-driven (see
[Ingest a norm](/en/guides/ingest-a-norm)). For unstructured prose, plain embeddings can be
simpler — but that's not the problem Stratta solves.

## Related

<CardGroup cols={2}>
  <Card title="Architecture" icon="sitemap" href="/en/concepts/architecture">
    Where the tree is stored and served.
  </Card>

  <Card title="MCP read tools" icon="book-open" href="/en/mcp/read-tools">
    The tools that walk the tree.
  </Card>
</CardGroup>
