LiveKit + Supabase: build a voice agent with memory

Build a voice agent that remembers users across calls, with Supabase auth, Postgres hybrid search, and matching TypeScript and Python starters.

Player not loading? Watch on YouTube

This tutorial connects a LiveKit voice AI agent to Supabase so it can retain user facts between calls. The demo stores a favorite color, recalls it after a page reload, and updates the existing memory. A separate incognito session gets its own user identity and data.

The starter uses LiveKit Cloud over WebRTC and Supabase for storage, authentication, and search. It includes matching TypeScript and Python agents; the walkthrough follows TypeScript. This setup requires Supabase and LiveKit Cloud projects, even when the agent runs locally.

The speaker explains how anonymous authentication supplies a user ID without an email login. The server verifies the session before passing that ID through dispatch metadata, while Row Level Security restricts access to each user's rows.

The code walkthrough covers knowledge retrieval with pgvector, memory updates through an upsert, and hybrid vector and full-text search combined with Reciprocal Rank Fusion. Memory search falls back to text if embeddings fail. A Supabase Edge Function runs gte-small for both seed data and live queries. The agent also preloads profiles and memories, accesses backend records through function tools, and saves a structured report when a call ends.

Setup covers linking the CLI, deploying the schema and embedding function, seeding data, enabling anonymous sign-ups, and adding API keys. LiveKit's hosted console can connect directly to the local agent during development.