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

# Welcome to Roark

> The quality platform for voice and chat AI

Roark is where voice and chat agents prove they're ready: **simulate** every failure mode before launch, **analyze** every production call once you're live, and score them all with metrics powered by **Roark Prism**, our purpose-built evaluation model.

<CardGroup cols={2}>
  <Card title="Simulation testing" icon="activity" href="/documentation/simulation-testing/overview">
    Break it in staging, not in production. Test agents with synthetic callers across flows, personas, accents, and edge cases before you ship.
  </Card>

  <Card title="Post-call analysis" icon="audio-lines" href="/documentation/observability/overview">
    Every production call scored, filed, and traced. Transcribed and measured against your metrics in real time.
  </Card>

  <Card title="Human review" icon="clipboard-check" href="https://roark.ai/product/human-review">
    Label calls, set ground truth, and align every metric with your team's judgment.
  </Card>

  <Card title="Self-improving agents" icon="sparkles" href="https://roark.ai/product/self-improvement">
    From caught issue to drafted fix to proven deploy, with you in the loop.
  </Card>
</CardGroup>

***

## Your first simulation

Pick a path. Each one takes you from nothing to a running simulation, reusing a built-in persona and environment so there's nothing extra to set up.

<Tabs>
  <Tab title="Node SDK">
    Copy, paste, run with [`@roarkanalytics/sdk`](/documentation/sdks/node-sdk):

    ```typescript theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
    import Roark from '@roarkanalytics/sdk'

    const client = new Roark({ bearerToken: process.env.ROARK_API_BEARER_TOKEN })

    // An agent and how to reach it
    const agent = await client.agent.create({ name: 'Front Desk' })
    const endpoint = await client.agentEndpoint.create({
      agentId: agent.data.id,
      value: '+15551234567',
      direction: 'INCOMING_AND_OUTGOING',
    })

    // Reuse a built-in persona and the "Quiet line" environment
    const personas = await client.simulationPersona.list({ limit: 50 })
    const envs = await client.simulationEnvironment.list({ limit: 50 })
    const quietLine = envs.data.find((e) => e.name === 'Quiet line')!

    // The conversation to test
    const flow = await client.customerFlow.create({
      type: 'IMPROV',
      title: 'Rebooking',
      agentIds: [agent.data.id],
      happyPath: {
        title: 'Frustrated rebooking',
        personaOverrideId: personas.data[0].id,
        environmentId: quietLine.id,
        prompt: 'You call to rebook a cleaning that was cancelled on you.',
      },
      agentExpectations: [{ prompt: 'Agent offers a concrete alternative appointment time' }],
    })

    // Run it
    const run = await client.simulation.run({
      plan: {
        direction: 'INBOUND',
        maxSimulationDurationSeconds: 300,
        agentEndpoints: [{ id: endpoint.data.id }],
        flows: [{ id: flow.data.id, happyPath: true }],
        metrics: [{ slug: 'task_completion' }],
      },
    })

    console.log(run.data.simulationRunPlanJobId)
    ```

    Watch it in the dashboard, or poll `client.simulationRunPlanJob.getByID(run.data.simulationRunPlanJobId)`.
  </Tab>

  <Tab title="Python SDK">
    Same flow with [`roark_analytics`](/documentation/sdks/python-sdk):

    ```python theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
    import os
    from roark_analytics import Roark

    client = Roark(bearer_token=os.environ["ROARK_API_BEARER_TOKEN"])

    # An agent and how to reach it
    agent = client.agent.create(name="Front Desk")
    endpoint = client.agent_endpoint.create(
        agent_id=agent.data.id,
        value="+15551234567",
        direction="INCOMING_AND_OUTGOING",
    )

    # Reuse a built-in persona and the "Quiet line" environment
    personas = client.simulation_persona.list(limit=50)
    envs = client.simulation_environment.list(limit=50)
    quiet_line = next(e for e in envs.data if e.name == "Quiet line")

    # The conversation to test
    flow = client.customer_flow.create(
        type="IMPROV",
        title="Rebooking",
        agent_ids=[agent.data.id],
        happy_path={
            "title": "Frustrated rebooking",
            "personaOverrideId": personas.data[0].id,
            "environmentId": quiet_line.id,
            "prompt": "You call to rebook a cleaning that was cancelled on you.",
        },
        agent_expectations=[{"prompt": "Agent offers a concrete alternative appointment time"}],
    )

    # Run it
    run = client.simulation.run(
        plan={
            "direction": "INBOUND",
            "maxSimulationDurationSeconds": 300,
            "agentEndpoints": [{"id": endpoint.data.id}],
            "flows": [{"id": flow.data.id, "happyPath": True}],
            "metrics": [{"slug": "task_completion"}],
        },
    )

    print(run.data.simulation_run_plan_job_id)
    ```
  </Tab>

  <Tab title="CLI">
    Drive the same steps from your terminal (install the [CLI](/documentation/sdks/cli) and set `ROARK_API_BEARER_TOKEN`). Commands print JSON, so pipe through `jq`:

    ```bash theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
    AGENT_ID=$(roark agent create --name "Front Desk" | jq -r '.data.id')

    ENDPOINT_ID=$(roark agent endpoint create --agent-id "$AGENT_ID" \
      --value "+15551234567" --direction INCOMING_AND_OUTGOING | jq -r '.data.id')

    PERSONA_ID=$(roark simulation persona list --limit 50 | jq -r '.data[0].id')
    ENV_ID=$(roark simulation environment list --limit 50 \
      | jq -r '.data[] | select(.name=="Quiet line") | .id')

    FLOW_ID=$(roark customer-flow create --data "$(jq -nc \
      --arg a "$AGENT_ID" --arg p "$PERSONA_ID" --arg e "$ENV_ID" '{
        type:"IMPROV", title:"Rebooking", agentIds:[$a],
        happyPath:{ title:"Frustrated rebooking", personaOverrideId:$p, environmentId:$e,
          prompt:"You call to rebook a cleaning that was cancelled on you." }
      }')" | jq -r '.data.id')

    roark simulation run --data "$(jq -nc --arg ep "$ENDPOINT_ID" --arg f "$FLOW_ID" '{
      plan:{ direction:"INBOUND", maxSimulationDurationSeconds:300,
        agentEndpoints:[{id:$ep}], flows:[{id:$f, happyPath:true}],
        metrics:[{slug:"task_completion"}] }
    }')"
    ```
  </Tab>

  <Tab title="Config as Code">
    Keep your test suite in git as YAML and apply it with the [CLI](/documentation/sdks/cli):

    ```yaml roark/flows/rebooking.yaml theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
    kind: flow
    type: improv
    name: rebooking
    agents: [frontdesk]
    happyPath:
      persona: frustrated-caller
      environment: Quiet line
      prompt: You call to rebook a cleaning that was cancelled on you.
    expectations:
      - Agent offers a concrete alternative appointment time
    ```

    ```bash theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
    roark config apply ./roark
    ```

    Config defines your resources; launch a run from the CLI, an SDK, or the dashboard. Full example (agents + personas + flows) and how to run it in CI: **[Config as Code](/documentation/config-as-code/overview)** and **[CI/CD](/documentation/simulation-testing/ci-cd)**.
  </Tab>

  <Tab title="Dashboard">
    No code:

    1. **Connect your agent** under [Agents](/documentation/integrations/overview) (Vapi, Retell, ElevenLabs, LiveKit, and more).
    2. **Create a [customer flow](/documentation/simulation-testing/customer-flows)** for the conversation to test (pick a built-in [persona](/documentation/simulation-testing/personas)).
    3. **New Run**: pick the agent, attach the flow, add pass/fail [checks](/documentation/metrics/thresholds), launch.
    4. **Read the verdict** and per-conversation scores.
  </Tab>
</Tabs>

***

## Explore the docs

<CardGroup cols={2}>
  <Card title="Simulations" icon="activity" href="/documentation/simulation-testing/overview">
    Customer flows, personas, templates, plans, and schedules
  </Card>

  <Card title="Config as Code" icon="file-code" href="/documentation/config-as-code/overview">
    Define agents, personas, flows, metrics, collectors, and alerts as YAML in git
  </Card>

  <Card title="Observability" icon="audio-lines" href="/documentation/observability/overview">
    Call history, traces, reports, and dashboards
  </Card>

  <Card title="Metrics" icon="gauge" href="/documentation/metrics/overview">
    The metric library, Studio, collectors, and thresholds
  </Card>

  <Card title="Integrations" icon="plug" href="/documentation/integrations/overview">
    Vapi, Retell, ElevenLabs, Leaping, LiveKit, and custom
  </Card>

  <Card title="CLI" icon="square-terminal" href="/documentation/sdks/cli">
    Drive Roark from your terminal and CI pipelines
  </Card>

  <Card title="SDKs" icon="braces" href="/documentation/sdks/node-sdk">
    Node.js, Python, and MCP Server
  </Card>

  <Card title="API Reference" icon="terminal" href="/api-reference/introduction">
    REST API documentation
  </Card>
</CardGroup>
