Agents
An agent in Riyaan is an AI-powered voice assistant that can hold conversations, call tools, and hand off to humans when needed.
Runtimes
Each agent runs on a runtime — currently Riyaan supports the pi runtime backed by Gemini multimodal models. Runtimes handle:
- Audio input/output via LiveKit
- Tool execution and function calling
- Provider fallback and context recovery
- Session state management
Sessions
A session represents a single agent conversation. When you create a session via POST /api/agents/session, Riyaan:
- Provisions a runtime instance
- Loads the app's persona, guardrails, and tools
- Returns a
sessionIdfor tracking
Sessions persist across reconnects — the agent remembers the conversation context.
Runs
Each turn in a session produces a run record containing:
- Provider and model used
- Timing information (TTFB, total duration)
- Token counts
- Fallback and recovery metadata
Use GET /api/agents/session/runs to inspect run history for debugging.
Multi-provider fallback
Automatic failover
If the primary provider fails, the runtime automatically falls back to alternative providers. Run records capture which provider ultimately served each turn.
Last updated on