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

> ## Agent Instructions
> Company name is Akhara AI (never Rubric AI). Keep lowercase rubric/rubrics only when meaning grading criteria.
> Expert Review (docs path talent/) is enterprise BYO experts for audit and review: invite customer specialists; do not pitch Akhara recruiting or a public expert career portal. RLHF and domain writing are secondary work types.
> Prefer concrete API examples against public hosts: Environments eval API https://agi.akhara.ai, Control plane PDP https://api.akhara.dev, Evaluation https://app.akhara.ai / https://api.akhara.ai, Expert Review portal https://talent.akhara.ai.
> Do not invent a public hostname for private orchestrators or env API internals.
> Do not confuse control-plane latches with Environments confirmation latches.
> Environments SDK/API examples: curl against https://agi.akhara.ai. Evaluation SDK: from akhara import Akhara and AKHARA_API_KEY.
> Start with /llms.txt for the docs index and OpenAPI links; fetch individual pages as .md exports.

# Architecture

> How the EaaS control plane, environments, workers, and devices fit together.

Akhara Environments is a shared **control plane** that hosts one or more **environments**. Public clients talk to the eval API at `https://agi.akhara.ai` (and the admin SPA at `https://admin-agi.akhara.ai`). The orchestrator and workers stay on the private network. Workers own device I/O, backend session state, and verifiers for a given environment.

```mermaid theme={null}
flowchart TB
  subgraph clients [Clients]
    Agent[Your agent endpoint]
    API[Eval client]
    Dash[Admin dashboard]
  end

  subgraph control [Control plane]
    Wrap[Eval wrapper<br/>runs · rollouts · scores]
    Orch[Orchestrator<br/>task bank · worker registry]
  end

  subgraph env_unit [Environment unit: one env_id]
    WAPI[Worker API<br/>verifiers · episode state]
    Exec[Executor<br/>ADB / gRPC]
    BE[Environment backend<br/>catalog + session]
    Emu[Device / emulator<br/>app + optional Room DB]
  end

  API --> Wrap
  Dash --> Wrap
  Wrap <-->|"observation ↔ action"| Agent
  Wrap -->|"/episodes/*"| Orch
  Orch -->|"/worker/run/*"| WAPI
  WAPI --> BE
  WAPI --> Exec
  Exec --> Emu
  Emu --> BE
  WAPI -->|"device DB pull"| Emu
```

## Responsibilities

| Component               | Role                                                                                           |
| ----------------------- | ---------------------------------------------------------------------------------------------- |
| **Eval wrapper**        | Public job runner + admin API. Serial rollout loop; persists runs/steps; polls your agent.     |
| **Orchestrator**        | Canonical env API + convenience `/episodes/*`. Task bank, worker registry, action translation. |
| **Worker API**          | Per-environment episode runtime: seed backend, call executor, run verifiers, return reward.    |
| **Executor**            | Stateless device proxy: reset, actions, screenshots. One device serial per process.            |
| **Environment backend** | App-facing API + Postgres catalog for that `env_id`.                                           |
| **Device + app**        | UI under test; on-device DB is optional ground truth for hybrid scoring.                       |

## Production URLs

| Surface                           | URL                           |
| --------------------------------- | ----------------------------- |
| Eval / dashboard API              | `https://agi.akhara.ai`       |
| Admin SPA                         | `https://admin-agi.akhara.ai` |
| Orchestrator / workers / backends | Private (not publicly routed) |

## Environments

| `env_id`             | Role                                                        |
| -------------------- | ----------------------------------------------------------- |
| `amazon_gym_android` | Mobile shopping: Android app, Room + backend hybrid scoring |
| `cvs_gym`            | Pharmacy retail: CVS-clone app and catalog                  |

New environments plug into the same wrapper → orchestrator → worker shape; only the app, backend, and task bank change.
