Skip to main content

lethe-memory

Python bindings to the Rust core of lethe, a self-improving memory store for LLM agents. Built with PyO3 + maturin, distributed as wheels.

Install

pip install lethe-memory

Use

from lethe_memory import MemoryStore

store = MemoryStore("./my_memories")  # encoders default to MiniLM

store.add("I prefer window seats on flights",      session_id="trip")
store.add("My wife needs aisle seats",             session_id="trip")
store.add("I work at Google as a software engineer", session_id="work")

for hit in store.retrieve("What are my travel preferences?", k=5):
    print(f"  [{hit.score:.1f}] {hit.content}")

store.save()

The wheel ships the Rust lethe-core retrieval pipeline (BM25 + dense hybrid, cross-encoder rerank, clustered RIF), the same code path the CLI uses, exposed via PyO3 with Python::allow_threads around all native work so multi-threaded Python callers see real parallelism.

Constructor knobs

MemoryStore(
    path,
    bi_encoder="Xenova/all-MiniLM-L6-v2",
    cross_encoder="Xenova/ms-marco-MiniLM-L-6-v2",
    rif_config=None,                # RIFConfig(n_clusters=30, ...)
    k_shallow=30,
    k_deep=100,
    confidence_threshold=4.0,
    dedup_threshold=0.95,
)

See also

License: MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

lethe_memory-0.16.0-cp39-abi3-win_arm64.whl (23.2 MB view details)

Uploaded CPython 3.9+Windows ARM64

lethe_memory-0.16.0-cp39-abi3-win_amd64.whl (23.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

lethe_memory-0.16.0-cp39-abi3-macosx_11_0_arm64.whl (44.3 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file lethe_memory-0.16.0-cp39-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for lethe_memory-0.16.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 dc6417d953bb54dbe36fc197e2da2be02ce1b42aa800e8bd30c3e5732ef6f978
MD5 51fac67044022cb9db78258aa20764e8
BLAKE2b-256 1827bfd57d8c534d6728ce6f2b4543220020b62a0dc3a59ecded98fe06e43074

See more details on using hashes here.

Provenance

The following attestation bundles were made for lethe_memory-0.16.0-cp39-abi3-win_arm64.whl:

Publisher: release-pypi.yml on teimurjan/lethe

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

File details

Details for the file lethe_memory-0.16.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: lethe_memory-0.16.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 23.1 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lethe_memory-0.16.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8821a7b67e9b81569d4d398b51d04ef610162904724adae2fd2d5bdd21d1dc4a
MD5 4f8dc74d74f5431210f14e468f75d27a
BLAKE2b-256 5489812fa7a4ba9ab116f0439f7b11b6128e2b07f998ca457adbdf4aad87af88

See more details on using hashes here.

Provenance

The following attestation bundles were made for lethe_memory-0.16.0-cp39-abi3-win_amd64.whl:

Publisher: release-pypi.yml on teimurjan/lethe

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

File details

Details for the file lethe_memory-0.16.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lethe_memory-0.16.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2fdb482d554dc2a6669a5af661eb56a0cb0faa427c49b2816be0fc415bbd3aa5
MD5 edb03d9ebcffed858f0e21b7bf6df540
BLAKE2b-256 2f9c4fba312097bd45e1068da8daa3babf7dfcae59165a86a6020d44ec4a07f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for lethe_memory-0.16.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release-pypi.yml on teimurjan/lethe

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