Skip to main content

Python SDK for Engram by Weaviate.

Project description

weaviate-engram

[!WARNING] Engram is currently in preview. While in preview (pre-1.0), the API is subject to breaking changes without notice. Use in production at your own risk.

Engram is a fully managed memory service by Weaviate. It lets you add persistent, personalized memory to AI assistants and agents — 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 at three levels — project, user, and conversation — which can be mixed and matched freely. Each scope is backed by Weaviate's multi-tenant architecture, ensuring strong isolation between tenants.

Requirements

  • Python 3.11 to 3.14

Installation

pip install weaviate-engram
uv add weaviate-engram

Quick Start

Create a project and get an API key at console.weaviate.cloud/engram.

from engram import EngramClient

client = EngramClient(api_key="your-api-key")

Add a memory from a string:

run = client.memories.add("Alice prefers async Python and avoids Java.", user_id="user_123")

Add a memory from a conversation:

run = client.memories.add(
    [
        {"role": "user", "content": "What's the best way to handle retries?"},
        {"role": "assistant", "content": "Exponential backoff with jitter is the standard approach."},
        {"role": "user", "content": "Got it — I'll use that in my HTTP client."},
    ],
    user_id="user_123",
)

Search memories:

results = client.memories.search(query="What does Alice think about Python?", user_id="user_123")
for memory in results:
    print(memory.content)

Wait for a run to complete (memory processing is asynchronous):

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)}")

Async Client

An async client is also available:

from engram import AsyncEngramClient

client = AsyncEngramClient(api_key="your-api-key")

run = await client.memories.add("Alice prefers async Python and avoids Java.", user_id="user_123")
results = await client.memories.search(query="What does Alice think about Python?", user_id="user_123")

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.

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

weaviate_engram-0.3.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

weaviate_engram-0.3.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file weaviate_engram-0.3.0.tar.gz.

File metadata

  • Download URL: weaviate_engram-0.3.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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}

File hashes

Hashes for weaviate_engram-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fbec6aa42652a821a148c68e28821ea0c01c28cdcb18b789ac6b969577c528a9
MD5 3d5356dbbb74439f77858999cbcfdeb6
BLAKE2b-256 ebb27929e35ac1322fb1709dc2df5fb9350eb6c942b2d68929d2749ee290642e

See more details on using hashes here.

File details

Details for the file weaviate_engram-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: weaviate_engram-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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}

File hashes

Hashes for weaviate_engram-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f73a31cf1effb6d73fbfcf2effa50063c18a469ddd26f7116f7357c9075ee46c
MD5 902f445d308a252e79b9826d40ceb9b6
BLAKE2b-256 2e8041667ee6e1a6299d38a68e0e9a7eee4668baaab29427fd3f5f1557fc88dd

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