High-performance AI memory engine with Rust core
Project description
mem7
LLM-powered long-term memory engine — Rust core with multi-language bindings.
mem7 extracts factual statements from conversations, deduplicates them against existing memories, and stores the results in a vector database with full audit history.
Install
pip install mem7 # Python
npm install @mem7ai/mem7 # Node.js / TypeScript
cargo add mem7 # Rust
Architecture
Python / TypeScript / Rust API
│ PyO3 / napi-rs / native
▼
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 (Python)
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)
m.add("I love playing tennis and my coach is Sarah.", user_id="alice")
results = m.search("What sports does Alice play?", user_id="alice")
Quick Start (TypeScript)
import { MemoryEngine } from "@mem7ai/mem7";
const engine = await MemoryEngine.create(JSON.stringify({
llm: { base_url: "http://localhost:11434/v1", api_key: "ollama", model: "qwen2.5:7b" },
embedding: { base_url: "http://localhost:11434/v1", api_key: "ollama", model: "mxbai-embed-large", dims: 1024 },
}));
await engine.add([{ role: "user", content: "I love playing tennis and my coach is Sarah." }], "alice");
const results = await engine.search("What sports does Alice play?", "alice");
Supported Providers
mem7 uses a single OpenAI-compatible client for both LLM and Embedding, which covers any service that exposes the OpenAI API format. This includes most major providers out of the box.
LLMs
| Provider | mem0 | mem7 | Notes |
|---|---|---|---|
| OpenAI | :white_check_mark: | :white_check_mark: | Native support |
| Ollama | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| vLLM | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| Groq | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| Together | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| DeepSeek | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| xAI (Grok) | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| LM Studio | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| Azure OpenAI | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| Anthropic | :white_check_mark: | :x: | Requires native SDK |
| Gemini | :white_check_mark: | :x: | Requires native SDK |
| Vertex AI | :white_check_mark: | :x: | Requires native SDK |
| AWS Bedrock | :white_check_mark: | :x: | Requires native SDK |
| LiteLLM | :white_check_mark: | :x: | Python proxy |
| Sarvam | :white_check_mark: | :x: | Requires native SDK |
| LangChain | :white_check_mark: | :x: | Python framework |
Embeddings
| Provider | mem0 | mem7 | Notes |
|---|---|---|---|
| OpenAI | :white_check_mark: | :white_check_mark: | Native support |
| Ollama | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| Together | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| LM Studio | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| Azure OpenAI | :white_check_mark: | :white_check_mark: | Via OpenAI-compatible API |
| Hugging Face | :white_check_mark: | :x: | Requires native SDK |
| Gemini | :white_check_mark: | :x: | Requires native SDK |
| Vertex AI | :white_check_mark: | :x: | Requires native SDK |
| AWS Bedrock | :white_check_mark: | :x: | Requires native SDK |
| FastEmbed | :white_check_mark: | :x: | Python-only (ONNX) |
| LangChain | :white_check_mark: | :x: | Python framework |
Vector Stores
| Provider | mem0 | mem7 | Notes |
|---|---|---|---|
| In-memory (FlatIndex) | — | :white_check_mark: | Built-in, good for dev |
| Upstash Vector | :white_check_mark: | :white_check_mark: | REST API, serverless |
| Qdrant | :white_check_mark: | :x: | |
| Chroma | :white_check_mark: | :x: | |
| pgvector | :white_check_mark: | :x: | |
| Milvus | :white_check_mark: | :x: | |
| Pinecone | :white_check_mark: | :x: | |
| Redis | :white_check_mark: | :x: | |
| Weaviate | :white_check_mark: | :x: | |
| Elasticsearch | :white_check_mark: | :x: | |
| OpenSearch | :white_check_mark: | :x: | |
| FAISS | :white_check_mark: | :x: | |
| MongoDB | :white_check_mark: | :x: | |
| Supabase | :white_check_mark: | :x: | |
| Azure AI Search | :white_check_mark: | :x: | |
| Vertex AI Vector Search | :white_check_mark: | :x: | |
| Databricks | :white_check_mark: | :x: | |
| Cassandra | :white_check_mark: | :x: | |
| S3 Vectors | :white_check_mark: | :x: | |
| Baidu | :white_check_mark: | :x: | |
| Neptune | :white_check_mark: | :x: | |
| Valkey | :white_check_mark: | :x: | |
| LangChain | :white_check_mark: | :x: |
Language Bindings
| Language | Status |
|---|---|
| Python | :white_check_mark: PyPI: pip install mem7 |
| TypeScript / Node.js | :white_check_mark: npm: npm install @mem7ai/mem7 |
| Rust | :white_check_mark: crates.io: cargo add mem7 |
| Go | Planned |
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",
)
Examples
See the examples/ directory:
mem7_demo.ipynb— Python notebook demomem7_demo.ts— TypeScript demo
Development
Prerequisites
- Rust 1.85+ (stable)
- Python 3.10+
- Node.js 22+
- 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.5.tar.gz.
File metadata
- Download URL: mem7-0.1.5.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de31cd95873aa827c491a9071d7f3136234d47d6c9680bf7cddfc54c47a43252
|
|
| MD5 |
53229f859bfceb4645d955938ea8a653
|
|
| BLAKE2b-256 |
723d785a880cc0a42038718297be04c18c955940adbf440dbd63e76000e65ce3
|
Provenance
The following attestation bundles were made for mem7-0.1.5.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.5.tar.gz -
Subject digest:
de31cd95873aa827c491a9071d7f3136234d47d6c9680bf7cddfc54c47a43252 - Sigstore transparency entry: 1091045570
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.5-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: mem7-0.1.5-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 |
221e134a982e200b8bb1da1018e982be147fcf7480d319cd3941e3b4bfb2a246
|
|
| MD5 |
1a83652e632929168f04780019ee8d08
|
|
| BLAKE2b-256 |
010add485f091330e1e51cefe1f221c90adcbdbf06b603601579d5707677a10b
|
Provenance
The following attestation bundles were made for mem7-0.1.5-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.5-cp310-abi3-win_amd64.whl -
Subject digest:
221e134a982e200b8bb1da1018e982be147fcf7480d319cd3941e3b4bfb2a246 - Sigstore transparency entry: 1091045584
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.5-cp310-abi3-manylinux_2_24_aarch64.whl.
File metadata
- Download URL: mem7-0.1.5-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 |
e7b8a634a0a2b487dec40dbc7d5dcd2677099840c31823cafee45ff68fc97546
|
|
| MD5 |
9ea0bc654e67ffadb00b34d0609bd840
|
|
| BLAKE2b-256 |
1315f09f30efd303b69b903c7ba361765060bbbb549dee3cb14322b59190279d
|
Provenance
The following attestation bundles were made for mem7-0.1.5-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.5-cp310-abi3-manylinux_2_24_aarch64.whl -
Subject digest:
e7b8a634a0a2b487dec40dbc7d5dcd2677099840c31823cafee45ff68fc97546 - Sigstore transparency entry: 1091045616
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.5-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: mem7-0.1.5-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 |
758968a3e8e004ec844e7a85dd1990774f88fcbe360410d6e6e9885b83f73004
|
|
| MD5 |
ae46ea9346026880b3e8290e26b9bde3
|
|
| BLAKE2b-256 |
fbfe0b52850808070d69659368378266ba9289979be5102a0fe4b11acc4e7886
|
Provenance
The following attestation bundles were made for mem7-0.1.5-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.5-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
758968a3e8e004ec844e7a85dd1990774f88fcbe360410d6e6e9885b83f73004 - Sigstore transparency entry: 1091045594
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.5-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: mem7-0.1.5-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 |
675488af050c5963c70d7a8dd03bde0477fcdd2b8d530cf0c1186acfa083a1cf
|
|
| MD5 |
0b7df1a0aeb176471f1f0c72dbbae05e
|
|
| BLAKE2b-256 |
be0b3cc8da3ded4899bf6ffef6e863fe59580849b16f5fb88efceae6823ff9a5
|
Provenance
The following attestation bundles were made for mem7-0.1.5-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.5-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
675488af050c5963c70d7a8dd03bde0477fcdd2b8d530cf0c1186acfa083a1cf - Sigstore transparency entry: 1091045580
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mem7-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mem7-0.1.5-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 |
2a8a3f37d791d8295fdd0c7d11ded0b6bc726ff4bb2d55cdcbb54ab178734455
|
|
| MD5 |
93b7cc0c6731d39f213f9e8ee9776233
|
|
| BLAKE2b-256 |
5e69fb3b7d6fc58f5f1fe15060ab32e20f5fd8aa18603a184737022860d680fb
|
Provenance
The following attestation bundles were made for mem7-0.1.5-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.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
2a8a3f37d791d8295fdd0c7d11ded0b6bc726ff4bb2d55cdcbb54ab178734455 - Sigstore transparency entry: 1091045607
- Sigstore integration time:
-
Permalink:
mem7ai/mem7@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/mem7ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b78c3375b4340c382f9c56e2ee451c64c4c6ae1 -
Trigger Event:
push
-
Statement type: