Multi-tier long-term memory for LLM agents. Install: pip install smolAmem. Import: import mneme.
Project description
Mneme
Multi-tier long-term memory for LLM agents. Working / episodic / semantic tiers, pluggable storage backends, framework-agnostic adapters, and explicit forgetting + consolidation.
Status: 1.0 released. APIs are stable; semver from here. Bug reports welcome.
Why
Every agent framework ships with toy memory: last-N messages, or an LLM-summarised buffer. Real agents need to remember user preferences across weeks, recall specific past interactions, and store semantic facts extracted from many interactions — and they need to forget things that stop being relevant.
Mneme is the library you wish existed.
Install
pip install smolAmem # core only
pip install "smolAmem[sqlite,openai]" # SQLite + OpenAI embeddings
pip install "smolAmem[qdrant,openai]" # production vector backend
Heads-up on naming: PyPI install name is
smolAmem(themnemeslot was already taken). Python import name staysmneme— same dual-name pattern asPillow/PILorpyyaml/yaml. So youpip install smolAmembut writeimport mnemeeverywhere in your code.
Quickstart
from mneme import MemoryManager, SQLiteBackend, OpenAIEmbeddings
m = MemoryManager(
agent_id="alice",
backend=SQLiteBackend(path="mneme.db", dimensions=1536),
embedder=OpenAIEmbeddings(),
)
m.episodic.add("user mostly works in TypeScript", metadata={"role": "user"})
for r in m.retrieve("what language does the user prefer?", k=3):
print(r.score, r.record.content)
Full walkthrough: docs/quickstart.
Documentation
The full site lives at ashwinugale.github.io/ashwinugale-mneme.
- Concepts — the three-tier model, retrieval, consolidation, forgetting.
- Backends — InMemory, SQLite, Qdrant, pgvector.
- Adapters — LangChain, LlamaIndex, raw OpenAI.
- Eval harness — reproducible recall@k + token-cost benchmark.
- API reference — autogen from docstrings.
Benchmark snapshot
From the v0.6 eval harness on the 5-conversation starter corpus, k=5:
| Strategy | recall@5 | tokens / test point |
|---|---|---|
no_memory |
0.000 | 0.0 |
mneme (hash, deterministic) |
0.833 | 68.0 |
mneme (OpenAI embeddings) |
1.000 | 67.7 |
full_history |
1.000 | 141.0 |
summary_buffer |
1.000 | 165.3 |
Mneme matches the full-history oracle for accuracy at less than half the token cost. The HashEmbedder row is the cheap deterministic baseline that runs without an API key — useful in CI and for reviewers reproducing numbers.
Reproduce:
uv run python -m evals --runner mneme --embedder openai --output out/mneme.json
License
MIT. See LICENSE.
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 Distribution
Built Distribution
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 smolamem-1.0.0.tar.gz.
File metadata
- Download URL: smolamem-1.0.0.tar.gz
- Upload date:
- Size: 345.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21222597d08bd3779f24df7b3d142ec89f4b476423f25e420f7e6f13eaf04885
|
|
| MD5 |
ab44b8099c2306351da1c28726a2cac6
|
|
| BLAKE2b-256 |
cbc4a9104d33bd0a43ff9bccb11e8accf4ddd90fb9d45f6a90a1fbd899cdb540
|
Provenance
The following attestation bundles were made for smolamem-1.0.0.tar.gz:
Publisher:
release.yml on AshwinUgale/ashwinugale-mneme
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
smolamem-1.0.0.tar.gz -
Subject digest:
21222597d08bd3779f24df7b3d142ec89f4b476423f25e420f7e6f13eaf04885 - Sigstore transparency entry: 1615741703
- Sigstore integration time:
-
Permalink:
AshwinUgale/ashwinugale-mneme@1d527ad4cdd446d0d6e0f645c0c7f38d96014daa -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/AshwinUgale
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1d527ad4cdd446d0d6e0f645c0c7f38d96014daa -
Trigger Event:
push
-
Statement type:
File details
Details for the file smolamem-1.0.0-py3-none-any.whl.
File metadata
- Download URL: smolamem-1.0.0-py3-none-any.whl
- Upload date:
- Size: 56.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a6ada7c39610bb64bf88c1e141aa59c1f851eb15079c993668e02b6a47e4cfb
|
|
| MD5 |
e1ccffc0521ef24234b802a66bc6ef9d
|
|
| BLAKE2b-256 |
3485692b9b107d2733f155c5f4740b0cc322b0fad4613f2fbfcdbbc583056a9e
|
Provenance
The following attestation bundles were made for smolamem-1.0.0-py3-none-any.whl:
Publisher:
release.yml on AshwinUgale/ashwinugale-mneme
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
smolamem-1.0.0-py3-none-any.whl -
Subject digest:
9a6ada7c39610bb64bf88c1e141aa59c1f851eb15079c993668e02b6a47e4cfb - Sigstore transparency entry: 1615741727
- Sigstore integration time:
-
Permalink:
AshwinUgale/ashwinugale-mneme@1d527ad4cdd446d0d6e0f645c0c7f38d96014daa -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/AshwinUgale
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1d527ad4cdd446d0d6e0f645c0c7f38d96014daa -
Trigger Event:
push
-
Statement type: