LiveKit voice agents
Add persistent memory to LiveKit voice agents using the zep-livekit package.
The zep-livekit
package provides seamless integration between Zep and LiveKit voice agents. Choose between user-specific conversation memory or structured knowledge graph memory for intelligent context retrieval in real-time voice interactions.
Install dependencies
Environment setup
Set your API keys as environment variables:
Agent types
ZepUserAgent: Uses user threads for conversation memory with automatic context injection
ZepGraphAgent: Accesses structured knowledge through custom entity models
User memory agent
Automatic Memory Integration: ZepUserAgent automatically captures voice conversation turns and injects relevant context from previous conversations, enabling natural continuity across voice sessions.
ZepUserAgent configuration
The ZepUserAgent
supports several parameters for customizing memory behavior:
Parameters:
context_mode
: Controls how memory context is retrieved ("basic"
for detailed context,"summary"
for condensed)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 instructions
Knowledge graph agent
Graph Memory Context: ZepGraphAgent automatically extracts structured knowledge from voice conversations and injects relevant facts and entities as context for more intelligent responses.
Room-based memory isolation
LiveKit rooms provide natural memory isolation boundaries:
Voice-specific considerations
Turn Management: Voice conversations have different turn dynamics than text chat. Zep automatically handles:
- Overlapping speech detection
- Turn boundary identification
- Context window management for real-time responses
Memory Persistence: Key voice interaction details are preserved:
- Speaker identification
- Conversation topics and themes
- User preferences expressed through voice
- Temporal relationships between topics