Engram memory integration for the BeeAI framework — durable, explainable memory for agents.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beeai_framework_engram-0.1.0.tar.gz.
File metadata
- Download URL: beeai_framework_engram-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
882323e392cb27b7b13f099d4361987da39a0faaf68b2442011df4647b6ffc86
|
|
| MD5 |
924e43c026f2505846e0813a41149734
|
|
| BLAKE2b-256 |
9880cf7e293b127edb77cd25d60dd41d0aabc8af86c9bb00dc7ea1baa5541e8f
|
File details
Details for the file beeai_framework_engram-0.1.0-py3-none-any.whl.
File metadata
- Download URL: beeai_framework_engram-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2855fee926d5620b46c9c28c9fae4287a6d5c35fc9851e04eff519e5d8e975ec
|
|
| MD5 |
7f45edf46c76e6082e2e6b7cf7c058ba
|
|
| BLAKE2b-256 |
1b8a3f4d078e46069856497539038ae9a59c42cc36acaa29ae7368f23e712a1a
|