Memory-augmented voice agent on LiveKit Agents. Recall caller history mid-call.
This recipe assumes upcoming SynapMemoryHook / SynapContextProvider exports from synap-livekit-agents. Until those ship, use preload_synap_context: see the integration’s README for the current API.
LiveKit Agents handles the audio plumbing (STT → LLM → TTS). Synap handles memory. The synap-livekit-agents integration wires them together with two callback hooks.
# pip install livekit-agents openai maximem-synap synap-livekit-agentsfrom livekit.agents import ( AutoSubscribe, JobContext, JobProcess, WorkerOptions, cli, llm,)from livekit.agents.voice_assistant import VoiceAssistantfrom livekit.plugins import openai, silero, deepgramfrom synap_livekit_agents import SynapMemoryHook, SynapContextProviderfrom maximem_synap import MaximemSynapSDKasync def entrypoint(ctx: JobContext): await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY) participant = await ctx.wait_for_participant() # Caller identity: map LiveKit room metadata to your stable user_id. # In production, sign this in your token-issuer service; never trust client-supplied IDs. user_id = participant.metadata.get("synap_user_id") or f"anon_{participant.identity}" customer_id = participant.metadata.get("synap_customer_id") or "default" sdk = MaximemSynapSDK(api_key=...) await sdk.initialize() # SynapContextProvider injects relevant memories into the system prompt # before each LLM call. SynapMemoryHook ingests every user-assistant turn # back into Synap after the assistant speaks. context_provider = SynapContextProvider( sdk=sdk, user_id=user_id, customer_id=customer_id, mode="fast", # latency-sensitive max_results=5, ) memory_hook = SynapMemoryHook( sdk=sdk, user_id=user_id, customer_id=customer_id, ) initial_ctx = llm.ChatContext().append( role="system", text=( "You are a friendly phone agent. Use any known facts about the caller from " "their memory context. Keep responses under 2 sentences for voice clarity." ), ) assistant = VoiceAssistant( vad=silero.VAD.load(), stt=deepgram.STT(), llm=openai.LLM(model="gpt-4o"), tts=openai.TTS(), chat_ctx=initial_ctx, before_llm_cb=context_provider.before_llm, # ← memory inject after_llm_cb=memory_hook.after_llm, # ← memory ingest ) assistant.start(ctx.room, participant)if __name__ == "__main__": cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
The two hooks
before_llm fetches relevant memories using the most recent user utterance as the search_query, and prepends them to the chat context as a system message. Latency-tuned for mode="fast" so it doesn’t add perceptible delay.
after_llm ingests the latest user + assistant turn as a single document with document_type="ai-chat-conversation". Runs in the background; doesn’t block the next TTS.
Latency budget for voiceVoice agents have a tight conversational comfort window. Synap’s fast retrieval is comfortably within voice-conversational budgets in typical deployments. If Synap calls feel slow in your environment, lower max_results (e.g., to 3) to trim retrieval work per turn.Privacy note for voiceThe full audio is processed by LiveKit + Deepgram. Synap only sees the text transcript that comes back from STT. If you’re under stricter privacy regimes, set the LiveKit recording flag to off and review the Security & Trust page.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Maximem Synap","description":"Agentic Context Management","colors":{"primary":"#F97316","light":"#FB923C","dark":"#EA580C"},"logo":{"light":"https://mintcdn.com/maximemai/SPYNqdr1ux3-6M5X/logo/light.svg?fit=max\u0026auto=format\u0026n=SPYNqdr1ux3-6M5X\u0026q=85\u0026s=3d97e9e6d78d58630c567324c4442134","dark":"https://mintcdn.com/maximemai/SPYNqdr1ux3-6M5X/logo/dark.svg?fit=max\u0026auto=format\u0026n=SPYNqdr1ux3-6M5X\u0026q=85\u0026s=05b696ab7b6b7941f2b2fca9ef22e96f","href":"https://docs.maximem.ai"},"favicon":{"light":"https://mintcdn.com/maximemai/9vY_tq7ZMQcuk3qQ/favicon.png?fit=max\u0026auto=format\u0026n=9vY_tq7ZMQcuk3qQ\u0026q=85\u0026s=c70baec828ea749010433a5cacc463a3","dark":"https://mintcdn.com/maximemai/9vY_tq7ZMQcuk3qQ/favicon.png?fit=max\u0026auto=format\u0026n=9vY_tq7ZMQcuk3qQ\u0026q=85\u0026s=c70baec828ea749010433a5cacc463a3"},"background":{"decoration":"grid"},"navbar":{"links":[{"href":"https://github.com/maximem-ai","label":"GitHub"},{"href":"https://discord.gg/synap","label":"Community"},{"href":"mailto:[email protected]","label":"Support"},{"href":"/resources/changelog","label":"Changelog"}],"primary":{"type":"button","label":"Dashboard","href":"https://synap.maximem.ai"}},"footer":{"socials":{"x":"https://twitter.com/maximem_ai","github":"https://github.com/maximem-ai","discord":"https://discord.gg/synap","linkedin":"https://www.linkedin.com/company/maximem-ai"}},"seo":{"metatags":{"robots":"index, follow","googlebot":"index, follow"},"indexing":"all"},"fonts":{"family":"Geist"},"styling":{"eyebrows":"section","latex":true},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"interaction":{"drilldown":false},"markdown":{"instructions":["Maximem Synap is a managed memory layer for AI agents: it ingests conversations and documents, extracts structured memory, and returns scoped context to the agent at retrieval time.","The Python and JavaScript/TypeScript SDKs are the supported way to use Synap. Write integration code with SDK calls, not raw HTTP requests.","Start with the Quickstart: https://docs.maximem.ai/getting-started/quickstart.md. Every SDK method is documented in the SDK reference: https://docs.maximem.ai/sdk-reference/overview.md.","For requests about adding Vity memory to OpenClaw, Hermes, an MCP client, or a browser, start with the Vity Quickstart: https://docs.maximem.ai/vity/quickstart.md."]},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"maximemai","hasAudioNarration":false,"actualSubdomain":"maximemai","customDomains":["docs.maximem.ai"],"gitSource":{"type":"github","owner":"maximem-ai","repo":"maximem_synap_dev_docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":false},"entitlements":{},"buildId":"6af47b35c0e883d57436cd47","clientVersion":"0.0.4167","searchFilterCounts":[{"language":"default","tag":"Synap","count":150},{"language":"default","tag":"Reference","count":49},{"language":"default","tag":"Integrations","count":26},{"language":"default","tag":"Guides","count":25},{"language":"default","tag":"Cookbook","count":21},{"language":"default","tag":"Agent frameworks","count":21},{"language":"default","tag":"Get Started","count":16},{"language":"default","tag":"Concepts","count":15},{"language":"default","tag":"Write memory","count":15},{"language":"default","tag":"Vity","count":15}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"patterns/voice-agent-livekit","slug":"/patterns/voice-agent-livekit","pageMetadata":{"title":"Voice Agent on LiveKit","sidebarTitle":"Voice agent on LiveKit","description":"Memory-augmented voice agent on LiveKit Agents. Recall caller history mid-call.","icon":"microphone","href":"/patterns/voice-agent-livekit"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Memory-augmented voice agent on LiveKit Agents. Recall caller history mid-call.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Warning,{children:_jsxs(_components.p,{children:[`This recipe assumes upcoming `,_jsx(_components.code,{children:`SynapMemoryHook`}),` / `,_jsx(_components.code,{children:`SynapContextProvider`}),` exports from `,_jsx(_components.code,{children:`synap-livekit-agents`}),`. Until those ship, use `,_jsx(_components.code,{children:`preload_synap_context`}),`: see the integration’s README for the current API.`]})}),`\n`,_jsxs(_components.p,{children:[`LiveKit Agents handles the audio plumbing (STT → LLM → TTS). Synap handles memory. The `,_jsx(_components.code,{children:`synap-livekit-agents`}),` integration wires them together with two callback hooks.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`64`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`64`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# pip install livekit-agents openai maximem-synap synap-livekit-agents`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` livekit.agents `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AutoSubscribe,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` JobContext,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` JobProcess,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` WorkerOptions,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cli,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` llm,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` livekit.agents.voice_assistant `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` VoiceAssistant`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` livekit.plugins `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai, silero, deepgram`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` synap_livekit_agents `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` SynapMemoryHook, SynapContextProvider`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` maximem_synap `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MaximemSynapSDK`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` entrypoint`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: JobContext):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ctx.connect(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`auto_subscribe`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`AutoSubscribe.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`AUDIO_ONLY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` participant `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ctx.wait_for_participant()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Caller identity: map LiveKit room metadata to your stable user_id.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # In production, sign this in your token-issuer service; never trust client-supplied IDs.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` user_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` participant.metadata.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"synap_user_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"anon_`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`participant.identity`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` customer_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` participant.metadata.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"synap_customer_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"default\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sdk `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MaximemSynapSDK(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sdk.initialize()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # SynapContextProvider injects relevant memories into the system prompt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # before each LLM call. SynapMemoryHook ingests every user-assistant turn`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # back into Synap after the assistant speaks.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` context_provider `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` SynapContextProvider(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` sdk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`sdk,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` customer_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`customer_id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` mode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fast\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# latency-sensitive`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_results`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory_hook `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` SynapMemoryHook(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` sdk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`sdk,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`user_id,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` customer_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`customer_id,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` initial_ctx `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` llm.ChatContext().append(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` role`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` text`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"You are a friendly phone agent. Use any known facts about the caller from \"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"their memory context. Keep responses under 2 sentences for voice clarity.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` assistant `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` VoiceAssistant(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` vad`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`silero.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`VAD`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.load(),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` stt`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`deepgram.STT(),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` llm`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`openai.LLM(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` tts`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`openai.TTS(),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` chat_ctx`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`initial_ctx,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` before_llm_cb`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`context_provider.before_llm, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# ← memory inject`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` after_llm_cb`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`memory_hook.after_llm, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# ← memory ingest`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` assistant.start(ctx.room, participant)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` __name__`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"__main__\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cli.run_app(WorkerOptions(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`entrypoint_fnc`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`entrypoint))`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`The two hooks`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`before_llm`}),` fetches relevant memories using the most recent user utterance as the `,_jsx(_components.code,{children:`search_query`}),`, and prepends them to the chat context as a system message. Latency-tuned for `,_jsx(_components.code,{children:`mode=\"fast\"`}),` so it doesn’t add perceptible delay.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`after_llm`}),` ingests the latest user + assistant turn as a single document with `,_jsx(_components.code,{children:`document_type=\"ai-chat-conversation\"`}),`. Runs in the background; doesn’t block the next TTS.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Latency budget for voice`})}),`\n`,_jsxs(_components.p,{children:[`Voice agents have a tight conversational comfort window. Synap’s `,_jsx(_components.code,{children:`fast`}),` retrieval is comfortably within voice-conversational budgets in typical deployments. If Synap calls feel slow in your environment, lower `,_jsx(_components.code,{children:`max_results`}),` (e.g., to 3) to trim retrieval work per turn.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Privacy note for voice`})}),`\n`,_jsxs(_components.p,{children:[`The full audio is processed by LiveKit + Deepgram. Synap only sees the text transcript that comes back from STT. If you’re under stricter privacy regimes, set the LiveKit recording flag to off and review the `,_jsx(_components.a,{href:`/resources/security-trust`,children:`Security \u0026 Trust`}),` page.`]}),`\n`,_jsx(Heading,{level:`2`,id:`going-further`,children:`Going further`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Integrations:`}),` `,_jsx(_components.a,{href:`/integrations/livekit-agents`,children:`LiveKit Agents`}),` · `,_jsx(_components.a,{href:`/integrations/pipecat`,children:`Pipecat`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cookbook:`}),` `,_jsx(_components.a,{href:`/cookbook/voice-concierge`,children:`Voice Concierge`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Patterns:`}),` `,_jsx(_components.a,{href:`/patterns/graceful-degradation`,children:`Graceful Degradation`})]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Voice Agent on LiveKit","sidebarTitle":"Voice agent on LiveKit","description":"Memory-augmented voice agent on LiveKit Agents. Recall caller history mid-call.","icon":"microphone","href":"/patterns/voice-agent-livekit"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Going further","slug":"going-further","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/maximemai/4efe2e9bc914449b/webmcp.js"],"subdomain":"maximemai","siteName":"Maximem Synap","title":"Voice Agent on LiveKit - Maximem Synap","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-15T21:32:11.967Z","originalFileLocation":"patterns/voice-agent-livekit.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Memory-augmented voice agent on LiveKit Agents. Recall caller history mid-call.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Maximem Synap\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Voice Agent on LiveKit - Maximem Synap\">\u003cmeta data-mint-head property=\"og:description\" content=\"Memory-augmented voice agent on LiveKit Agents. Recall caller history mid-call.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Maximem Synap\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.maximem.ai/patterns/voice-agent-livekit\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://maximemai.mintlify.site/_mintlify/api/og/v2?division=Patterns\u0026amp;title=Voice+Agent+on+LiveKit\u0026amp;description=Memory-augmented+voice+agent+on+LiveKit+Agents.+Recall+caller+history+mid-call.\u0026amp;theme=8d273a848d7d43e51587faec\u0026amp;signature=a0f4ce5db4a5de54c0b3bff16c9711c0759354610233e879bac426df2d5fd878\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Voice Agent on LiveKit - Maximem Synap\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Memory-augmented voice agent on LiveKit Agents. Recall caller history mid-call.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://maximemai.mintlify.site/_mintlify/api/og/v2?division=Patterns\u0026amp;title=Voice+Agent+on+LiveKit\u0026amp;description=Memory-augmented+voice+agent+on+LiveKit+Agents.+Recall+caller+history+mid-call.\u0026amp;theme=8d273a848d7d43e51587faec\u0026amp;signature=a0f4ce5db4a5de54c0b3bff16c9711c0759354610233e879bac426df2d5fd878\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/maximemai/MD073HG6TL_XNNyt/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Maximem Synap\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#F97316\">\u003cmeta data-mint-head name=\"googlebot\" content=\"index, follow\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.maximem.ai/patterns/voice-agent-livekit\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/patterns/voice-agent-livekit.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.maximem.ai/#organization\",\"name\":\"Maximem Synap\",\"url\":\"https://docs.maximem.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/maximemai/SPYNqdr1ux3-6M5X/logo/light.svg?fit=max\u0026auto=format\u0026n=SPYNqdr1ux3-6M5X\u0026q=85\u0026s=3d97e9e6d78d58630c567324c4442134\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.maximem.ai#website\",\"name\":\"Maximem Synap\",\"url\":\"https://docs.maximem.ai\",\"publisher\":{\"@id\":\"https://docs.maximem.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.maximem.ai/patterns/voice-agent-livekit#webpage\",\"url\":\"https://docs.maximem.ai/patterns/voice-agent-livekit\",\"name\":\"Voice Agent on LiveKit\",\"description\":\"Memory-augmented voice agent on LiveKit Agents. Recall caller history mid-call.\",\"dateModified\":\"2026-06-15T21:32:11.967Z\",\"isPartOf\":{\"@id\":\"https://docs.maximem.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.maximem.ai/patterns/voice-agent-livekit#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.maximem.ai/patterns/voice-agent-livekit#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Patterns\",\"item\":\"https://docs.maximem.ai/patterns/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Voice Agent on LiveKit\",\"item\":\"https://docs.maximem.ai/patterns/voice-agent-livekit\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.maximem.ai/patterns/voice-agent-livekit#article\",\"headline\":\"Voice Agent on LiveKit\",\"name\":\"Voice Agent on LiveKit\",\"description\":\"Memory-augmented voice agent on LiveKit Agents. Recall caller history mid-call.\",\"url\":\"https://docs.maximem.ai/patterns/voice-agent-livekit\",\"mainEntityOfPage\":{\"@id\":\"https://docs.maximem.ai/patterns/voice-agent-livekit#webpage\"},\"dateModified\":\"2026-06-15T21:32:11.967Z\",\"publisher\":{\"@id\":\"https://docs.maximem.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.maximem.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Maximem Synap\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Maximem Synap\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/patterns/voice-agent-livekit.md","siteName":"Maximem Synap","nav":{"global":null,"products":[{"product":"Synap","icon":"layer-group","description":"Memory layer and SDK for your agent","tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":""}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/overview"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/setup/installation"}]},{"tab":"Concepts","pages":[{"title":"Concepts","href":"/concepts/memory-model-cheat-sheet"}]},{"tab":"Cookbook","groups":[{"group":"Patterns","pages":[{"title":"Patterns","icon":"puzzle-piece","sidebarTitle":"Overview","href":"/patterns/overview"},{"title":"Multi-Tenant SaaS","sidebarTitle":"Multi-tenant SaaS","icon":"briefcase","href":"/patterns/multi-tenant-saas"},{"title":"Slack Bot with Memory","sidebarTitle":"Slack bot with memory","description":"Add per-channel and per-user memory to a Slack bot using Slack Bolt + Synap.","icon":"slack","href":"/patterns/slack-bot"},{"title":"Voice Agent on LiveKit","sidebarTitle":"Voice agent on LiveKit","icon":"microphone","href":"/patterns/voice-agent-livekit"},{"title":"RAG over User History","sidebarTitle":"RAG over user history","description":"Pure semantic retrieval over a single user's past conversations. Synap as your RAG.","icon":"history","href":"/patterns/rag-user-history"},{"title":"Real-Time Anticipation in a Server","sidebarTitle":"Real-time anticipation in a server","icon":"server","tag":"Cloud only","href":"/patterns/real-time-anticipation-server"},{"title":"Graceful Degradation","sidebarTitle":"Graceful degradation","icon":"shield","href":"/patterns/graceful-degradation"},{"title":"Replay Conversation History","sidebarTitle":"Replay conversation history","icon":"rotate-left","href":"/patterns/replay-history"}]},{"group":"Cookbook","pages":[{"title":"Cookbook","icon":"book-open","sidebarTitle":"Overview","href":"/cookbook/overview"}]},{"group":"Consumer agents","pages":[{"title":"Uber: Customer Support","sidebarTitle":"Uber: customer support","icon":"car","href":"/cookbook/consumer-uber"},{"title":"Amazon: Shopping Assistant","sidebarTitle":"Amazon: shopping assistant","icon":"bag-shopping","href":"/cookbook/consumer-amazon"}]},{"group":"Support agents","pages":[{"title":"Tier-1 → Tier-2 Escalation Cluster","sidebarTitle":"Tier-1 → Tier-2 escalation","icon":"layer-group","href":"/cookbook/support-tier-escalation"}]},{"group":"WhatsApp agents","pages":[{"title":"WhatsApp: Single-WABA Inbound + Human Handoff","sidebarTitle":"Single number with human handoff","icon":"comments","href":"/cookbook/whatsapp-single-handoff"},{"title":"WhatsApp: Single-WABA Inbound + Outbound Campaign","sidebarTitle":"Single number with outbound campaign","icon":"paper-plane","href":"/cookbook/whatsapp-single-campaign"},{"title":"WhatsApp: Multi-WABA Same-Business Shared Memory","sidebarTitle":"Shared memory across numbers","icon":"share-nodes","href":"/cookbook/whatsapp-multi-waba-shared"}]},{"group":"Voice agents","pages":[{"title":"Voice Concierge (Pipecat + ElevenLabs)","sidebarTitle":"Voice concierge (Pipecat + ElevenLabs)","icon":"phone","href":"/cookbook/voice-concierge"}]},{"group":"B2B agents","pages":[{"title":"AI SDR","icon":"handshake","href":"/cookbook/b2b-sdr"},{"title":"Salesforce: Enterprise Sales Assistant","sidebarTitle":"Salesforce: enterprise sales assistant","icon":"chart-line","href":"/cookbook/b2b-salesforce"}]},{"group":"Personal AI agents","pages":[{"title":"AI Companion","sidebarTitle":"AI companion","icon":"heart","href":"/cookbook/personal-ai-companion"},{"title":"AI Coach","sidebarTitle":"AI coach","icon":"dumbbell","href":"/cookbook/personal-ai-coach"}]}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/sdk-reference/overview"}]}]},{"product":"Vity","icon":"brain","description":"Memory for your agent: OpenClaw, Hermes, MCP, browser","pages":[{"title":"Vity","href":"/vity/overview"}]}]},"basePath":"","title":"Voice Agent on LiveKit - Maximem Synap","buildId":"dpl_9RFrWkXdFTJCytfx6jAofvAaEXr6","deploymentId":"dpl_9RFrWkXdFTJCytfx6jAofvAaEXr6","dynamics":[],"chunks":[]}