milvus-io/milvus-lite
A lightweight version of Milvus
Milvus Lite – Quick Overview
What it is: Milvus Lite is a pure‑Python, local‑only version of the Milvus vector database. It lets you store vectors, scalar fields, and text, and run similarity search, filtering, and hybrid (vector + text) queries without needing the full Milvus server or any C++ components.
Why it matters: Developers often need a lightweight, easy‑to‑install database for notebooks, unit tests, or small prototypes. Milvus Lite mimics the Milvus pymilvus API, so code written against it can later be switched to a production Milvus deployment (stand‑alone, distributed, or Zilliz Cloud) with minimal changes.
Key capabilities:
- Local storage – data lives in a single
.dbfile (or a directory) using an LSM‑tree style engine with WAL, memtables, and Parquet segments. - Vector search – dense vectors via FAISS indexes (HNSW, IVF, etc.) and sparse vectors with exact inner‑product or BM25 scoring.
- Full‑text & hybrid search – built‑in BM25 analyzer, optional Jieba for Chinese, and the ability to combine vector and text scores.
- Rich schema – support for many scalar types, dynamic fields, JSON, arrays, geometry (WKT), and functions like OpenAI text‑embedding.
- gRPC adapter – runs a local Milvus‑compatible server so multiple Python processes can share the same database.
- Python‑only – all core logic is written in Python, giving clear stack traces and easy inspection.
Typical usage:
from pymilvus import MilvusClient
client = MilvusClient("./demo.db")
client.create_collection("docs", dimension=4)
client.insert("docs", [{"id":1, "vector":[0.1,0.2,0.3,0.4], "text":"python tutorial"}])
results = client.search("docs", data=[[0.1,0.2,0.3,0.4]], limit=2)
You can also start a server (milvus-lite server) and connect via uri="http://127.0.0.1:19530" or use the embedded engine API directly (from milvus_lite import MilvusLite).
Limitations: single‑process writes, no authentication, no distributed scaling, no binary/float16 vectors, and some advanced Milvus features (e.g., product‑quantization indexes, spatial indexes) are missing.
Repository Summary (from the README)
| Aspect | Details |
|---|---|
| License | Apache 2.0 |
| Language | Python 3.10+ |
| Installation | pip install -U milvus-lite (or via pymilvus[milvus-lite]) |
| Core deps | pyarrow, numpy, faiss‑cpu, grpcio |
| Main components | Adapter (gRPC), Engine (storage, search, index, analyzer, function, schema) |
| Supported data types | Dense & sparse vectors, BOOL, integers, FLOAT, DOUBLE, VARCHAR, JSON, ARRAY, GEOMETRY, TIMESTAMPTZ |
| Search metrics | COSINE, L2, IP, BM25 |
| Indexes | HNSW, IVF, FLAT, BRUTE_FORCE, sparse inverted, scalar inverted |
| Features | CRUD, partitions, aliases, snapshots, hybrid search, reranking, full‑text, geometry filters |
| Running modes | Local .db file, embedded engine API, local gRPC server |
| Docs & tests | Design docs in docs/, extensive CI across OSes and Python 3.10‑3.13 |
| Typical users | Notebook developers, CI tests, small‑scale AI apps, anyone needing Milvus‑compatible API without a full server |
Who Might Benefit?
- Data scientists building proof‑of‑concept similarity search pipelines in Jupyter.
- Engineers writing unit or integration tests for code that will eventually talk to a real Milvus cluster.
- Students learning vector databases and wanting to experiment locally without Docker or heavy installations.
Quick Start Checklist
pip install "pymilvus[milvus-lite]"- Create a client with a path to a
.dbfile. - Define a collection schema (or let Milvus create one automatically).
- Insert vectors / text / scalar fields.
- Run
search,query, ordeleteas needed. - For multi‑process work, start
milvus-lite server --data-dir ./data --port 19530and point clients to the URI.
All information above is taken directly from the project's README; no external assumptions have been added.
Related
- Project
- Project
- Project
- Project
- Project