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

# AI Features

> Every AI surface on the Roboticks platform — test triage, flakiness analysis, sim-vs-real, log anomalies, requirement assists, evidence-pack narrative, standards coverage, NL search. Token model, plan gating, and where each surface lives in the UI.

# AI features

Roboticks runs **Anthropic Claude on AWS Bedrock** behind a small set of typed task definitions. Every AI surface in the product maps to one `AITaskType` with a fixed model, fixed input/output window, and a fixed `token_cost` — so plan gating is deterministic and the surface area is auditable.

<Info>
  The customer never picks the model. The backend picks Haiku, Sonnet, or Opus per task. Bills count against the org's monthly `ai_tokens` grant; overage stops at the plan ceiling unless the org has a top-up. See [Pricing → AI tokens](/pricing) for the unit economics.
</Info>

## Where AI shows up

| Surface                                | UI entry point                            | Doc page                                                                             |
| -------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------ |
| **Test failure triage**                | Run-detail page → AI Triage panel         | [Test debugging](/ai/test-debugging#test-failure-triage)                             |
| **Test-run analysis**                  | Run-detail page → AI Analyze              | [Test debugging](/ai/test-debugging#test-run-analysis)                               |
| **Test flakiness**                     | Test case page → Flakiness dialog         | [Test debugging](/ai/test-debugging#flakiness)                                       |
| **Sim-vs-real comparison**             | Run-detail page (sim run) → Compare Real  | [Test debugging](/ai/test-debugging#sim-vs-real)                                     |
| **Inline log anomalies**               | Logs page → highlighted lines             | [Test debugging](/ai/test-debugging#log-anomalies)                                   |
| **Requirement quality**                | Requirement detail → Quality card         | [Requirements & traceability](/ai/requirements-and-traceability#quality)             |
| **Verification method**                | Requirement detail → Verification card    | [Requirements & traceability](/ai/requirements-and-traceability#verification-method) |
| **Duplicate / contradiction**          | Requirement detail → Duplicates card      | [Requirements & traceability](/ai/requirements-and-traceability#duplicate-check)     |
| **Standards clause linkage**           | Requirement detail → Standards card       | [Requirements & traceability](/ai/requirements-and-traceability#standards-link)      |
| **Chat with requirements doc**         | Requirements upload page → chat dock      | [Requirements & traceability](/ai/requirements-and-traceability#doc-chat)            |
| **Test suggestions for uncovered req** | Traceability gaps → AI Suggest            | [Requirements & traceability](/ai/requirements-and-traceability#test-suggestion)     |
| **Gap explanation**                    | Traceability matrix → uncovered row       | [Requirements & traceability](/ai/requirements-and-traceability#gap-explain)         |
| **Evidence-pack narrative**            | Evidence pack detail → Generate narrative | [Evidence & standards](/ai/evidence-and-standards#narrative)                         |
| **Pre-audit Q\&A**                     | Evidence pack detail → Ask                | [Evidence & standards](/ai/evidence-and-standards#qa)                                |
| **Pack completeness gate**             | Evidence pack detail → Completeness       | [Evidence & standards](/ai/evidence-and-standards#completeness)                      |
| **Standards coverage delta**           | Standard detail → Coverage AI             | [Evidence & standards](/ai/evidence-and-standards#coverage-delta)                    |
| **Standards clause summary**           | Standard clause → Plain English           | [Evidence & standards](/ai/evidence-and-standards#clause-summary)                    |
| **Posture weekly digest**              | Posture dashboard → top banner            | [Evidence & standards](/ai/evidence-and-standards#posture-digest)                    |
| **Natural-language search**            | Global search bar → "Ask" toggle          | [Search](/ai/search)                                                                 |

## Models and routing

Routing is fixed in [`app/core/ai_config.py`](https://github.com/roboticks-io/roboticks/blob/main/backend/app/core/ai_config.py) and is **not** a tunable for customers. The mapping:

| Tier            | Model               | Used for                                                                                                                                                                                                             |
| --------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Cheap / fast    | `claude-haiku-4-5`  | Single-requirement quality + verification-method + gap-explain, log summarisation, entity extraction, search query parse, standards clause summary                                                                   |
| Default         | `claude-sonnet-4-5` | Test-failure analysis, test-run analysis, conversation responses, flakiness, requirement generation, duplicate / standards-link, doc chat, evidence pack QA / completeness, standards coverage delta, posture digest |
| Heavy reasoning | `claude-opus-4-5`   | Root-cause analysis, sim-vs-real comparison, evidence-pack narrative                                                                                                                                                 |

Bedrock model IDs live alongside the routing table; cross-region inference profiles (`us.anthropic...`) are baked in.

## How billing works

Each call bills the **Bedrock-equivalent token count × 2x margin**, with output weighted by the model's output/input price ratio. So a typical Sonnet request that consumes 5 000 input + 1 000 output tokens at Bedrock prices the customer is charged roughly:

```text theme={null}
billable = round(2 × (5 000 + 5 × 1 000)) = 20 000 ai_tokens
```

The platform never charges by absolute dollars — it charges in units of `ai_tokens` the customer's plan ships with monthly. Top-up packs add `ai_tokens_prepaid` that never expire.

For a worst-case ceiling per task — the figure the plan-gate compares against — see `max_billable_tokens()` in [`ai_config.py`](https://github.com/roboticks-io/roboticks/blob/main/backend/app/core/ai_config.py). The Free plan's 100 000-token grant covers Haiku-tier tasks but is **below** the worst-case requirement-generation gate, so the heavy AI features are implicitly Team+.

## What the AI does NOT do

* It never edits your code, your requirements, your tests, or your evidence packs. Every "AI assist" is a suggestion the engineer accepts or rejects.
* It never reads your repos directly. AI prompts are built from data already in the platform (test results, requirements text, logs the runner shipped). The hosted MCP server can read more, but only when an LLM calls it through the platform's billing-and-auth boundary.
* It never sees a customer's data outside the Bedrock invocation. Roboticks does not train models. Anthropic does not use Bedrock prompts for training under AWS's contractual terms.
* It is **not** a substitute for the certification auditor. AI assists draft and explain; the engineer signs.

## Plan gating

| Plan       | Monthly `ai_tokens` grant | Effectively unlocks                                                                                                 |
| ---------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Free       | 100 000                   | Haiku-tier surfaces: log summarisation, clause summaries, single-requirement quality / gap-explain                  |
| Team       | 5 000 000                 | Everything below worst-case requirement-generation; flakiness; sim-vs-real; evidence narratives at moderate cadence |
| Enterprise | ∞                         | All surfaces, no rate cap beyond Bedrock-side limits                                                                |

Customers can buy top-up packs at any tier; topped-up tokens are `ai_tokens_prepaid` and never reset.

## Next

<CardGroup cols={2}>
  <Card title="Test debugging" icon="bug" href="/ai/test-debugging">
    Triage, flakiness, sim-vs-real, log anomalies.
  </Card>

  <Card title="Requirements & traceability" icon="file-lines" href="/ai/requirements-and-traceability">
    INCOSE quality, verification, duplicates, gaps, doc chat.
  </Card>

  <Card title="Evidence & standards" icon="scale-balanced" href="/ai/evidence-and-standards">
    Pack narrative, pre-audit Q\&A, clause summaries.
  </Card>

  <Card title="Natural-language search" icon="magnifying-glass" href="/ai/search">
    Ask questions; get answers grounded in the project's data.
  </Card>
</CardGroup>
