> For the complete documentation index, see [llms.txt](https://k-ai.gitbook.io/knowledge-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://k-ai.gitbook.io/knowledge-ai/k-ai-audit/audit.md).

# Overview & workflow

K-AI Audit is the module that drives the document-audit workflow: verifying indexation, surfacing duplicates, answering mandatory questions, resolving conflicts, identifying missing subjects. The Document Steward animates the workflow day-to-day; Document Producers contribute through targeted reviews; LLM agents drive the same flow via the K-AI MCP audit-tools surface.

The Audit MCP exposes a **21-tool curated subset** of the 48-operation REST API, organised conflict-first. Admin operations (instance setup, user management, stats) remain on the REST API.

## The Clean discipline

K-AI Audit is the operational expression of the **Clean** discipline (the second of the three DKP capabilities — Govern · Clean · Activate). It implements Principle 2 (Clean before consume) and Principle 5 (Continuous observability): the platform never silently swallows inconsistencies, and every conflict, duplicate, or missing subject is materialised as a piece of work that a Steward or agent can pick up and resolve.

## Conflict-first workflow

The recommended path through K-AI Audit is conflict-first. A Steward (or an agent) walks through five steps:

1. Land on the dashboard (`audit_dashboard_get`) to see open work across all audit instances.
2. Pick an instance with open conflicts; list them (`audit_question_conflict_list`).
3. Inspect a conflict (`audit_question_conflict_get`) — read the conflicting excerpts and the source documents.
4. Record the expert answer (`audit_question_conflict_set_answer`); the platform generates per-document modification recommendations inline.
5. Confirm modifications were applied in the source system; close the conflict (`audit_question_conflict_close`) — or, if the conflict is a false positive that needs no change, mark it ignored (`audit_question_conflict_ignore`).

```mermaid
flowchart LR
    A[Dashboard<br/>audit_dashboard_get] --> B[List conflicts<br/>audit_question_conflict_list]
    B --> C[Inspect conflict<br/>audit_question_conflict_get]
    C --> D[Set expert answer<br/>audit_question_conflict_set_answer]
    D --> E[Close conflict<br/>audit_question_conflict_close]
```

The same five-step shape applies to the broader-scope "full-audit" review (whose operations live under `audit_full_audit_conflict_*`), to mandatory-question follow-ups, and to missing-subject clusters.

## Who uses K-AI Audit

* **Document Steward** — daily, via the K-AI Audit web app or MCP. The Steward animates the workflow: triages the dashboard, dispatches mandatory questions to Producers, resolves conflicts, marks duplicates managed, and decides on missing subjects.
* **Document Producer** — occasional, via mandatory-question prompts surfaced by the Steward. Producers are the SMEs whose authoritative answers feed the Document Products.
* **AI agent** — programmatic, via the Audit MCP. Agents typically run batch triage, propose draft expert answers, or generate companion documents for missing subjects, leaving final validation to a human Steward.

See [Roles model](/knowledge-ai/the-k-ai-platform/roles.md) for the full DKP role definitions.

## Surfaces

* **K-AI Audit web app (browser)** — the full UX for daily Steward work, at `https://app.kai-studio.ai`. See [K-AI Audit web app](/knowledge-ai/k-ai-audit/audit-ui.md).
* **Audit REST API** — **48 operations** across 8 domains: instances, documents & indexation, duplicates, mandatory questions, questions & answers, conflicts, missing subjects, stats. Base URL `https://api-audit.kai-studio.ai`. See [Instances](/knowledge-ai/k-ai-audit/api-reference/instances.md) and the following API reference pages.
* **Audit MCP** — **21 curated tools**. A conflict-first subset of the REST surface, exposed at `https://api-audit.kai-studio.ai/mcp`. See the [MCP tool catalog](/knowledge-ai/k-ai-mcp/audit-tools.md) and the [schema stability policy](/knowledge-ai/k-ai-mcp/schema-stability.md).

## Base URL & conventions

* **Base URL:** `https://api-audit.kai-studio.ai`
* **Auth:** Bearer JWT (MCP and direct API) or `kai_auth` HttpOnly cookie (K-AI Audit web app). See [OAuth 2.1](/knowledge-ai/authentication/oauth.md) and [Cookies](/knowledge-ai/authentication/cookies.md).
* **Methods:** all `POST`, JSON request body.
* **Response shape:** every successful response is wrapped as `{"response": <payload>}`.
* **`operation_id` convention:** `audit_<domain>_<action>` (e.g. `audit_instance_get`, `audit_question_conflict_set_answer`). Used as the MCP tool name when exposed.
* **Errors:** standard HTTP status codes; body `{"detail": "<message>"}`.
