supermemory/packages/livekit-sdk-python/examples/README.md
Ishaan Gupta 0e604c8384 fix(livekit): keep memory scoped to the caller and bound capture writes
From review of 5b2a435e:

- Captured turns now keep the container tag and document id they were
  spoken under. Rebinding the instance used to flush earlier turns into
  the new caller's scope. Turns captured before any bind still go to the
  first caller bound.
- Recall strips earlier injected memory before it runs, so a failed or
  empty recall can no longer leave another caller's memory in context.
  For the same caller, a slow or failed recall falls back to the profile
  loaded by preload.
- The recall cache is keyed on the user message, not its text, so a
  later turn with the same words recalls again.
- Capture writes time out after 10s and keep their turns for retry,
  including on cancellation. Large calls are written in chunks of at
  most 100k characters, and the buffer is capped.
- remember falls back to the default processing schedule when the
  organization has no balance for instant processing (HTTP 402).
- Docs state the measured delays: about a minute for remember, 10 to 20
  minutes for captured calls on the default dynamic schedule.
2026-10-02 00:35:38 +05:30

1.8 KiB

Voice agent example

A LiveKit voice agent that remembers each caller. Tell it something on one call, hang up, and it knows it on the next.

Setup

pip install supermemory-livekit python-dotenv
cp .env.example .env

Fill in .env with your LiveKit Cloud project keys and a Supermemory API key. LiveKit Inference provides speech-to-text, the LLM, and text-to-speech, so no other keys are needed.

From a checkout of this repo, install the local package instead: pip install -e .. python-dotenv.

Talk to it

In your terminal, through your mic:

python voice_agent.py console

In the browser: run python voice_agent.py dev, open the Agents Playground, and connect to your project.

Try memory

  1. Say "My name is Priya, and please remember I'm vegetarian."
  2. Hang up and start a new call.
  3. The agent welcomes you back. Ask "What should I order for dinner?"

Memory is scoped per caller:

  • Console mode uses the container tag console_user.
  • In rooms, the agent uses the participant attribute supermemory_container_tag, or else the participant identity. The Playground gives each session a new identity, so set SUPERMEMORY_CONTAINER_TAG in .env to keep one caller across Playground calls.
  • In production, dispatch the agent from your backend with {"container_tag": "<your user id>"} as job metadata, and set LIVEKIT_AGENT_NAME.

Each call is stored as one document. Facts the caller asks it to remember are usually recallable within a minute; the rest of the call takes longer, see when a call becomes recallable. See the integration docs for configuration.