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.3.0.tar.gz (314.5 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.3.0-cp311-abi3-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11+Windows x86-64

mempill-0.3.0-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.3.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.11+macOS 11.0+ ARM64

mempill-0.3.0-cp311-abi3-macosx_10_12_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for mempill-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b57505ea7a8fd2d829f20146dbd817094db012a80ea681e3e03d4551a573106f
MD5 64d6e223dad35681a2e0e5564c35cc6a
BLAKE2b-256 7afed872bcb52a87ac9e216b318235238e8b8614dd0ac67498a29a93e7f7f6ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.3.0.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.3.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: mempill-0.3.0-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.3.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7339b18f97a63061e1ffe1495a22ac0e2f47be38b52b77f29ad3a7c9b6d120de
MD5 77cf591ada6a71efc592de6471d0aef9
BLAKE2b-256 794163acd031d7daff80fa9c68855e59ca1b40a1712e6e5ba314b8f150839453

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.3.0-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.3.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mempill-0.3.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 08f0e2f376d91ae352a866f9d872e0f9d5f60a1a3453c40f124d92d71d671642
MD5 248ccafe26094447b0cdfb8a82c894ce
BLAKE2b-256 b5e3dd3240f6aac98760b693ecbfc02958f795ed667ec490da310f1aa9c5ad52

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.3.0-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.3.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mempill-0.3.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a6325a68cc903d88e313554e63dff24fd06efe93744cb45835d466652b46c7db
MD5 fd041e02f6530c33314f1b82808a9646
BLAKE2b-256 b230d3a7c27600d62ca05e589877063a8528ff2d14da615d55094aeed1955308

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.3.0-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.3.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mempill-0.3.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 945e6c676b93bba69114ffbd3d9a8d246aec51cd1032496211fda3aad56d8072
MD5 1651297b19e7744958cc406626aaebeb
BLAKE2b-256 7929265405e59b5be7b1e4b90df88344cf631d30faa7d10661cd9c2aacb236f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.3.0-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.3.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mempill-0.3.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ba5f5dc9764fe6363afb4f9a8641e95d7ae2cb297d62ddbe1e9a88c21f9b617d
MD5 9fbc3df46c5774fcafb52008a28dad00
BLAKE2b-256 d031d99228a5c754ec2547fa2fdc9d52bbafc7a7edcc6b4d1fcf22a905f89505

See more details on using hashes here.

Provenance

The following attestation bundles were made for mempill-0.3.0-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