Skip to main content
Version: Next
vector_searchINPUTBUFFERPROCESSOROUTPUT

Vector Search

The vector_search processor searches a Qdrant collection for the top-k nearest neighbors of each row's vector and appends the matches as a JSON array text column. It is the retrieval step of an in-engine RAG pipeline: pair it with the embedding processor (turn text into a query vector) and the LLM processor (generate over the matches).

Configuration​

FieldTypeRequiredDefaultDescription
typestringyes—vector_search
urlstringyes—Qdrant base URL (e.g. http://localhost:6333).
collectionstringyes—Collection to search.
vector_fieldstringnoembeddingColumn holding the query vector (FixedSizeList/List of Float32).
target_fieldstringnomatchesName of the appended matches column.
top_kintegerno5Number of neighbors per row.
score_thresholdnumberno—Minimum similarity score; omitted from the request when unset.
concurrencyintegerno4Maximum in-flight requests; results are always filled back in row order.
api_keystringno—Sent as Authorization: Bearer. Supports secret references.
timeout_msintegerno30000HTTP request timeout.
headersmapno—Extra HTTP headers.

Result shape​

The appended column is a JSON array of matches, ordered by descending score, each preserving Qdrant's id, score, and payload:

[{"id": 42, "score": 0.93, "payload": {"text": "..."}}]

Each row is one search request (bounded by concurrency); the JSON text feeds directly into an LLM processor prompt_template via {{value}}-style composition over the column, or into any downstream JSON tooling.

note

Failures (non-2xx, missing result array, null/empty query vector) fail the batch into error_output. The processor does not retry; size concurrency to stay within rate limits. Requests to loopback endpoints always bypass the system proxy.

Example​

- type: "vector_search"
url: "http://localhost:6333"
collection: "documents"
vector_field: "embedding"
top_k: 5

Complete RAG Query Pipeline​

Query text → embedding → top-k retrieval → LLM answer, all in one stream:

logging:
level: info

streams:
- id: rag-query
input:
type: memory
pipeline:
thread_num: 4
processors:
- type: json_to_arrow
- type: embedding
api_base: "http://localhost:9997/v1"
model: "text-embedding-3-small"
api_key: "${env:OPENAI_API_KEY:-}"
field: "text"
- type: vector_search
url: "http://localhost:6333"
collection: "documents"
top_k: 5
target_field: "matches"
- type: sql
query: "SELECT *, concat('Question: ', text, ' | Passages: ', matches) AS rag_prompt FROM flow"
- type: llm
api_base: "https://api.openai.com/v1"
model: "gpt-4o-mini"
api_key: "${env:OPENAI_API_KEY:-}"
field: "rag_prompt"
system_prompt: "Answer the user's question using only the provided passages."
target_field: "answer"
output:
type: stdout