Full CodeThis tutorial demonstrates how to build a voice agent with long-term memory using Memobase and LiveKit. This combination is ideal for applications like AI companions, customer support bots, and more.
LIVEKIT_URL
, API_KEY
, and API_SECRET
from the LiveKit Cloud Console.DEEPGRAM_API_KEY
from the Deepgram Console.livekit.agents.Agent
class and overriding the llm_node
method to inject memory context from Memobase.
llm_node
method. This method is called just before the chat history is sent to the LLM. Here, we will retrieve the user’s memory from Memobase and add it to the system prompt.
rag_context
string will contain the user’s profile and recent events, formatted and ready to be used by the LLM.