Metadata-Version: 2.4
Name: memoair-livekit
Version: 0.2.1
Summary: LiveKit Agent integration for MemoAir voice memory
Project-URL: Homepage, https://memoair.dev
Project-URL: Documentation, https://docs.memoair.dev/voice/integrations/livekit
Project-URL: Repository, https://github.com/memoair/memoair-python
Project-URL: Changelog, https://github.com/memoair/memoair-python/blob/main/CHANGELOG.md
Author-email: MemoAir <hello@memoair.dev>
License-Expression: MIT
Keywords: agents,ai,livekit,memoair,memory,voice,voice-agents
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: livekit-agents>=1.0.0
Requires-Dist: memoair-voice>=0.2.1
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-httpx>=0.22.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: respx>=0.20.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# memoair-livekit

LiveKit Agent integration for MemoAir voice memory. Drop-in `livekit.agents.Agent` subclass that searches memory before every LLM turn and persists each completed turn.

## Install

```bash
pip install memoair-livekit
```

## Quick start

```python
import asyncio
from livekit.agents import AgentSession
from memoair_livekit import MemoAirVoiceAgent

async def entrypoint(ctx):
    agent = MemoAirVoiceAgent(
        api_key="mka_...",
        project_id="proj_123",
        user_id=ctx.room.local_participant.identity,
        instructions="You are a helpful voice assistant.",
    )
    session = AgentSession(vad=..., stt=..., llm=..., tts=...)

    # Required: LiveKit's base Agent does NOT call on_agent_response_completed.
    # Without this wiring, search runs every turn but nothing is saved.
    @session.on("conversation_item_added")
    def _on_item_added(event):
        if event.item.role == "assistant":
            asyncio.create_task(
                agent.on_agent_response_completed(session.chat_ctx, event.item)
            )

    await session.start(agent=agent, room=ctx.room)
```

Full docs: https://docs.memoair.dev/voice/integrations/livekit
