Milvus
Milvus stores documents in a Milvus or Zilliz collection and searches it by meaning.
A vector database stores texts so they can be searched by meaning, not just by exact words. That way an agent can find the paragraph of a manual that answers a question even if it uses different words.
When to use it
- Your company already has a Milvus server or a Zilliz account.
- You need a vector database for a lot of content.
- You want to control the collection’s field names.
Configuration
The Operation field decides what the component does, and the fields and outputs change with your choice:
Add(default): stores in the database the documents it receives in Ingest Data.Search: finds the documents closest to the text in Search Query.Retriever: offers the database as a search engine for another component to use, for example an agent or a question-answering chain.
You need a Milvus API credential. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Milvus API credential with the connection details. |
| Operation | What the component does: Add, Search or Retriever. |
| Ingest Data (required) | With Add. The documents to store, usually those coming out of a text splitter or a file loader. |
| Search Query | With Search. The text to search for. If left empty, nothing is returned. |
| Embedding | The connector where you plug the component that turns texts into numbers to compare them by meaning, such as OpenAI Embeddings. Always use the same one to store and to search. |
| Collection Name | The Milvus collection to use. |
| Collection Description | Optional description of the collection. |
| Connection URI | The address of your Milvus server or your Zilliz account. |
| Connection Password | The password or access token. |
| Primary Field Name | Together with Text Field Name and Vector Field Name: the collection’s field names. Defaults: pk, text and vector. |
Advanced options
| Field | What it does |
|---|---|
| Number Of Results | How many documents each search returns. Default: 4. |
| Consistencey Level | How up to date the data must be when searching: Bounded, Session (default), Strong or Eventual. |
| Drop Old Collection | Deletes the collection before storing. Off by default; use with care. |
| Other Connection Arguments | Together with Index Parameters, Search Parameters and Timeout: technical Milvus settings that whoever runs the server will give you. |
Output
The outputs depend on Operation:
- Results: with
AddandSearch. WithSearch, the list of documents found, which you can pass to a prompt or an agent. - Vector Store: with
Add. The database, to connect it to components that work with a vector database. - Retriever: with
Retriever. The search engine, to connect it to components that ask for one.
In tool mode, an agent can use the component to search by itself. See Tool Mode.
Example
A spare-parts company keeps its technical catalogue in Zilliz.
- Add Milvus with Operation set to
Search. - Type the Zilliz address in Connection URI, the token in Connection Password and the collection.
- Connect the embeddings component the catalogue was stored with.
Related components
- Recursive Character Text Splitter: cuts documents into pieces before storing them.
- OpenAI Embeddings: converts texts so they can be searched by meaning.