Vector RAG pipeline
Vector memory connects agent turns to a Qdrant collection through embed, store, retrieve, and optional rerank stages. The engine injects retrieved context into the agent prompt while traces record only chunk counts and byte totals (trace data policy).
Types overview: Memory types. Retrieval tuning: Hybrid retrieval and reranking. Ingest paths: Knowledge ingestion.
Pipeline stages
Agent memory_config
| Stage | Config field |
|---|---|
| Collection identity | namespace |
| Embedding model | embedding provider string |
| Retrieval | retrieval.mode, top_k, weights |
| Rerank | retrieval.rerank (optional) |
| Ingest chunking | chunking.chunk_size, chunk_overlap |
Stage 1: Ingest
Text is split using MemoryChunkingConfig:
Each chunk is embedded via the embedding string (for example openai/text-embedding-3-small) and upserted into the Qdrant collection named by namespace.
SDK and admin ingest paths differ; see Knowledge ingestion.
Stage 2: Retrieve
On each agent turn, the runtime embeds the query (typically derived from the current prompt context) and searches Qdrant.
| mode | Behavior |
|---|---|
dense | Vector similarity only |
hybrid | Dense + sparse when ARCFLOW_QDRANT_HYBRID=true |
Set env:
Stage 3: Rerank
Optional Cohere rerank narrows top_k chunks to top_n before prompt injection. Requires COHERE_API_KEY.
Failure maps to RerankError (502). Engine may degrade per configuration; watch for MemoryDegraded traces.
Stage 4: Trace (trace data policy)
No chunk text in traces or persisted arcflow_trace_events. Trace data policy.
Full agent example
Docker stack
Local RAG development typically uses docker/docker-compose.server.yml (Postgres + Qdrant + server). See Server API quickstart.
Verification
After ingest and run:
result.statusisCompleted- Trace contains
MemoryRetrievedwithchunk_count > 0 - No
MemoryDegradedunless testing failure paths
Examples: examples/rag/, examples/static/chat-rag/, examples/online-application-chatbot/.
Production checklist
| Requirement | Reason |
|---|---|
| Real Qdrant URL | Stub vector backend is dev-only |
| Non-stub embedding provider | Deterministic stub embeddings do not generalize |
| Namespace per tenant or site | Isolation for static product KB |
| Cohere key if rerank enabled | Avoid silent rerank failures |