billions-zoo-2710
03/30/2026, 6:18 AMtall-airline-16756
03/30/2026, 6:18 AMtall-airline-16756
03/30/2026, 6:19 AMconversation_item_added event.
Yes — you can access conversation_item_added from within an Agent by registering a listener on the agent’s session (the agent has a self.session reference). Handlers registered there will be called whenever a new item (message or function call) is added to the conversation history, and the event includes an item field with the message content, role, and type.
Example pattern you can use inside a custom Agent subclass:
class MyAgent(Agent):
async def on_enter(self):
@self.session.on("conversation_item_added")
def on_conversation_item_added(event):
# event.item contains the new message/function call and metadata
print(f"New item added: {event.item}")
If you’d like, tell me:
• the exact Agent subclass or lifecycle hook you’re using (e.g., on_enter, on_message) and
• whether you need the handler to perform async work (so I can show the proper async handler pattern). Sources: Text and transcriptions | LiveKit Documentation | Realtime model metrics | LiveKit Documentation, with interactive elements