Memory stack for AI agents: BM25 + Qdrant + Memgraph + RRF retrieval, Gemini Flash inference layer, 8-stage recall pipeline.
Project description
mnemostack
Memory stack for AI agents — durable, structured, semantically searchable.
mnemostack is a hybrid memory system combining BM25, vector search (Qdrant), and knowledge graph (Memgraph) with a unified recall pipeline, reranker, and optional inference layer.
Status: 🚧 alpha — under active development.
Features
- 🧠 Hybrid retrieval — BM25 (exact tokens) + vector (semantic) + graph (relationships), fused via Reciprocal Rank Fusion
- 🔌 Pluggable embeddings — Gemini, Ollama, or HuggingFace (local GPU), via provider registry
- 📚 Temporal knowledge graph — facts have
valid_from/valid_untilso you can query point-in-time state - 💬 Answer mode — inference layer synthesizes concise factual answers with source citations and confidence scores
- 🔄 Consolidation lifecycle — nightly decay, extraction, and promotion of memories
- 🛡 Graceful degradation — retrieval keeps working if graph is down
Installation
# Clone and install in dev mode
git clone https://github.com/YOUR_ORG/mnemostack.git
cd mnemostack
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
# Optional extras
pip install -e ".[huggingface]" # local GPU embeddings
pip install -e ".[mcp]" # MCP server
pip install -e ".[dev]" # tests + linters
Quick start
Pick an embedding provider
from mnemostack.embeddings import get_provider
# Option A: Gemini (cloud, best quality)
provider = get_provider("gemini") # reads GEMINI_API_KEY from env
# Option B: Ollama (local, no API key)
provider = get_provider("ollama", model="nomic-embed-text")
# Option C: HuggingFace (local, GPU)
provider = get_provider("huggingface", model="BAAI/bge-large-en-v1.5")
vec = provider.embed("What did we decide about authentication?")
print(f"{provider.name} — dim {provider.dimension}")
Health check
ok, msg = provider.health_check()
print("provider ok" if ok else f"down: {msg}")
Custom provider
Any class that inherits EmbeddingProvider can be registered:
from mnemostack.embeddings import EmbeddingProvider, register_provider
class MyProvider(EmbeddingProvider):
@property
def name(self): return "my-provider"
@property
def dimension(self): return 512
def embed(self, text): ...
def embed_batch(self, texts): ...
register_provider("my-provider", MyProvider)
Design
See ARCHITECTURE.md for detailed design: pipeline stages, Qdrant schema, Memgraph temporal model, consolidation runtime, MCP tools.
Roadmap
- Embedding provider registry (Gemini / Ollama / HuggingFace)
- Qdrant wrapper + chunking
- BM25 + RRF + reranker pipeline
- Answer mode (Gemini Flash inference)
- Memgraph wrapper + temporal queries
- Consolidation runtime (decay, promote, summarize)
- CLI (
mnemostack search,mnemostack index,mnemostack runtime) - MCP server (Model Context Protocol for Claude/GPT clients)
License
Apache 2.0 — see LICENSE.
Contributing
Early days. Issues and PRs welcome once API stabilizes.
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 mnemostack-0.1.0a2.tar.gz.
File metadata
- Download URL: mnemostack-0.1.0a2.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e80d1d6b43d5d314d248e4ed273cbb73b9384efc77cac58f89029a4544c9d62
|
|
| MD5 |
fd2873e93a543ab4f27f19bfb73901df
|
|
| BLAKE2b-256 |
3c4a392efee9173a734adf923c316d32373388c95f31f4118ac4af17d72751a9
|
File details
Details for the file mnemostack-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: mnemostack-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 29.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79541b4f1ed1ea88c5e29fc49430d7dddbc954aa1ade4fa27f98333205fc7cd3
|
|
| MD5 |
f1674e1c57f83925bd2bf2fd426d75a5
|
|
| BLAKE2b-256 |
7b2c0eac092d28b2d47b7565180ec0ac4e0cef74fd5e6dabc27c63f89a9e6d25
|