Skip to main content

Python bindings for the mempill AI-agent memory engine

Project description

mempill (Python)

Python bindings for the mempill AI-agent memory engine — temporal, contested-belief-aware fact storage for AI agents.

Install

pip install mempill

Prebuilt wheels are published for Python 3.11, 3.12, and 3.13 on Linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows (x86_64). No Rust toolchain required to use the published wheel.

Build from source (contributors)

pip install maturin
maturin develop --release   # editable install into current venv

Usage

from mempill import open_in_memory, remember, recall

engine = open_in_memory()

remember(engine, "my-agent", "user", "city", "Berlin")
result = recall(engine, "my-agent", "user", "city")
print(result.as_str())        # "Berlin"
print(result.is_contested())  # False

Contested beliefs

When two conflicting claims exist and neither has been reconciled, recall signals a contest rather than silently returning one value:

from mempill import open_in_memory, remember, recall, RememberOptions

engine = open_in_memory()
remember(engine, "agent", "acme", "ceo", "Alice")
remember(engine, "agent", "acme", "ceo", "Bob")   # conflicts → Contested

result = recall(engine, "agent", "acme", "ceo")
if result.is_contested():
    for c in result.candidates:
        print(c.value, c.claim_ref)

Fact history

from mempill import open_in_memory, remember, recall, history, RememberOptions

engine = open_in_memory()
remember(engine, "agent", "acme", "ceo", "Alice",
         RememberOptions(valid_until="2024-01-01"))
remember(engine, "agent", "acme", "ceo", "Bob",
         RememberOptions(valid_from="2024-01-01"))

h = history(engine, "agent", "acme", "ceo")
for entry in h:
    print(entry.value, entry.status, entry.valid_from, entry.valid_until)

File-backed engine

from mempill import open, remember, recall

engine = open("/path/to/agent.db")   # SQLite, persists across restarts
remember(engine, "my-agent", "user", "city", "Berlin")

Exceptions

MempillError (base)
  ValidationError   — invalid request fields
  NotFoundError     — claim/agent not found
  ConflictError     — write-authority violation
  StorageError      — database open/migration failure
  ConfigError       — invalid engine configuration
  InternalError     — unexpected engine failure

Type stubs

.pyi stubs and py.typed marker are included. The package is mypy and stubtest clean.

Full documentation

https://mempill.netlify.app — concepts, invariants, and the complete API reference.

Source: https://github.com/mempill-ai/mempill

License

Apache-2.0

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

mempill-0.2.1.tar.gz (270.8 kB view details)

Uploaded Source

Built Distributions

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

mempill-0.2.1-cp311-abi3-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11+Windows x86-64

mempill-0.2.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

mempill-0.2.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

mempill-0.2.1-cp311-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

mempill-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file mempill-0.2.1.tar.gz.

File metadata

  • Download URL: mempill-0.2.1.tar.gz
  • Upload date:
  • Size: 270.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mempill-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9efc1a1b84f125fb908f518b869db6bf7be7cca8b3f273a900aed550f7efcebc
MD5 9991f429c82051d8ffb804c962fb8a79
BLAKE2b-256 c12341275d986f1da55f46ef3b57589525c236a1f8c0abb68d1ca4d123e7cee6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.2.1.tar.gz:

Publisher: release-python.yml on mempill-ai/mempill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mempill-0.2.1-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: mempill-0.2.1-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mempill-0.2.1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f1e9df40538ea3aadd093c1752d0c339496aec2846bc487d96a6728ed2e8a512
MD5 e68222b6efab0364dce53c15990192d6
BLAKE2b-256 dda456e8186edf59fb63b3cbd5c6077864a6b66fed109350d104bb4991d96a33

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.2.1-cp311-abi3-win_amd64.whl:

Publisher: release-python.yml on mempill-ai/mempill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mempill-0.2.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mempill-0.2.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dbc63a5a7f466b1131192f74619f41565d10289347e4b93757ab6245b6c85084
MD5 fbc0876ced3e6f5be528d286af469b02
BLAKE2b-256 3f8c0acdc072376a399ff76f20be55c3ad2d72b3004b714bbd1c39a2e8e907bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.2.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-python.yml on mempill-ai/mempill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mempill-0.2.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mempill-0.2.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2ea31cdae5b3f0932a715c13a5ae7ceb6763ffbbbe8b884f364d394de8b4ca8a
MD5 a1bee42a7bcf82f9616e4f7ef4e1c0bf
BLAKE2b-256 ab6ee10e6fdbc92e66cbd955e6ff3e3a550d6657df4812f8eaeba8559f386fa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.2.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-python.yml on mempill-ai/mempill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mempill-0.2.1-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mempill-0.2.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ced1baf86efaadd1a344708b815509a11b283af9148b4d7d0e325a8c7d1f1fd
MD5 536b65511ca316c0eddcc692108b58df
BLAKE2b-256 10c80c192d5d932427ac14f5229157e7754380b440e7cc5b12bd6abffa86cf94

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.2.1-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release-python.yml on mempill-ai/mempill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mempill-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mempill-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 692fe5b3fbe9e6c6290efe2fb216e40f4792da8ef4723fb9473ddd68699270dd
MD5 e48af267c7c8045d1dbc44e80e3d4356
BLAKE2b-256 45b5e60b1a27d698a16749b01fd7dd473fa5dc57993c3174a94cd64412076a5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: release-python.yml on mempill-ai/mempill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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