Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ EMBEDDING_DIMENSION=2560

# Data directory inside container (default set by Dockerfile/compose; override if needed)
# DATA_DIR=/app/MCP/data

# Optional Milvus backend settings for applications that inject
# MilvusVectorStoreBackend. LanceDB remains the default.
MILVUS_URI=./milvus.db
MILVUS_TOKEN=
MILVUS_DB_NAME=
MILVUS_COLLECTION_NAME=memory_entries
MILVUS_CONSISTENCY_LEVEL=Session
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ pip install -r requirements.txt

# — OR — install as an editable package
pip install -e . # default: text + multimodal + evolver
pip install -e ".[milvus]" # + optional Milvus vector store backend
pip install -e ".[server]" # + MCP / HTTP server (mcp, fastapi, ...)
pip install -e ".[all]" # everything, including dev tools

Expand Down Expand Up @@ -376,6 +377,51 @@ EMBEDDING_MODEL = "Qwen/Qwen3-Embedding-0.6B"

> `deepseek-ai/deepseek-v4-pro` is a reasoning model, so leave enough output budget; if responses come back empty, raise the token limit (>= 512). Any other OpenAI-compatible chat model on Atlas Cloud (e.g. `Qwen/Qwen3-Next-80B-A3B-Instruct`, `zai-org/glm-5`, `moonshotai/kimi-k2.6`) works the same way.

### Optional Milvus vector store

LanceDB remains the default vector store. Install the `milvus` extra and inject
`MilvusVectorStoreBackend` when you want the same semantic, BM25 keyword, and
structured retrieval paths backed by Milvus:

```bash
pip install -e ".[milvus]"
```

```python
from simplemem.core.database import MilvusVectorStoreBackend, VectorStore
from simplemem.core.settings import settings

store = VectorStore(
backend_factory=lambda dimension: MilvusVectorStoreBackend(
collection_name=settings.MILVUS_COLLECTION_NAME,
vector_dimension=dimension,
uri=settings.MILVUS_URI,
token=settings.MILVUS_TOKEN,
db_name=settings.MILVUS_DB_NAME,
consistency_level=settings.MILVUS_CONSISTENCY_LEVEL,
)
)
```

The default `MILVUS_URI=./milvus.db` starts Milvus Lite with a local database
file. The same backend connects to Milvus Server or Zilliz Cloud without code
changes:

```bash
# Milvus Server
export MILVUS_URI=http://localhost:19530

# Zilliz Cloud
export MILVUS_URI=https://YOUR-ENDPOINT.api.gcp-us-west1.zillizcloud.com
export MILVUS_TOKEN=YOUR_API_KEY
```

Set `MILVUS_DB_NAME`, `MILVUS_COLLECTION_NAME`, and
`MILVUS_CONSISTENCY_LEVEL` when the deployment requires non-default database,
collection, or consistency settings. Milvus Lite 3.x uses a storage format that
is not compatible with databases created by Milvus Lite 2.x; create a new local
database or migrate the old data before upgrading.

---

## 🐳 Run with Docker
Expand Down Expand Up @@ -580,5 +626,5 @@ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE)
We would like to thank the following projects and teams:

- 🔍 **Embedding Model**: [Qwen3-Embedding](https://github.com/QwenLM/Qwen) - State-of-the-art retrieval performance
- 🗄️ **Vector Database**: [LanceDB](https://lancedb.com/) - High-performance columnar storage
- 🗄️ **Vector Databases**: [LanceDB](https://lancedb.com/) by default, with optional [Milvus](https://milvus.io/) support
- 📊 **Benchmark**: [LoCoMo](https://github.com/snap-research/locomo) - Long-context memory evaluation framework
9 changes: 9 additions & 0 deletions config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ LANCEDB_PATH = "./lancedb_data"
# Memory table name
MEMORY_TABLE_NAME = "memory_entries"

# Optional Milvus backend settings. LanceDB remains the default backend.
# Use a local file for Milvus Lite, http://localhost:19530 for Milvus Server,
# or a Zilliz Cloud public endpoint with MILVUS_TOKEN.
MILVUS_URI = "./milvus.db"
MILVUS_TOKEN = ""
MILVUS_DB_NAME = ""
MILVUS_COLLECTION_NAME = "memory_entries"
MILVUS_CONSISTENCY_LEVEL = "Session"



# ============================================================================
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def _read_version() -> str:


EXTRAS = {
"milvus": [
"pymilvus[milvus-lite]>=3.0.0",
],
# MCP / HTTP server integration — bounds + members from MCP/requirements.txt
# (authoritative for the MCP/server/ subproject). Members already in defaults
# (lancedb, pyarrow, httpx, pydantic) intentionally omitted here — pip will pick
Expand Down
7 changes: 7 additions & 0 deletions simplemem/core/config_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@
# Memory table name
MEMORY_TABLE_NAME = "memory_entries"

# Optional Milvus backend settings. LanceDB remains the default backend.
MILVUS_URI = "./milvus.db"
MILVUS_TOKEN = ""
MILVUS_DB_NAME = ""
MILVUS_COLLECTION_NAME = "memory_entries"
MILVUS_CONSISTENCY_LEVEL = "Session"



# ============================================================================
Expand Down
4 changes: 4 additions & 0 deletions simplemem/core/database/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from simplemem.core.database.milvus_vector_store_backend import (
MilvusVectorStoreBackend,
)
from simplemem.core.database.vector_store import VectorStore
from simplemem.core.database.vector_store_backend import (
LanceDBVectorStoreBackend,
Expand All @@ -9,6 +12,7 @@

__all__ = [
"LanceDBVectorStoreBackend",
"MilvusVectorStoreBackend",
"ScoreOrder",
"VectorStore",
"VectorStoreBackend",
Expand Down
Loading