Skip to main content
Weaviate

weaviate-engram

PyPI version Python versions License CI

The official Python SDK for Engram, the fully managed memory service by Weaviate.

Engram lets you add persistent, personalized memory to AI assistants and agents, with no infrastructure to set up or manage. When you add a memory, Engram processes it asynchronously through a background pipeline that extracts, deduplicates, and reconciles facts. Memories are scoped by project and user, along with any custom scope properties you define, and these scopes can be mixed and matched freely. Each scope is backed by Weaviate's multi-tenant architecture, ensuring strong isolation between tenants.

Learn more about Engram →

Requirements

  • Python 3.11 to 3.14

Installation

pip install weaviate-engram
uv add weaviate-engram

Get an API key

Engram runs on Weaviate Cloud. To get started:

  1. Sign up (or log in) at console.weaviate.cloud.
  2. Open Engram and create a project at console.weaviate.cloud/engram.
  3. Generate an API key from the project's API Keys page. Keys are shown once, so copy yours somewhere safe.

Quick start

1. Initialize the client

from engram import EngramClient

client = EngramClient(api_key="YOUR_API_KEY")

2. Add a memory from a string

# add() returns immediately. Memory processing happens asynchronously
# in the background via Engram's pipeline.
run = client.memories.add(
    "User prefers concise responses and dark mode",
    user_id="alice@example.com",
)
print(run.run_id)  # e.g. "run_abc123"

3. Add a memory from a conversation

Conversations use the OpenAI Chat Completions message format. Separately, you can pass scope properties to control where a memory lives — here a conversation_id scopes it to a specific session. Properties work with any input type, not just conversations:

run = client.memories.add(
    [
        {"role": "user", "content": "I just moved to Berlin and I am looking for a good coffee shop."},
        {"role": "assistant", "content": "Welcome to Berlin! Here are some popular coffee shops in the city..."},
        {"role": "user", "content": "I prefer specialty coffee, not chains."},
    ],
    user_id="alice@example.com",
    properties={"conversation_id": "session-abc123"},
)

print(run.run_id)  # e.g. "run_abc123"

4. Search memories

results = client.memories.search(
    query="What does the user prefer?",
    user_id="alice@example.com",
)
for memory in results:
    print(memory.content)

Async client

An async client with the same surface is available:

from engram import AsyncEngramClient

client = AsyncEngramClient(api_key="YOUR_API_KEY")

run = await client.memories.add(
    "User prefers concise responses and dark mode",
    user_id="alice@example.com",
)
results = await client.memories.search(
    query="What does the user prefer?",
    user_id="alice@example.com",
)

Error handling

All SDK exceptions inherit from EngramError:

from engram import (
    APIError,             # raised on any non-2xx response
    AuthenticationError,  # 401, invalid or missing API key
    ValidationError,      # invalid client configuration or request input
    ConnectionError,      # network failure reaching the Engram API
    EngramTimeoutError,   # runs.wait() did not reach a terminal status in time
)

Waiting for a run to complete

Each run is processed asynchronously. Under normal conditions you should not wait on runs — treat add() as fire-and-forget to keep latency low and let the pipeline reconcile memories in the background. Blocking on every run defeats the purpose of the async pipeline and will slow your application down, especially when ingesting at volume.

runs.wait() exists for the cases where you genuinely need the outcome of a specific run before proceeding — primarily debugging and tests:

status = client.runs.wait(run.run_id, timeout=60.0)
print(status.status)  # "completed" or "failed"
print(f"+{len(status.memories_created)} ~{len(status.memories_updated)} -{len(status.memories_deleted)}")

Learn more

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the BSD 3-Clause License.

Support

For questions or help, reach out to support@weaviate.io.

Metadata

Release files for weaviate-engram 1.0.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 weaviate-engram 1.0.1
File Size Uploaded Provenance Actions
weaviate_engram-1.0.1.tar.gz 10.5 kB Without provenance Details for weaviate_engram-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for weaviate-engram 1.0.1
File Interpreter ABI Platform Actions
weaviate_engram-1.0.1-py3-none-any.whl Python 3 none any Details for weaviate_engram-1.0.1-py3-none-any.whl

Total release size: 26.7 kB

Release files / weaviate_engram-1.0.1.tar.gz

Download URL weaviate_engram-1.0.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4bcca4c37c03b42ad27451a8dc194a9983e598c5130ea46b7f0a9f5229ccfdca
BLAKE2b-256 checksum
How to use checksums
235881a6fef4b9de1c7c5152e087deb5b6135080a458f42a8fc46bfefcfe8316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / weaviate_engram-1.0.1-py3-none-any.whl

Download URL weaviate_engram-1.0.1-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
862e7872bbd3025da821f1b979152f63cd359ad6ef28b585b0a5f0fb06024be6
BLAKE2b-256 checksum
How to use checksums
c98017d5bb2233250b765c37d2dec64bfdf738aee18777a75475ca36e256b8db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for weaviate-engram 1.0.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.

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