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

# Voice Agent (LiveKit)

> Ground a LiveKit voice agent in your Moss index for real-time retrieval.

LiveKit provides the real-time audio pipeline (speech-to-text, LLM, text-to-speech); Moss
supplies retrieval. The agent loads a Moss index (and optionally opens a session for the live
conversation), then queries it in-process to ground its answers - each lookup is a local call,
not a network request.

## Pipeline

<div className="docs-diagram-frame">
  <img src="https://mintcdn.com/moss-afcfb0b6/qKHE-zU1VqxhLNDK/images/diagrams/voice-agent-livekit-light.svg?fit=max&auto=format&n=qKHE-zU1VqxhLNDK&q=85&s=6b53d2e180b30870c6a709180c1d7f83" alt="Voice agent pipeline from mic to speech-to-text, Moss retrieval, LLM, and speaker" className="docs-diagram-wide mint-block dark:mint-hidden" noZoom width="904" height="77" data-path="images/diagrams/voice-agent-livekit-light.svg" />

  <img src="https://mintcdn.com/moss-afcfb0b6/qKHE-zU1VqxhLNDK/images/diagrams/voice-agent-livekit-dark.svg?fit=max&auto=format&n=qKHE-zU1VqxhLNDK&q=85&s=8858b7b6e293775c3d94081e05a91a39" alt="Voice agent pipeline from mic to speech-to-text, Moss retrieval, LLM, and speaker" className="docs-diagram-wide mint-hidden dark:mint-block" noZoom width="904" height="77" data-path="images/diagrams/voice-agent-livekit-dark.svg" />
</div>

## Two ways to build it

<CardGroup cols={2}>
  <Card title="LiveKit integration (DIY)" icon="microphone" href="/docs/integrations/livekit">
    Add Moss to your own LiveKit agent: load a knowledge index, open a per-call session, and
    expose search as function tools. Full, copy-pasteable recipe.
  </Card>

  <Card title="Managed Voice Agents" icon="headset" href="/docs/voice-agents/voice-agents">
    Let Moss host the agent: the Agent SDK, backend token minting, and the deploy CLI.
  </Card>
</CardGroup>

<Note>
  Prefer to start from a working app? Clone the
  [LiveKit voice agent sample](https://github.com/usemoss/moss/tree/main/apps/livekit-moss-vercel/livekit-voice-agent/livekit-moss-agent)
  and add your own keys.
</Note>

## How retrieval fits

* Load a Moss index into memory at start; retrieval then runs in-process (single-digit ms).
* For live conversation memory, open a [session](/docs/integrate/sessions) and index transcript
  turns as they arrive - see [Live-call context](/docs/build/live-call-context).
* Expose retrieval to the LLM as a function tool so it searches only when it needs to.

## Related

<CardGroup cols={2}>
  <Card title="Live-call context" icon="phone" href="/docs/build/live-call-context">
    Short-term session context plus long-term knowledge during a call.
  </Card>

  <Card title="Sub-10ms knowledge retrieval" icon="gauge-high" href="/docs/build/offline-first-search">
    The load-then-query retrieval pipeline.
  </Card>
</CardGroup>
