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

# Platform Overview

> The components that make up Kair Voice and how they relate.

## Components

Kair Voice is built from a web app, an API and five background workers. A condensed
does / does-not view of every part lives in the repo at `docs/ONE_PAGER.md`.

<CardGroup cols={2}>
  <Card title="API" icon="server">
    The Rust backend. Handles all HTTP requests, authentication, session management, and job dispatch. Runs on port 8000. All routes live under `/api`.
  </Card>

  <Card title="Web App" icon="globe">
    The SvelteKit frontend. Moderators and admins use this to manage sessions, view transcripts, and configure the system.
  </Card>

  <Card title="Transcription Worker" icon="microphone">
    A background process that picks up audio jobs from the queue and produces transcripts. Can use a local Whisper model or the Foresight inference cluster.
  </Card>

  <Card title="Summarisation Worker" icon="file-lines">
    Produces a human-readable summary of the session using an LLM. Summaries are **user-triggered**, not automatic. The same worker also drains the summary-evaluation queue, scoring completed summaries for health.
  </Card>

  <Card title="HiRAG Worker" icon="diagram-project">
    Indexes the transcript into a knowledge graph (Neo4j). Powers the "ask questions across sessions" feature.
  </Card>

  <Card title="Document Worker" icon="file-arrow-up">
    Extracts text from uploaded documents, chunks it by page, summarises it, and hands it to HiRAG indexing. Documents are session-scoped or workspace-scoped (Content Library).
  </Card>

  <Card title="Moderator Agent Worker" icon="comments">
    Reads a rolling window of a live session's transcript on an interval and surfaces divergence, convergence and discussion intensity to the moderator dashboard. Run a single replica.
  </Card>
</CardGroup>

## Infrastructure at a glance

| Component           | Technology         | Purpose                                                        |
| ------------------- | ------------------ | -------------------------------------------------------------- |
| Primary database    | PostgreSQL         | All structured data — sessions, transcripts, users, workspaces |
| Job queue & pub/sub | Redis              | Dispatching transcription/summarisation jobs; WebSocket events |
| Knowledge graph     | Neo4j              | HiRAG entity graph for cross-session queries                   |
| File storage        | S3 (or local disk) | Raw audio files                                                |
| API framework       | Poem (Rust)        | OpenAPI-annotated HTTP routes                                  |
| Frontend            | SvelteKit          | Web UI                                                         |

## Environments

| Environment | URL                                            | Notes                            |
| ----------- | ---------------------------------------------- | -------------------------------- |
| Production  | `kair.is`                                      | Live, stable                     |
| Staging     | `staging.kair.is`                              | Deployed on every push to `main` |
| PR Preview  | `pr{N}.kair.is`                                | Spun up per pull request         |
| Local       | `localhost:8000` (API), `localhost:5173` (web) | Dev environment                  |

## Request path

```
Browser / Device
      ↓
  Traefik (reverse proxy)
      ↓
  API  (/api/...)
      ↓
  PostgreSQL  +  Redis (job push)
                    ↓
              Worker process
                    ↓
              PostgreSQL (result write)
                    ↓
              WebSocket broadcast → Browser
```
