Persistent memory store for LLM agents. Python bindings to the Rust lethe core.
Project description
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
- Project landing page: architecture, benchmarks, research journey
lethe-cli(Homebrew:lethe): the standalone CLI
License: MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lethe_memory-0.13.0-cp39-abi3-win_arm64.whl.
File metadata
- Download URL: lethe_memory-0.13.0-cp39-abi3-win_arm64.whl
- Upload date:
- Size: 23.2 MB
- Tags: CPython 3.9+, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9d3279d267f3cd879175dc16e2a09bb041492afe98f5cced80feb054fdd8897
|
|
| MD5 |
e209f062296e75b8e17fefdad35b1d08
|
|
| BLAKE2b-256 |
3bd15397761e609be3874e655907e7b0c2ceaea09c5175624350c6c9e20f833a
|
Provenance
The following attestation bundles were made for lethe_memory-0.13.0-cp39-abi3-win_arm64.whl:
Publisher:
release-pypi.yml on teimurjan/lethe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lethe_memory-0.13.0-cp39-abi3-win_arm64.whl -
Subject digest:
c9d3279d267f3cd879175dc16e2a09bb041492afe98f5cced80feb054fdd8897 - Sigstore transparency entry: 1439839884
- Sigstore integration time:
-
Permalink:
teimurjan/lethe@221fbd681f37e833e3fff5a9f245017c55fe93cb -
Branch / Tag:
refs/tags/lethe-v0.13.0 - Owner: https://github.com/teimurjan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@221fbd681f37e833e3fff5a9f245017c55fe93cb -
Trigger Event:
release
-
Statement type:
File details
Details for the file lethe_memory-0.13.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: lethe_memory-0.13.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64ab53798d6eaf3d085a882547a803c36c5e0eb58b04364ed856edf28b3ca1a4
|
|
| MD5 |
c62ad7edc7ab36d1d721671646867e28
|
|
| BLAKE2b-256 |
43d21b3e6c448ea16c8aa93fdca2da236d76d3e039ea4445822150fa413e8f9c
|
Provenance
The following attestation bundles were made for lethe_memory-0.13.0-cp39-abi3-win_amd64.whl:
Publisher:
release-pypi.yml on teimurjan/lethe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lethe_memory-0.13.0-cp39-abi3-win_amd64.whl -
Subject digest:
64ab53798d6eaf3d085a882547a803c36c5e0eb58b04364ed856edf28b3ca1a4 - Sigstore transparency entry: 1439839866
- Sigstore integration time:
-
Permalink:
teimurjan/lethe@221fbd681f37e833e3fff5a9f245017c55fe93cb -
Branch / Tag:
refs/tags/lethe-v0.13.0 - Owner: https://github.com/teimurjan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@221fbd681f37e833e3fff5a9f245017c55fe93cb -
Trigger Event:
release
-
Statement type:
File details
Details for the file lethe_memory-0.13.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: lethe_memory-0.13.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 44.3 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cf2fad9204204e4408253a453939aa90fc4ec0b1aad25bc2f3a205c870bf2cb
|
|
| MD5 |
d5be52bf7d278c7e6a2a9a1420db7d58
|
|
| BLAKE2b-256 |
452e91e6960f5b56dfc6c361401ee1c941dab75c42661b7f198f2e929f081e1b
|
Provenance
The following attestation bundles were made for lethe_memory-0.13.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
release-pypi.yml on teimurjan/lethe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lethe_memory-0.13.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
4cf2fad9204204e4408253a453939aa90fc4ec0b1aad25bc2f3a205c870bf2cb - Sigstore transparency entry: 1439839871
- Sigstore integration time:
-
Permalink:
teimurjan/lethe@221fbd681f37e833e3fff5a9f245017c55fe93cb -
Branch / Tag:
refs/tags/lethe-v0.13.0 - Owner: https://github.com/teimurjan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@221fbd681f37e833e3fff5a9f245017c55fe93cb -
Trigger Event:
release
-
Statement type: