LiveKit voice agents
Add persistent memory to LiveKit voice agents using the zep-livekit package.
Add persistent memory to LiveKit voice agents using the zep-livekit package.
The zep-livekit package integrates Zep with LiveKit voice agents for context retrieval in real-time voice interactions. Choose between user-specific conversation memory or structured knowledge graph memory.
Version Requirements: This integration requires LiveKit Agents v1.0+ (not v0.x). The examples use the current AgentSession API pattern introduced in v1.0.
Set your API keys as environment variables:
ZepUserAgent: Uses user threads for conversation memory with automatic context injection
ZepGraphAgent: Accesses structured knowledge through custom entity models
Automatic Memory Integration: ZepUserAgent automatically captures voice conversation turns and injects relevant context from previous conversations, enabling natural continuity across voice sessions.
The ZepUserAgent supports several parameters for customizing memory behavior:
Parameters:
user_message_name: Optional name for attributing user messages in Zep memoryassistant_message_name: Optional name for attributing assistant messages in Zep memoryinstructions: System instructions that override the default LiveKit agent instructionsSearch Filters: The search_filters parameter allows you to constrain which entities the agent considers when retrieving context. Use node_labels to filter by specific entity types defined in your ontology.
Graph Memory Context: ZepGraphAgent automatically extracts structured knowledge from voice conversations and injects relevant facts and entities as context for responses grounded in prior conversations.
LiveKit rooms provide natural memory isolation boundaries:
Turn Management: Voice conversations have different turn dynamics than text chat. Zep automatically handles:
Memory Persistence: Key voice interaction details are preserved: