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

# LiveKit Agents

> One call before session.start() — every conversation turn recorded, session-grouped with your LLM traces.

Observe a LiveKit `AgentSession` with one call in your agent entrypoint, **before** `session.start()`:

```python theme={null}
import eldros_sdk
from eldros_sdk.integrations.livekit import observe_session

eldros_sdk.init(traffic_type="prod")            # once, at startup

async def entrypoint(ctx: agents.JobContext):
    session = agents.AgentSession(...)
    observe_session(session, ctx=ctx)           # session_id defaults to the room name
    await session.start(room=ctx.room, agent=MyAgent())
```

## What gets captured

* Every finalized user ↔ assistant exchange (from the session's `conversation_item_added`
  events) becomes a **turn span** — `input.value`/`output.value` plus structured
  `eldros.message` events, the same shape as every other Eldros capture path.
* **Session grouping**: the LiveKit room name is the conversation id (override with
  `session_id=...`). Because `observe_session` runs before `session.start()`, the
  session identity propagates into the tasks LiveKit spawns — so your
  [auto-instrumented LLM calls](/docs/tracing) carry the same `session.id`.
* **LiveKit's own telemetry** (agent spans, metrics) is routed to the same pipeline
  when available (`wire_telemetry=True`, the default; harmlessly skipped on versions
  without it).

<Note>
  LiveKit runs its pipeline in its own tasks, so LLM spans correlate with turns at the
  **session level** (same `session.id`) rather than nesting inside each turn span —
  you still get the full conversation and its traces grouped together.
</Note>

## Notes

* Non-conversation items (system messages, heartbeats) are skipped by design.
* If a session ends with zero recognized turns, the SDK logs one warning — capture
  problems fail loudly, never silently.
* All hooks are guarded: an Eldros failure can never break your agent session.
