Skip to main content

livekit-plugins-engram

Durable, explainable memory for LiveKit Agents, powered by Engram (Lumetra).

Voice and realtime agents are stateless by default — every call starts from zero. This plugin gives your Agent a one-line memory backend so it can remember what the caller told you last Tuesday, recall it mid-sentence, and explain why it surfaced any given fact (BM25 + vector + knowledge-graph retrieval).

Install

pip install livekit-plugins-engram

Set your Engram API key:

export ENGRAM_API_KEY=eng_live_...

Get a key at https://lumetra.io.

Usage

The plugin exposes a single Engram class. Use it from your Agent's lifecycle hooks (record what the user just said, recall relevant context before the LLM responds), or hand the model a pair of function tools so it can manage memory itself.

Pattern 1 — record + recall in on_user_turn_completed

from livekit.agents import Agent, AgentSession, JobContext, WorkerOptions, cli
from livekit.plugins import openai, deepgram, silero
from livekit.plugins.engram import Engram

memory = Engram(bucket="caller-default")  # picks up ENGRAM_API_KEY

class Receptionist(Agent):
    def __init__(self) -> None:
        super().__init__(
            instructions=(
                "You are a friendly receptionist. Use the memory provided "
                "in the system messages to personalize replies."
            ),
        )

    async def on_user_turn_completed(self, chat_ctx, new_message):
        text = new_message.text_content
        if not text:
            return
        # Save what the user just said
        await memory.astore_memory(text)
        # Pull anything relevant from prior sessions
        recall = await memory.aquery_memory(text)
        if recall.get("answer"):
            chat_ctx.add_message(
                role="system",
                content=f"Relevant memory: {recall['answer']}",
            )

async def entrypoint(ctx: JobContext):
    session = AgentSession(
        stt=deepgram.STT(),
        llm=openai.LLM(model="gpt-4o-mini"),
        tts=openai.TTS(),
        vad=silero.VAD.load(),
    )
    await session.start(agent=Receptionist(), room=ctx.room)

if __name__ == "__main__":
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))

Pattern 2 — give the model memory tools

from livekit.agents import Agent
from livekit.plugins.engram import Engram, engram_tools

memory = Engram(bucket="caller-default")

agent = Agent(
    instructions="When the user shares a fact, call store_memory. "
                 "When you need history, call query_memory.",
    tools=engram_tools(memory),
)

Per-caller buckets

In a voice deployment you typically want one bucket per caller / room / customer:

memory = Engram(bucket=f"caller-{ctx.room.name}")

Buckets are created lazily on first write — no admin step required.

API

Engram(*, api_key=None, bucket=None, base_url="https://api.lumetra.io", timeout=30.0)
Method (sync / async) Returns
store_memory(content, bucket=None) / astore_memory(...) {} (201)
query_memory(query, bucket=None) / aquery_memory(...) {"success": True, "answer": "..."}
list_memories(bucket=None, *, limit=50) / alist_memories(...) {"memories": [...], "total": N}
list_buckets(*, limit=50, offset=0) / alist_buckets(...) {"buckets": [...]}
delete_memory(memory_id, bucket=None) / adelete_memory(...) {}
clear_memories(bucket=None) / aclear_memories(...) {}

Inside a LiveKit Agent (which is asyncio), prefer the a* coroutines.

Configuration

Env var Purpose
ENGRAM_API_KEY API key (eng_live_...)

License

MIT © Lumetra

Metadata

Release files for livekit-plugins-engram 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for livekit-plugins-engram 0.1.1
File Size Uploaded Provenance Actions
livekit_plugins_engram-0.1.1.tar.gz 6.7 kB Without provenance Details for livekit_plugins_engram-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-engram 0.1.1
File Interpreter ABI Platform Actions
livekit_plugins_engram-0.1.1-py3-none-any.whl Python 3 none any Details for livekit_plugins_engram-0.1.1-py3-none-any.whl

Total release size: 14.9 kB

Release files / livekit_plugins_engram-0.1.1.tar.gz

Download URL livekit_plugins_engram-0.1.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
40826a776e153421823c91ecd936406f997fc43cd27f4986279cbc502c134153
BLAKE2b-256 checksum
How to use checksums
736add2acb868286c0730daa497588709d43a8cbe68aaad2214a8096baa26e30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / livekit_plugins_engram-0.1.1-py3-none-any.whl

Download URL livekit_plugins_engram-0.1.1-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e766a7cbb99eaefedba14f817539bc39dcff2bff672c44d8ad1a48a7ddbac77a
BLAKE2b-256 checksum
How to use checksums
a73e232e36184112587220caef2e59e6fe0f03de6d463134d1304d9d5af9c590
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Security for livekit-plugins-engram 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page