LiveKit で AgentSession と Room はどう関係するか
Question
LiveKit の学習では Room / Participant / Track と、AgentSession が別々に出てくる。AgentSession は Room の一部なのか、それとも別物なのか。
Answer
AgentSession と Room は密接に結びつくが、同一ではない。Room は通信空間、AgentSession はその空間内で進行する対話実体 と捉えるのがわかりやすい。
Room は LiveKit の transport / media の場であり、Participant や Track が存在する基盤である。ユーザー音声やテキスト、Agent の出力も、この空間を通じてやり取りされる。
一方 AgentSession は、その Room に接続した Agent が、STT, LLM, TTS, turn handling, tools, hooks などを束ねながら会話を継続するための論理的な中核である。つまり Room は「場」、AgentSession は「その場で進行する対話の頭脳と状態管理」に近い。
この切り分けにより、次のように考えられる。
- Room: 参加者とメディアが流れる空間
- Participant / Track: Room 内の主体とメディア要素
- AgentSession: Agent が Room を使って対話する時の会話管理レイヤ
Evidence / Linked Notes
Follow-up Questions
- RoomIO は AgentSession と Room の橋渡しをどう抽象化しているか
- Front-desk sample で Room 接続と session 構築はどの順で起きるか