Skip to main content

Mneme

Multi-tier long-term memory for LLM agents. Working / episodic / semantic tiers, pluggable storage backends, framework-agnostic adapters, and explicit forgetting + consolidation.

docs python license

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 (the mneme slot was already taken). Python import name stays mneme — same dual-name pattern as Pillow / PIL or pyyaml / yaml. So you pip install smolAmem but write import mneme everywhere 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.

Metadata

Release files for smolAmem 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smolAmem 1.0.0
File Size Uploaded
smolamem-1.0.0.tar.gz 345.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smolAmem 1.0.0
File Interpreter ABI Platform
smolamem-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 402.1 kB

Release files / smolamem-1.0.0.tar.gz

Download URL smolamem-1.0.0.tar.gz
Size 345.8 kB
Tags Source
SHA-256 checksum
How to use checksums
21222597d08bd3779f24df7b3d142ec89f4b476423f25e420f7e6f13eaf04885
BLAKE2b-256 checksum
How to use checksums
cbc4a9104d33bd0a43ff9bccb11e8accf4ddd90fb9d45f6a90a1fbd899cdb540
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 23, 2026.

Transparency log

Release files / smolamem-1.0.0-py3-none-any.whl

Download URL smolamem-1.0.0-py3-none-any.whl
Size 56.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a6ada7c39610bb64bf88c1e141aa59c1f851eb15079c993668e02b6a47e4cfb
BLAKE2b-256 checksum
How to use checksums
3485692b9b107d2733f155c5f4740b0cc322b0fad4613f2fbfcdbbc583056a9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page