> For the complete documentation index, see [llms.txt](https://stemma.sh/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stemma.sh/docs/readme.md).

# Stemma documentation

Stemma creates reviewable Word redlines from existing `.docx` files. It can compare two versions, apply an approved list of replacements, or give an agent a bounded document-editing workflow.

New here? Start with [Create your first redline](/docs/getting-started.md). It takes two Word documents and produces one native tracked-changes comparison.

## Start by goal

| I want to                            | Start here                                                                                                              |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| Compare two versions of a document   | [Create your first redline](/docs/getting-started.md)                                                                   |
| Apply exact, approved replacements   | [Apply approved changes](/docs/guides/apply-approved-changes.md)                                                        |
| Connect Stemma to an agent           | [Use Stemma with an agent](/docs/guides/use-with-an-agent.md)                                                           |
| Verify a multi-document delivery     | [Verify a task delivery](/docs/guides/verify-task-delivery.md)                                                          |
| Review, accept, or reject revisions  | [Review and resolve changes](/docs/guides/review-and-resolve.md)                                                        |
| Fix an error or refusal              | [Troubleshooting](/docs/help/troubleshooting.md)                                                                        |
| Read working code for a common flow  | [Examples](/docs/examples.md)                                                                                           |
| Embed the Rust engine                | [`stemma-engine` README](https://github.com/stemma-sh/stemma/blob/main/stemma-engine/README.md)                         |
| Build a viewer, renderer, or service | [Embed the engine](/docs/reference/embedding.md); render from the [read model reference](/docs/reference/read-model.md) |
| Store documents and edits durably    | [Persist and replay](/docs/understand-the-model/persistence.md)                                                         |

## Understand the model

The guide explains the ideas that make Stemma safe:

1. [Concepts](/docs/understand-the-model/concepts.md): typed documents, projections, and explicit outcomes.
2. [Revisions](/docs/understand-the-model/revisions.md): Word revision types, authorship, and accept/reject behavior.
3. [Editing](/docs/understand-the-model/editing.md): transactions, receipts, and review before save.
4. [Fidelity](/docs/understand-the-model/fidelity.md): what Stemma preserves and what it does not promise.
5. [Stability](/docs/understand-the-model/stability.md): compatibility guarantees for each public surface.
6. [Persist and replay](/docs/understand-the-model/persistence.md): the storage model, and why it fits an agent-editing product.

## Look up an exact contract

* [CLI reference](/docs/reference/cli.md): commands, exit codes, worklists, receipts, and examples.
* [MCP core reference](/docs/reference/mcp.md): the default five-tool agent surface.
* [MCP advanced reference](/docs/reference/mcp-advanced.md): optional expert tools, v4 transactions, and advanced recipes.
* [v4 operation reference](/docs/reference/operations.md): every transaction operation, its accepted fields, and canonical shapes, generated from the engine's parser table.
* [Read model reference](/docs/reference/read-model.md): the typed views a renderer consumes (blocks, segments, run formatting, revision identity), generated from live engine values and labeled version-bound.
* [Embed the engine](/docs/reference/embedding.md): the facade lifecycle, hosting sessions, the concurrency model, and the map to rustdoc.
* [HTTP API](/docs/reference/http.md): local demonstration transport, not a stable hosted product surface.

## Evidence and internals

* [Agent benchmarks](/docs/evidence-and-internals/benchmarks.md): current results, methodology, caveats, and corrections.
* [Benchmark archive](/docs/evidence-and-internals/benchmarks-history.md): retired pins and earlier waves.
* [Architecture](/docs/evidence-and-internals/architecture.md): workspace and engine map.
* [Testing](/docs/evidence-and-internals/testing.md): validation tiers and contributor test commands.
* [Design notes](/docs/evidence-and-internals/design-notes.md): decisions behind shipped designs.
* [Change log](https://github.com/stemma-sh/stemma/blob/main/CHANGELOG.md): the release history, and where every announced breaking change lands.

For source setup and contribution expectations, see [CONTRIBUTING.md](https://github.com/stemma-sh/stemma/blob/main/CONTRIBUTING.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://stemma.sh/docs/readme.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
