microscopic-dinner-57620
02/17/2026, 1:33 PMtall-airline-16756
02/17/2026, 1:33 PMtall-airline-16756
02/17/2026, 1:33 PMsession.history is a chronological list of all conversation items (user messages, tool calls, and tool outputs). The latest message is the last item in that list, so read the final element of session.history.
• Use `on_user_turn_completed`: inside an agent, the on_user_turn_completed lifecycle method receives a new_message parameter that represents the user’s most recent message. This method runs before the agent generates a response, so it’s a convenient place to access the latest input.
If you need to access the conversation state from inside tool execution, the tool’s RunContext provides access to the session (and therefore session.history) so you can inspect the latest item there as well.
Would you like a short code example showing: 1) how to read the last item from session.history, or 2) how to use on_user_turn_completed or RunContext inside a tool?
Sources: External data and RAG | LiveKit Documentation | Pipeline nodes and hooks | LiveKit Documentation | Building multi-agent architectures with LiveKit agents | LiveKitmicroscopic-dinner-57620
02/17/2026, 1:40 PMtall-airline-16756
02/17/2026, 1:41 PM