Skip to main content

Engram memory processor for Pipecat — durable, explainable memory for voice and realtime AI.

Project description

pipecat-engram

Engram memory plugin for Pipecat — durable, explainable memory for voice and realtime AI agents.

EngramMemoryProcessor is a drop-in FrameProcessor that:

  • Stores every finalized user turn to your Engram bucket.
  • Recalls relevant memories on each new turn and injects them as a context TextFrame (with skip_tts=True) right before the user's utterance, so the LLM sees the memory but the TTS doesn't speak it.

Install

pip install pipecat-engram

Configure

Set your Engram API key (get one at https://lumetra.io):

export ENGRAM_API_KEY=eng_live_...

Or pass it directly to the constructor.

Minimal Pipeline example

from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.task import PipelineTask
from pipecat.pipeline.runner import PipelineRunner

from pipecat_engram import EngramMemoryProcessor

# Memory sits between the user input (STT or text) and the LLM, so the
# LLM context aggregator sees recall TextFrames just before each user turn.
memory = EngramMemoryProcessor(
    bucket="my_agent",
    recall_prefix="Relevant memory: ",
)

pipeline = Pipeline([
    transport.input(),     # mic / WebRTC / etc.
    stt,                   # e.g. DeepgramSTTService
    memory,                # <-- EngramMemoryProcessor
    context_aggregator.user(),
    llm,                   # e.g. OpenAILLMService
    tts,                   # e.g. CartesiaTTSService
    transport.output(),
    context_aggregator.assistant(),
])

task = PipelineTask(pipeline)
await PipelineRunner().run(task)

For a pure text pipeline (no STT/TTS), EngramMemoryProcessor will also act on plain TextFrames flowing downstream from the user side.

Direct REST access

from pipecat_engram import EngramClient

async with EngramClient() as engram:
    await engram.store_memory("user prefers Celsius", bucket="prefs")
    result = await engram.query_memory("what units does the user prefer?", bucket="prefs")
    print(result["answer"])

EngramClient exposes six methods that map 1:1 to the Engram REST API:

Method Endpoint
store_memory(content, bucket) POST /v1/buckets/{bucket}/memories
query_memory(question, bucket) POST /v1/query
list_buckets(limit, offset) GET /v1/buckets
list_memories(bucket, limit) GET /v1/buckets/{bucket}/memories
delete_memory(bucket, memory_id) DELETE /v1/buckets/{bucket}/memories/{memory_id}
clear_memories(bucket) DELETE /v1/buckets/{bucket}/memories

The user-facing parameter question is mapped to the REST field query.

Frame handling

EngramMemoryProcessor is opinionated about which frames it acts on:

Frame type Action
TranscriptionFrame (finalized STT) Store + recall
TextFrame (plain user text) Store + recall
LLMTextFrame, TTSTextFrame Forwarded unchanged — never stored
InterimTranscriptionFrame Forwarded unchanged — too noisy
Any other frame Forwarded unchanged

Storing is fire-and-forget so it does not add latency to the turn.

Self-hosted Engram

EngramMemoryProcessor(base_url="https://engram.example.com")

Or via env: ENGRAM_BASE_URL=https://engram.example.com.

License

MIT — Copyright (c) Lumetra Labs Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipecat_engram-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipecat_engram-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file pipecat_engram-0.1.0.tar.gz.

File metadata

  • Download URL: pipecat_engram-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for pipecat_engram-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83190f9a27e894bd111c696b2ee1df5b13f5fa30c9ab289bc161b577aecabb60
MD5 728499d676bb6f5ba53c94cce7bf66d3
BLAKE2b-256 27488d7f9921c8d1b5655812c73b2c97dc255d133dcba608fc0c09579ee0228f

See more details on using hashes here.

File details

Details for the file pipecat_engram-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pipecat_engram-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for pipecat_engram-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb54bfb268704d598566ae9f123b796902b0120bb644677aa9c885eca91e49e0
MD5 25505fbd2f7d28db4919c681ea63e727
BLAKE2b-256 8db145ca83146542aab084a569d53e7411c2b6d7a490cab8b352f53f4100f2e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page