ractogateway.rag.stores.milvus_store
Milvus / Zilliz vector store (lazy import).
Install with: pip install ractogateway[rag-milvus]
- class ractogateway.rag.stores.milvus_store.MilvusStore(collection='ractogateway', *, host='localhost', port=19530, uri=None, token=None, dimension=None, metric_type='IP', batch_size=100)[source]
Bases:
BaseVectorStoreVector store backed by Milvus or Zilliz Cloud.
- Parameters:
collection (
str) – Milvus collection name.host (
str) – Milvus server host (default"localhost").port (
int) – Milvus server port (default19530).uri (
str|None) – Zilliz Cloud URI (overrides host/port when set).dimension (
int|None) – Embedding dimension. Inferred on first add.metric_type (
str) –"IP"(inner product / cosine) or"L2".batch_size (
int) – Vectors per insert batch.
- add(chunks)[source]
Add chunks (with embeddings) to the store.
- Parameters:
chunks (
list[Chunk]) – Chunks to index. Each chunk must have a non-Noneembedding.- Raises:
ValueError – If any chunk has
embedding=None.- Return type:
- search(embedding, top_k=5, filters=None)[source]
Search for the top_k most similar chunks.
- Parameters:
- Return type:
- Returns:
list[RetrievalResult] – Ranked list of results (rank 1 = most similar).