Is there a limit like the last 5 messages in memor...
# ask-ai
c
Is there a limit like the last 5 messages in memory?
t
Thanks for reaching out, Eray. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking whether LiveKit Agents only keep the last 5 messages in memory. No — LiveKit Agents do not automatically limit memory to the last five messages. Each AgentSession starts with an empty chat context, but the full conversation history for that session is preserved and available through
session.history
. Messages added during a user turn via
on_user_turn_completed
are not persisted automatically beyond that turn unless you explicitly save them with
update_chat_ctx
. For long-term or cross-session memory you can integrate external stores (e.g., Letta, LlamaIndex, Mem0). Would you like instructions for reading/writing
session.history
or for integrating an external memory store? Sources: Agents and handoffs | LiveKit docs | Pipeline nodes and hooks | LiveKit docs | External data and RAG | LiveKit docs