Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mem7-0.1.4.tar.gz (39.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mem7-0.1.4-cp310-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

mem7-0.1.4-cp310-abi3-manylinux_2_24_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.24+ ARM64

mem7-0.1.4-cp310-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

mem7-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

mem7-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

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

Hashes for mem7-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f04031e12eca64284b2dca4e7eb3290826db131b62ba292b1961de3600f64c8b
MD5 cc254a060f4009eff3a34f1b5917d64a
BLAKE2b-256 8f1bcfea45b6480f613c3c455aedb4a78051df4d6fac3d40ad442225ebdd29f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for mem7-0.1.4.tar.gz:

Publisher: release.yml on mem7ai/mem7

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for mem7-0.1.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 841fe6a6e489bb41329dfc6e849260d3a521cbac47f58ec301858285600c72dd
MD5 399090c8b7a2e04ca9e57fc93652fea2
BLAKE2b-256 5c81c99a93f8c8b4b307119c645b69480ee0726847ac4a6075d8b09f5a7dc4a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mem7-0.1.4-cp310-abi3-win_amd64.whl:

Publisher: release.yml on mem7ai/mem7

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mem7-0.1.4-cp310-abi3-manylinux_2_24_aarch64.whl.

File metadata

File hashes

Hashes for mem7-0.1.4-cp310-abi3-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 1af8381bee303b3476f56dc5a56e206a148d747401af152f17715caca6c62487
MD5 a8c4d515e9300531a6950330e54608e7
BLAKE2b-256 ec7d7f8b86eea461b1b275e6501f6df544491789c804d2869847023391e02161

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for mem7-0.1.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44b315fe5506bd8528c3d075a261d8b95db84d463e4e788a51ea95673a02a068
MD5 78519887849683a0c3bf3ac7359ff62c
BLAKE2b-256 aa8fa4bd92ce8c2207de06a61866b532f1c269db227eeadcc650e139f9fd7f44

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mem7-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mem7-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 54e330c8b2a398b2af8dbc4a8a7c8bdce8bb7b9681b9d2ef09c067296cccc674
MD5 e406e37b58bb87d52a4ad0262d4ede26
BLAKE2b-256 a087b31a4187eb48d6fbc71b2fc08cca6787ae98b2ab82300f5eb177b4657206

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mem7-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mem7-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 404cb2e96f68072e49a61b4b9a08081e074fa01cf78c2878d7ac019aea889a88
MD5 7d6e8bb9dbf1eea3476bec07408bf1c8
BLAKE2b-256 3fe6ec5474c09cf1192072a04c73493cdf2f560a68a44b611879d8f86b74f62f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page