# Long-term memory for LiveKit Agents — livekit-memorysync

**URL:** <https://community.livekit.io/t/long-term-memory-for-livekit-agents-livekit-memorysync/1949>\
**Category:** Agents\
**Tags:** agent-development\
**Created:** [August 30, 2026, 7:04pm UTC](https://community.livekit.io/t/long-term-memory-for-livekit-agents-livekit-memorysync/1949 "2026-08-30T19:04:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammed\_Rafay\_Shafiuddin](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/mohammed_rafay_shafiuddin/32/2375_2.png) [@Mohammed\_Rafay\_Shafiuddin](https://community.livekit.io/u/Mohammed_Rafay_Shafiuddin)\
**Post date:** [August 30, 2026, 7:04pm UTC](https://community.livekit.io/t/long-term-memory-for-livekit-agents-livekit-memorysync/1949/1 "2026-08-30T19:04:25Z")

</div>

Hi everyone — we just released livekit-memorysync, a small package that gives LiveKit voice agents long-term memory backed by MemorySync ([https://memorysync.io](https://memorysync.io)). Tell the agent something, hang up, call back — it remembers.

Voice is the one surface where memory latency is audible, so the whole design centers on one rule: recalled context is injected in on\_user\_turn\_completed under a hard time budget (default 1.2 s). If memory is slow, the reply proceeds without it — the conversation never stalls. A background prefetch warms the next turn, so the steady-state cost is ~0 ms.

Highlights:

- Both-role capture via conversation\_item\_added (user AND assistant turns, with interruption metadata)
- Deterministic idempotency seeds — retries and reconnects never duplicate memories
- A search\_memory tool the LLM can call for explicit lookups (“what did I tell you last week?”)
- Failure-proof: outages and quota limits degrade to “no memories this turn”, never a broken call

Install: pip install livekit-memorysync  
Docs: [LiveKit Voice Memory | MemorySync Docs](https://docs.memorysync.io/guides/livekit)

We also opened a PR adding a runnable example to python-agents-examples (#93). Feedback very welcome!

---

<div class="post-metadata">

**Author:** ![discourse\_ai\_spam](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@discourse\_ai\_spam](https://community.livekit.io/u/discourse_ai_spam)\
**Post date:** [August 30, 2026, 7:04pm UTC](https://community.livekit.io/t/long-term-memory-for-livekit-agents-livekit-memorysync/1949/2 "2026-08-30T19:04:27Z")

</div>

Unlisted on August 30, 2026, 7:04pm UTC



---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/system/32/26_2.png) [@system](https://community.livekit.io/u/system)\
**Post date:** [August 31, 2026, 12:34pm UTC](https://community.livekit.io/t/long-term-memory-for-livekit-agents-livekit-memorysync/1949/3 "2026-08-31T12:34:49Z")

</div>

Listed on August 31, 2026, 12:34pm UTC



---

<div class="post-metadata">

**Author:** ![darryncampbell](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/darryncampbell/32/20_2.png) [@darryncampbell](https://community.livekit.io/u/darryncampbell)\
**Post date:** [August 31, 2026, 12:37pm UTC](https://community.livekit.io/t/long-term-memory-for-livekit-agents-livekit-memorysync/1949/4 "2026-08-31T12:37:49Z")

</div>

> [@Mohammed\_Rafay\_Shafiuddin](#):
>
> We also opened a PR adding a runnable example to python-agents-examples (#93)

I don’t think that repository would accept a demo that depended on a third party plugin, but if you can point to a separate repo (or a fork) here, it would be helpful 🙌

---

<div class="post-metadata">

**Author:** ![Mohammed\_Rafay\_Shafiuddin](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/mohammed_rafay_shafiuddin/32/2375_2.png) [@Mohammed\_Rafay\_Shafiuddin](https://community.livekit.io/u/Mohammed_Rafay_Shafiuddin)\
**Post date:** [August 31, 2026, 3:51pm UTC](https://community.livekit.io/t/long-term-memory-for-livekit-agents-livekit-memorysync/1949/5 "2026-08-31T15:51:21Z")

</div>

We’ve moved the runnable example into its own repo:

> **[GitHub - memorysyncio/livekit-memorysync-example: Runnable LiveKit Agents voice agent with long-term...](https://github.com/memorysyncio/livekit-memorysync-example)**
>
> Runnable LiveKit Agents voice agent with long-term memory backed by MemorySync - remembers callers across calls

It’s the complete voice agent from the PR: per-turn memory injection inside `on_user_turn_completed` under a hard 1.2 s latency budget (a slow memory service can never stall the call), both-side turn capture with idempotent retries, and an on-demand memory search tool. `pip install -r requirements.txt`, add LiveKit + MemorySync keys to `.env`, and `python memorysync_memory.py console` — tell it your name, restart the session, and it remembers.

Happy to close #93 in favour of this repo if that’s the preferred route. 🙌

---

<div class="post-metadata">

**Author:** ![darryncampbell](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/darryncampbell/32/20_2.png) [@darryncampbell](https://community.livekit.io/u/darryncampbell)\
**Post date:** [September 1, 2026, 8:04am UTC](https://community.livekit.io/t/long-term-memory-for-livekit-agents-livekit-memorysync/1949/6 "2026-09-01T08:04:15Z")

</div>

Thank you, & I see you already closed #93 🙌 I edited the above post slightly and made it the solution so anyone finding this post in the future has everything in the same place.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/system/32/26_2.png) [@system](https://community.livekit.io/u/system)\
**Post date:** [September 3, 2026, 8:04am UTC](https://community.livekit.io/t/long-term-memory-for-livekit-agents-livekit-memorysync/1949/7 "2026-09-03T08:04:23Z")

</div>

Closed on September 3, 2026, 8:04am UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
