Tool

Load Data from Milvus Vector Stores

LlamaIndex reader that retrieves documents from a Milvus vector store by query.

Works with milvusllamaindex

71
Spark score
out of 100
Updated 2 days ago
Version 0.14.23
Models

Add to Favorites

Why it matters

Integrate Milvus vector stores with LlamaIndex for efficient data retrieval. This asset enables loading documents based on query vectors, facilitating advanced search and RAG applications.

Outcomes

What it gets done

01

Connect to Milvus instances using provided host, port, and credentials.

02

Retrieve documents from specified Milvus collections based on query vectors.

03

Configure search parameters and result limits for tailored data extraction.

04

Utilize loaded data within LlamaIndex or as a tool in LangChain Agents.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/li-reader-readers-milvus | bash

Overview

LlamaIndex Readers Integration: Milvus

Milvus Reader retrieves documents from a Milvus vector store by query-vector similarity, given connection parameters and a target collection. Use it when you have an existing, reachable Milvus instance and need documents retrieved from a collection by vector similarity.

What it does

Milvus Reader loads data from a Milvus vector store, which provides search based on query vectors. It retrieves documents from a specified Milvus collection using the connection parameters you provide.

When to use - and when NOT to

Use it when you have an existing Milvus vector store and need to retrieve documents from a collection by vector similarity into LlamaIndex or a LangChain Agent. It reads from an existing collection using connection parameters (host, port, credentials), so it is not usable without a running, reachable Milvus instance.

Inputs and outputs

Install with:

pip install llama-index-readers-milvus

Initialize with your connection details, then load by collection and query vector:

from llama_index.readers.milvus import MilvusReader

reader = MilvusReader(
    host="<Milvus Host>",  # Milvus host address (default: "localhost")
    port=19530,  # Milvus port (default: 19530)
    user="",  # Milvus user (default: "")
    password="",  # Milvus password (default: "")
    use_secure=False,  # Use secure connection (default: False)
)

documents = reader.load_data(
    query_vector=[0.1, 0.2, 0.3],  # Query vector
    collection_name="<Collection Name>",  # Name of the Milvus collection
    limit=10,  # Number of results to return
    search_params=None,  # Search parameters (optional)
)

Connection defaults: host defaults to localhost, port to 19530, user/password to empty strings, and use_secure to False. load_data takes a query_vector, collection_name, a limit on results, and optional search_params.

Who it's for

Developers building LlamaIndex or LangChain pipelines that need documents retrieved from an existing Milvus collection by vector similarity.

Source README

LlamaIndex Readers Integration: Milvus

Overview

Milvus Reader is designed to load data from a Milvus vector store, which provides search functionality based on query vectors. It retrieves documents from the specified Milvus collection using the provided connection parameters.

Installation

You can install Milvus Reader via pip:

pip install llama-index-readers-milvus

Usage

from llama_index.readers.milvus import MilvusReader

### Initialize MilvusReader
reader = MilvusReader(
    host="<Milvus Host>",  # Milvus host address (default: "localhost")
    port=19530,  # Milvus port (default: 19530)
    user="",  # Milvus user (default: "")
    password="",  # Milvus password (default: "")
    use_secure=False,  # Use secure connection (default: False)
)

### Load data from Milvus
documents = reader.load_data(
    query_vector=[0.1, 0.2, 0.3],  # Query vector
    collection_name="<Collection Name>",  # Name of the Milvus collection
    limit=10,  # Number of results to return
    search_params=None,  # Search parameters (optional)
)

Implementation for Milvus reader can be found here

This loader is designed to be used as a way to load data into
LlamaIndex and/or subsequently
used as a Tool in a LangChain Agent.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.