Logic and structure overview
Status: implemented for Go runtime primitives; partial for all LiveKit patterns.
Use this section when your agent needs more structure than one instruction string and one model call.
The runtime is organized around three primary objects:
Agentholds instructions, model providers, tools, chat context, and runtime policy.AgentSessioncoordinates activity, turn handling, generation, speech, state, and room I/O.AgentActivitybinds an agent implementation to a running session.
For most applications, create the app through app.Init and then update the configured agent/session. Use low-level constructors only in tests, examples, or custom composition code.
Pick the right structure
- Use chat context when the model needs prior conversation or tool-call state.
- Use tools when the model should call Go code.
- Use
Run,GenerateReply, orSayfor text-driven session actions. - Use
UpdateAgentwhen a session should switch to a different agent implementation. - Use beta workflow helpers only when their current source matches your task.
LiveKit docs include broader named patterns such as supervisor orchestration. In rtp-agent, those are documented as unavailable unless a source package and tests implement them.
Evidence:
core/agent/agent.gocore/agent/agent_session.gocore/agent/agent_activity.gocore/beta/workflows