High-performance AI memory engine with Rust core
Project description
mem7
LLM-powered long-term memory engine — Rust core with Python bindings.
mem7 extracts factual statements from conversations, deduplicates them against existing memories, and stores the results in a vector database with full audit history.
Architecture
Python API (mem7.Memory)
│ JSON over PyO3
▼
Rust Core (tokio async runtime)
├── mem7-llm — OpenAI-compatible LLM client
├── mem7-embedding — OpenAI-compatible embedding client
├── mem7-vector — Vector index (FlatIndex / Upstash)
├── mem7-history — SQLite audit trail
├── mem7-dedup — LLM-driven memory deduplication
└── mem7-store — Pipeline orchestrator (MemoryEngine)
Quick Start
pip install mem7
from mem7 import Memory
from mem7.config import MemoryConfig, LlmConfig, EmbeddingConfig
config = MemoryConfig(
llm=LlmConfig(
base_url="http://localhost:11434/v1",
api_key="ollama",
model="qwen2.5:7b",
),
embedding=EmbeddingConfig(
base_url="http://localhost:11434/v1",
api_key="ollama",
model="mxbai-embed-large",
dims=1024,
),
)
m = Memory(config=config)
# Add memories from conversation
m.add("I love playing tennis and my coach is Sarah.", user_id="alice")
# Semantic search
results = m.search("What sports does Alice play?", user_id="alice")
print(results)
Vector Store Backends
Built-in FlatIndex (default) — in-memory brute-force, good for development:
from mem7.config import VectorConfig
VectorConfig(provider="flat", dims=1024)
Upstash Vector — managed cloud vector database:
VectorConfig(
provider="upstash",
collection_name="my-namespace",
dims=1024,
upstash_url="https://your-index.upstash.io",
upstash_token="your-token",
)
Development
Prerequisites
- Rust 1.85+ (stable)
- Python 3.10+
- maturin
Build
python -m venv .venv && source .venv/bin/activate
pip install maturin pydantic
# Development build (debug, fast iteration)
maturin develop
# Release build
maturin develop --release
Test
# Rust tests
cargo test --workspace
# Clippy
cargo clippy --workspace --all-targets -- -D warnings
License
Apache-2.0
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 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 mem7-0.1.4.tar.gz.
File metadata
- Download URL: mem7-0.1.4.tar.gz
- Upload date:
- Size: 39.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f04031e12eca64284b2dca4e7eb3290826db131b62ba292b1961de3600f64c8b
|
|
| MD5 |
cc254a060f4009eff3a34f1b5917d64a
|
|
| BLAKE2b-256 |
8f1bcfea45b6480f613c3c455aedb4a78051df4d6fac3d40ad442225ebdd29f7
|
Provenance
The following attestation bundles were made for mem7-0.1.4.tar.gz:
Publisher:
release.yml on mem7ai/mem7
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mem7-0.1.4.tar.gz -
Subject digest:
f04031e12eca64284b2dca4e7eb3290826db131b62ba292b1961de3600f64c8b - Sigstore transparency entry: 1090273881
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.4-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: mem7-0.1.4-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
841fe6a6e489bb41329dfc6e849260d3a521cbac47f58ec301858285600c72dd
|
|
| MD5 |
399090c8b7a2e04ca9e57fc93652fea2
|
|
| BLAKE2b-256 |
5c81c99a93f8c8b4b307119c645b69480ee0726847ac4a6075d8b09f5a7dc4a5
|
Provenance
The following attestation bundles were made for mem7-0.1.4-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on mem7ai/mem7
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mem7-0.1.4-cp310-abi3-win_amd64.whl -
Subject digest:
841fe6a6e489bb41329dfc6e849260d3a521cbac47f58ec301858285600c72dd - Sigstore transparency entry: 1090274027
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.4-cp310-abi3-manylinux_2_24_aarch64.whl.
File metadata
- Download URL: mem7-0.1.4-cp310-abi3-manylinux_2_24_aarch64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.10+, manylinux: glibc 2.24+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1af8381bee303b3476f56dc5a56e206a148d747401af152f17715caca6c62487
|
|
| MD5 |
a8c4d515e9300531a6950330e54608e7
|
|
| BLAKE2b-256 |
ec7d7f8b86eea461b1b275e6501f6df544491789c804d2869847023391e02161
|
Provenance
The following attestation bundles were made for mem7-0.1.4-cp310-abi3-manylinux_2_24_aarch64.whl:
Publisher:
release.yml on mem7ai/mem7
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mem7-0.1.4-cp310-abi3-manylinux_2_24_aarch64.whl -
Subject digest:
1af8381bee303b3476f56dc5a56e206a148d747401af152f17715caca6c62487 - Sigstore transparency entry: 1090274067
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.4-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: mem7-0.1.4-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44b315fe5506bd8528c3d075a261d8b95db84d463e4e788a51ea95673a02a068
|
|
| MD5 |
78519887849683a0c3bf3ac7359ff62c
|
|
| BLAKE2b-256 |
aa8fa4bd92ce8c2207de06a61866b532f1c269db227eeadcc650e139f9fd7f44
|
Provenance
The following attestation bundles were made for mem7-0.1.4-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on mem7ai/mem7
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mem7-0.1.4-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
44b315fe5506bd8528c3d075a261d8b95db84d463e4e788a51ea95673a02a068 - Sigstore transparency entry: 1090273948
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: mem7-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54e330c8b2a398b2af8dbc4a8a7c8bdce8bb7b9681b9d2ef09c067296cccc674
|
|
| MD5 |
e406e37b58bb87d52a4ad0262d4ede26
|
|
| BLAKE2b-256 |
a087b31a4187eb48d6fbc71b2fc08cca6787ae98b2ab82300f5eb177b4657206
|
Provenance
The following attestation bundles were made for mem7-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on mem7ai/mem7
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mem7-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
54e330c8b2a398b2af8dbc4a8a7c8bdce8bb7b9681b9d2ef09c067296cccc674 - Sigstore transparency entry: 1090274147
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mem7-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
404cb2e96f68072e49a61b4b9a08081e074fa01cf78c2878d7ac019aea889a88
|
|
| MD5 |
7d6e8bb9dbf1eea3476bec07408bf1c8
|
|
| BLAKE2b-256 |
3fe6ec5474c09cf1192072a04c73493cdf2f560a68a44b611879d8f86b74f62f
|
Provenance
The following attestation bundles were made for mem7-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on mem7ai/mem7
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mem7-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
404cb2e96f68072e49a61b4b9a08081e074fa01cf78c2878d7ac019aea889a88 - Sigstore transparency entry: 1090274107
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3a3edf5abfbb117df6f36eb3988a2b31126edfda -
Trigger Event:
push
-
Statement type: