Qdrant
Qdrant stores documents in a collection on your Qdrant server and searches it by meaning, with filters on each document’s data. If the collection does not exist, it creates it.
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
- You already have a Qdrant server or a Qdrant Cloud account.
- You want to filter searches by the documents’ data.
- You want to start storing without creating the collection first.
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 Qdrant API credential with your Qdrant key. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Qdrant 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 (required) | The Qdrant collection. |
| URL (required) | Your Qdrant server address. |
Advanced options
| Field | What it does |
|---|---|
| Number of Results | How many documents each search returns. Default: 4. |
| Port | Server port. Default: 6333. |
| Timeout | Maximum seconds to wait for an answer. |
| Distance Function | How similarity is measured: Cosine (default), Euclidean or Dot Product. |
| Search Type | How to search: Similarity, Similarity with score threshold, MMR (Max Marginal Relevance). Similarity returns the closest; with a threshold, only those above Search Score Threshold; MMR looks for close but varied results. |
| Search Score Threshold | Minimum similarity score, only with the threshold search. Default: 0.0. |
| Filter by Metadata | Searches only among the documents whose data meet some conditions, for example brand equal to Vellani. Works with Search, Retriever and in tool mode. See Filter by metadata. |
Filter by metadata
Besides its text, each document keeps some data (its metadata): the brand, the document type, the month… The filter makes the search look only at the documents whose data meet some conditions. It applies the same way to Results, to Retriever and when an agent uses the component as a tool.
Turn on Filter by Metadata (in the advanced options) and choose Filter Mode:
-
Manual: you write the conditions on the node. In Number of Conditions you choose how many rows you want, and each row has:- Field: the data to check, for example
brand. - Operator:
Equal,NotEqual,GreaterThan,GreaterThanEqual,LessThan,LessThanEqual,In(one of a comma-separated list, such asQ90, S80),NotIn(none of the list) andContains(the text or the list contains the value). - Type:
Text,Int(whole number),Number(with decimals) orBoolean(trueorfalse). - Value: the value to compare with. Left empty, that row does not filter.
Combine Conditions decides whether all of them must match (
AND) or one is enough (OR). - Field: the data to check, for example
-
Dynamic: the conditions arrive as JSON in Metadata Filter (JSON), from another component or written by an agent:{"brand": "Vellani"}: exact value.{"model": ["Q90", "S80"]}: any of the list.{"year": {">=": 2024}, "status": {"!=": "archived"}}: with the operators=,!=,>,>=,<,<=,in,not inandcontains.
With several fields, all of them must match. Empty, it does not filter. A badly written JSON gives an error instead of searching without the filter.
Let the agent fill it in. With the component in tool mode, turn on tool mode for Value (with Field and Operator fixed, for example model and Equal) or for Metadata Filter (JSON). The agent writes the value when the question asks for it (“only the Q90 machine”) and leaves it empty when not. Tell it in the tool description which fields and values exist.
Lists. When a piece of data is a list, like the tags Metadata Tagger writes, Equal and In match when one of its items does, and Contains looks inside them.
In Qdrant greater/less only compare numbers. In Dynamic mode a plain text ({"city": "Barcelona"}) finds the documents whose data contains that text, as before; for the exact value write {"city": {"=": "Barcelona"}}. If Qdrant asks for an index on a field, the component creates it. The old Like operator still works as Contains.
Example: only one brand’s manuals
- When storing, each chunk carries its data, for example
type: manualandbrand: Vellani(set by the file loader or by Metadata Tagger). - On the node with Operation set to
Search, turn on Filter by Metadata, leave Filter Mode onManualand fill in the row: Fieldbrand, OperatorEqual, TypeText, ValueVellani. - Search for “what does error E07 mean”: only chunks from Vellani documents come back.
The same filter in Dynamic mode is {"brand": "Vellani"}. Nodes saved earlier keep their filters; the new field names appear when you update the node.
In a video
This video shows how a brand filter leaves out the chunks of other brands, first with a fixed condition and then with an agent that fills in the value.
What you see in the video:
- Without a filter, “What does error E07 mean?” returns chunks from different brands: the same code means different things on each one.
- With one row in
Manualmode (Fieldbrand, OperatorEqual, ValueVellani), every result is from Vellani. - The list of operators, with
InandContainsfor the code tags, and how several conditions are combined. - An Agent with the database as a tool, where the AI fills in Condition 1: Value: the tool call shows
filter_1_value: "Vellani"and the answer is the Vellani E07 (blocked flowmeter, part VL-1180). - The filter works the same way in FAISS, Chroma DB, PGVector, Neo4j and Elasticsearch.
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 hotel chain keeps its guests’ reviews in Qdrant.
- Add Qdrant with Operation set to
Search, the URL and thereviewscollection. - Connect the embeddings component they were stored with.
- Turn on Filter by Metadata to search only one hotel’s reviews.
Related components
- Recursive Character Text Splitter: cuts documents into pieces before storing them.
- OpenAI Embeddings: converts texts so they can be searched by meaning.
- FastEmbed Embeddings (Local): converts texts inside NappAI, with no key or cost per use.
See also
- Vector databases: how FAISS, Chroma, Qdrant, PGVector and Neo4j differ, and which one to choose.