Skip to main content

beeai-framework-engram

Engram memory integration for the BeeAI framework.

EngramMemory is a BaseMemory implementation that persists every chat message your agent sees to Engram — Lumetra's durable, explainable memory service. Messages survive process restarts, are searchable via the Engram API, and can be cleared per-bucket.

Install

pip install beeai-framework-engram

Quick start

import asyncio
import os

from beeai_framework.backend.message import UserMessage, AssistantMessage
from beeai_framework_engram import EngramMemory

os.environ["ENGRAM_API_KEY"] = "eng_live_..."  # or pass api_key=... below

async def main() -> None:
    memory = EngramMemory(bucket="my-agent")
    await memory.add(UserMessage("My favorite color is blue."))
    await memory.add(AssistantMessage("Got it, I'll remember that."))

    # Restart the process — messages are still there.
    fresh = EngramMemory(bucket="my-agent")
    print([m.text for m in fresh.messages])

asyncio.run(main())

With a BeeAI agent

import asyncio
import os

from beeai_framework.agents.react import ReActAgent
from beeai_framework.backend.chat import ChatModel
from beeai_framework.tools.search.duckduckgo import DuckDuckGoSearchTool
from beeai_framework_engram import EngramMemory

async def main() -> None:
    llm = ChatModel.from_name("ollama:granite3.3:8b")
    agent = ReActAgent(
        llm=llm,
        tools=[DuckDuckGoSearchTool()],
        memory=EngramMemory(bucket="my-react-agent"),
    )
    result = await agent.run("What did we talk about last time?")
    print(result.result.text)

asyncio.run(main())

Configuration

Argument Env var Default Notes
bucket — "default" Engram bucket name. Pick one per agent / per user.
api_key ENGRAM_API_KEY — Required.
base_url ENGRAM_BASE_URL https://api.lumetra.io Override for self-hosted.
hydrate — True Load existing memories from the bucket on construction.
hydrate_limit — 200 Cap on hydrated messages.
timeout — 30.0 HTTP timeout (seconds).

API reference

EngramMemory implements the full BaseMemory contract: messages, add, delete, reset, add_many, delete_many, splice, is_empty, clone, and as_read_only. It also exposes:

  • await memory.query("...") — ask Engram a question over this bucket; returns the raw JSON response ({success, answer, ...}).
  • memory.bucket, memory.base_url — read-only accessors.

reset() clears the entire Engram bucket — use a per-agent / per-user bucket name to avoid wiping shared memory.

Privacy

See PRIVACY.md. The integration only talks to the Engram base URL you configured; no other services are contacted.

License

MIT — see LICENSE.

Release files for beeai-framework-engram 0.1.0

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

Source distribution (sdist)

Source distribution for beeai-framework-engram 0.1.0
File Size Uploaded
beeai_framework_engram-0.1.0.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beeai-framework-engram 0.1.0
File Interpreter ABI Platform
beeai_framework_engram-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / beeai_framework_engram-0.1.0.tar.gz

Download URL beeai_framework_engram-0.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
882323e392cb27b7b13f099d4361987da39a0faaf68b2442011df4647b6ffc86
BLAKE2b-256 checksum
How to use checksums
9880cf7e293b127edb77cd25d60dd41d0aabc8af86c9bb00dc7ea1baa5541e8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / beeai_framework_engram-0.1.0-py3-none-any.whl

Download URL beeai_framework_engram-0.1.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2855fee926d5620b46c9c28c9fae4287a6d5c35fc9851e04eff519e5d8e975ec
BLAKE2b-256 checksum
How to use checksums
1b8a3f4d078e46069856497539038ae9a59c42cc36acaa29ae7368f23e712a1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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