RAG
Chunking, embeddings, vector stores, retrieval, reranking, compression, context and citations.
The retrieval-augmented generation family. Embedding Model and Vector Store output handles that you connect to both the indexing flow and the query flow, so they always share the model and collection. See RAG pipelines for complete recipes.
| Node | Category | Summary |
|---|---|---|
| Chunker | RAG | Splits documents into chunks: recursive, fixed, sentence, markdown, layout-aware, semantic, whole-document or parent-child. Every chunk keeps exact source offsets for citations. |
| Citation Builder | RAG | Links [n] markers in the answer to their sources and checks that every citation is valid. |
| Context Builder | RAG | Numbers the retrieved chunks as sources, fits them into a token budget and builds the prompt. |
| Context Compressor | RAG | Shrinks retrieved chunks to the sentences relevant to the query, keeping IDs and sources. |
| Embedding Model | RAG | Chooses the embedding model. Connect it to both Index Documents and Retriever. |
| Hybrid Search | RAG | Combines vector (meaning) and keyword (exact terms) search, for one or several query variants. |
| Index Documents | RAG | Embeds chunks into the vector store and keeps a keyword index (unchanged chunks are skipped). |
| Keyword Search | RAG | BM25 keyword search over the chunks indexed by Index Documents (exact terms, names, codes). |
| Parent Expander | RAG | Replaces retrieved small chunks with their larger parent sections (parent-child chunking): precise matching, fuller context for the answer. |
| Query Rewriter | RAG | Makes follow-up questions standalone (using chat history) and adds alternative phrasings. |
| Reranker | RAG | Rescores retrieved chunks against the query with a cross-encoder (or an LLM) and keeps the best. |
| Retriever | RAG | Embeds the query and returns the most similar chunks with scores. |
| Vector Store | RAG | Selects a vector database collection. Connect it to both Index Documents and Retriever. |
Chunker
agenticmind.rag.chunker · version 1.1.0 · older versions kept: 1.0.0
Splits documents into chunks: recursive, fixed, sentence, markdown, layout-aware, semantic, whole-document or parent-child. Every chunk keeps exact source offsets for citations.
Typical use. Splits documents into chunks with exact source offsets, so citations and retrieval metrics stay valid. Strategies: recursive, fixed, sentence, markdown, layout, semantic, document and parent_child. Sizes are approximate tokens by default.
| Input | Type | Required | Description |
|---|---|---|---|
documents |
DocumentSet | yes | |
embedding_model |
EmbeddingModel | no | semantic: use these embeddings to find topic changes (otherwise word overlap) |
| Output | Type | Description |
|---|---|---|
chunks |
DocumentSet | Chunks to index (children for parent_child) |
parents |
DocumentSet | parent_child: the parent sections |
- Control branches:
done - Permissions:
network,credentials - Execution policy: timeout 600s, max attempts 1, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
strategy |
recursive · fixed · sentence · markdown · layout · semantic · document · parent_child |
recursive |
recursive: character/token splitting on paragraphs → lines → sentences → words. fixed: sliding window. sentence: whole sentences packed together. markdown: by headings. layout: follows the document’s structure (headings stay with their content; tables, lists and code are not cut). semantic: splits where the topic changes. document: one chunk per document (split only if too long). parent_child: small chunks for retrieval, each linked to a larger parent section for the answer. |
unit |
tokens · characters |
tokens |
Size unit. Tokens are approximate (words and punctuation). |
chunk_size |
integer | 300 |
Maximum chunk size (children for parent_child). |
chunk_overlap |
integer | 50 |
Chunk Overlap |
parent_chunk_size |
integer | 1200 |
Size of the parent sections returned to the model. |
semantic_threshold |
integer | 90 |
Percentile of sentence-to-sentence dissimilarity treated as a topic change (higher = fewer, larger chunks). |
min_chunk_size |
integer | 40 |
Smaller semantic groups are merged with a neighbour. |
separators |
array | Recursive separators, coarsest first. |
Citation Builder
agenticmind.rag.citation_builder · version 1.0.0
Links [n] markers in the answer to their sources and checks that every citation is valid.
Typical use. Parses [n], [1, 3] and [1-3] markers in the answer, maps them to sources, removes markers that point nowhere and outputs {answer, citations, validation} for Chat and APIs.
| Input | Type | Required | Description |
|---|---|---|---|
answer |
String | yes | |
sources |
JSON | yes |
| Output | Type | Description |
|---|---|---|
answer |
String | |
citations |
JSON | Cited sources, in order of first use |
result |
JSON | {answer, citations, validation} for chat/API |
- Control branches:
done - Permissions: none
- Execution policy: timeout 30s, max attempts 1, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
require_citations |
boolean | false |
Fail the node when the answer cites no valid source. |
remove_invalid |
boolean | true |
Remove markers that point to sources that do not exist (e.g. [9] with 4 sources). |
Context Builder
agenticmind.rag.context_builder · version 1.0.0
Numbers the retrieved chunks as sources, fits them into a token budget and builds the prompt.
Typical use. Numbers the retrieved chunks [1]..[n], removes duplicates, fits them into a token budget and renders the prompt template (which must contain {{context}} and {{question}}).
| Input | Type | Required | Description |
|---|---|---|---|
documents |
DocumentSet | yes | |
question |
String | yes |
| Output | Type | Description |
|---|---|---|
prompt |
String | Ready-to-send prompt for the LLM |
context |
String | Numbered source text only |
sources |
JSON | Source list for the Citation Builder |
- Control branches:
done - Permissions: none
- Execution policy: timeout 30s, max attempts 1, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
token_budget |
integer | 3000 |
Maximum approximate tokens of source text in the prompt. |
order |
relevance · document |
relevance |
relevance: best match first. document: in reading order (file, page, position). |
deduplicate |
boolean | true |
Drop repeated or overlapping chunks. |
instructions |
string | see below | Prompt template. Must contain {{context}} and {{question}}. |
Answer the question using only the numbered sources below.
Cite every claim inline with the source number in square brackets, e.g. [1] or [2][3].
If the sources do not contain the answer, say that you don't know. Do not invent sources.
Sources:
{{context}}
Question: {{question}}Context Compressor
agenticmind.rag.context_compressor · version 1.0.0
Shrinks retrieved chunks to the sentences relevant to the query, keeping IDs and sources.
Typical use. Shrinks each retrieved chunk to the sentences relevant to the query. extractive needs no model; llm mode may only keep sentences that literally occur in the source.
| Input | Type | Required | Description |
|---|---|---|---|
query |
String | yes | |
documents |
DocumentSet | yes |
| Output | Type | Description |
|---|---|---|
documents |
DocumentSet | |
report |
JSON | {documents_in/out, chars_in/out, ratio} |
- Control branches:
done - Permissions:
network,credentials - Execution policy: timeout 300s, max attempts 2, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
llm_provider |
openrouter · openai · anthropic · gemini · azure_openai · bedrock · mistral · groq · deepseek · together · xai · huggingface · ollama · openai_compatible · mock |
openrouter |
Llm Provider |
llm_model |
string | google/gemini-3.8-flash |
Llm Model |
api_key |
secret ref | API key for LLM mode, e.g. OPENROUTER_API_KEY | |
base_url |
string | Base Url | |
max_tokens |
integer | 4000 |
Max Tokens |
method |
extractive · llm |
extractive |
extractive: keep the sentences that share terms with the query (fast, no model). llm: a model picks the relevant sentences; only sentences that really appear in the source are kept. |
max_sentences |
integer | 4 |
Sentences kept per chunk. |
neighbors |
integer | 1 |
extractive: also keep this many adjacent sentences. |
drop_irrelevant |
boolean | true |
Remove chunks with no relevant sentence at all. |
Embedding Model
agenticmind.rag.embedding_model · version 1.0.0
Chooses the embedding model. Connect it to both Index Documents and Retriever.
Typical use. Chooses the embedding model, as a handle. Connect the same node to Index Documents and to Retriever (or Hybrid Search) so ingestion and querying always use the same model. Default: local fastembed BAAI/bge-small-en-v1.5, no key needed.
No data inputs.
| Output | Type | Description |
|---|---|---|
model |
EmbeddingModel |
- Control branches:
done - Permissions:
credentials - Execution policy: timeout 30s, max attempts 1, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
provider |
fastembed · openai_compatible · hash |
fastembed |
fastembed: local open-source model (default, no key; first use downloads it once). openai_compatible: an embedding API such as OpenRouter or OpenAI. hash: tiny offline test embedder (low quality). |
model |
string | BAAI/bge-small-en-v1.5 |
fastembed e.g. BAAI/bge-small-en-v1.5 · OpenRouter e.g. google/gemini-embedding-001 |
base_url |
string | API base URL for openai_compatible (default https://openrouter.ai/api/v1). | |
api_key |
secret ref | API key for openai_compatible, e.g. OPENROUTER_API_KEY | |
dimensions |
integer | Output size (hash embedder, or APIs that support shortening). Leave empty for the model default. | |
batch_size |
integer | 32 |
Batch Size |
Hybrid Search
agenticmind.rag.hybrid_search · version 1.0.0
Combines vector (meaning) and keyword (exact terms) search, for one or several query variants.
Typical use. Runs vector and keyword search (for one or several query variants) and fuses the results with reciprocal rank fusion or a weighted score mix.
| Input | Type | Required | Description |
|---|---|---|---|
query |
String | yes | |
queries |
JSON | no | Extra query variants (e.g. from Query Rewriter); all results are fused |
model |
EmbeddingModel | yes | |
store |
VectorStoreHandle | yes |
| Output | Type | Description |
|---|---|---|
documents |
DocumentSet |
- Control branches:
done - Permissions:
network,filesystem,database,credentials - Execution policy: timeout 120s, max attempts 2, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
top_k |
integer | 8 |
Results after fusion. |
candidates |
integer | 20 |
Results fetched per method and query. |
fusion |
rrf · weighted |
rrf |
rrf: reciprocal rank fusion (robust, ignores score scales). weighted: mix normalised scores. |
vector_weight |
number | 0.5 |
weighted fusion: share of the vector score. |
rrf_k |
integer | 60 |
Rrf K |
filters |
object | Filters |
Index Documents
agenticmind.rag.index_documents · version 1.1.0 · older versions kept: 1.0.0
Embeds chunks into the vector store and keeps a keyword index (unchanged chunks are skipped).
Typical use. Embeds chunks into the vector store and keeps a local BM25 keyword index. Unchanged chunks are skipped (content hash plus model identity). Turn on recreate after switching to a model with different dimensions.
| Input | Type | Required | Description |
|---|---|---|---|
documents |
DocumentSet | yes | |
model |
EmbeddingModel | yes | |
store |
VectorStoreHandle | yes |
| Output | Type | Description |
|---|---|---|
report |
JSON |
- Control branches:
done - Permissions:
network,filesystem,database,credentials - Execution policy: timeout 1800s, max attempts 2, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
skip_unchanged |
boolean | true |
Only embed chunks that are new or changed since the last indexing run. |
recreate |
boolean | false |
Delete the collection first (needed after switching to a model with other dimensions). |
upsert_batch_size |
integer | 128 |
Upsert Batch Size |
keyword_index |
boolean | true |
Also keep a BM25 keyword index (local) for Keyword Search and Hybrid Search. |
Keyword Search
agenticmind.rag.keyword_search · version 1.0.0
BM25 keyword search over the chunks indexed by Index Documents (exact terms, names, codes).
Typical use. BM25 search over the keyword index Index Documents maintains. Best for exact terms: product codes, names, error IDs.
| Input | Type | Required | Description |
|---|---|---|---|
query |
String | yes | |
store |
VectorStoreHandle | yes | Same Vector Store as indexing |
| Output | Type | Description |
|---|---|---|
documents |
DocumentSet |
- Control branches:
done - Permissions:
network,filesystem,database,credentials - Execution policy: timeout 60s, max attempts 2, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
top_k |
integer | 5 |
Top K |
filters |
object | Exact-match filters, e.g. {“filename”: “handbook.pdf”, “metadata.lang”: “en”}. |
Parent Expander
agenticmind.rag.parent_expander · version 1.0.0
Replaces retrieved small chunks with their larger parent sections (parent-child chunking): precise matching, fuller context for the answer.
Typical use. After retrieving small child chunks (parent_child strategy), swaps them for their larger parent sections, de-duplicated in rank order.
| Input | Type | Required | Description |
|---|---|---|---|
documents |
DocumentSet | yes | Retrieved chunks |
| Output | Type | Description |
|---|---|---|
documents |
DocumentSet | Parent sections, best first |
- Control branches:
done - Permissions: none
- Execution policy: timeout 30s, max attempts 1, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
max_parents |
integer | 5 |
Return at most this many parent sections. |
Query Rewriter
agenticmind.rag.query_rewriter · version 1.0.0
Makes follow-up questions standalone (using chat history) and adds alternative phrasings.
Typical use. Makes a follow-up question standalone using chat history and adds alternative phrasings for Hybrid Search. Falls back to the original query rather than blocking retrieval.
| Input | Type | Required | Description |
|---|---|---|---|
query |
String | yes | |
history |
JSON | no | [{role, content}] earlier turns |
| Output | Type | Description |
|---|---|---|
query |
String | Standalone query |
queries |
JSON | Standalone query + variants (for Hybrid Search) |
- Control branches:
done - Permissions:
network,credentials - Execution policy: timeout 120s, max attempts 2, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
llm_provider |
openrouter · openai · anthropic · gemini · azure_openai · bedrock · mistral · groq · deepseek · together · xai · huggingface · ollama · openai_compatible · mock |
openrouter |
Llm Provider |
llm_model |
string | google/gemini-3.8-flash |
Llm Model |
api_key |
secret ref | API key for LLM mode, e.g. OPENROUTER_API_KEY | |
base_url |
string | Base Url | |
max_tokens |
integer | 4000 |
Max Tokens |
variants |
integer | 3 |
Alternative phrasings to generate. |
temperature |
number | 0.3 |
Temperature |
Reranker
agenticmind.rag.reranker · version 1.0.0
Rescores retrieved chunks against the query with a cross-encoder (or an LLM) and keeps the best.
Typical use. Rescores the first-stage results against the query with a local cross-encoder (default, ~80 MB, no key) or an LLM, and keeps the best top_k. Adds rerank_score and keeps the original score.
| Input | Type | Required | Description |
|---|---|---|---|
query |
String | yes | |
documents |
DocumentSet | yes |
| Output | Type | Description |
|---|---|---|
documents |
DocumentSet |
- Control branches:
done - Permissions:
network,filesystem,credentials - Execution policy: timeout 300s, max attempts 2, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
llm_provider |
openrouter · openai · anthropic · gemini · azure_openai · bedrock · mistral · groq · deepseek · together · xai · huggingface · ollama · openai_compatible · mock |
openrouter |
Llm Provider |
llm_model |
string | google/gemini-3.8-flash |
Llm Model |
api_key |
secret ref | API key for LLM mode, e.g. OPENROUTER_API_KEY | |
base_url |
string | Base Url | |
max_tokens |
integer | 4000 |
Max Tokens |
provider |
fastembed · llm · overlap |
fastembed |
fastembed: local cross-encoder (default, no key; downloads ~80 MB once). llm: a chat model scores each passage. overlap: word-overlap test scorer (offline, low quality). |
model |
string | Xenova/ms-marco-MiniLM-L-6-v2 |
Cross-encoder for fastembed. |
candidates |
integer | 20 |
How many incoming results to rescore. |
top_k |
integer | 5 |
Results to keep after reranking. |
score_threshold |
number | Drop results with a rerank score below this (0..1). |
Retriever
agenticmind.rag.retriever · version 1.0.0
Embeds the query and returns the most similar chunks with scores.
Typical use. Embeds the query and returns the top_k most similar chunks, with cosine-similarity scores and optional exact-match filters.
| Input | Type | Required | Description |
|---|---|---|---|
query |
String | yes | |
model |
EmbeddingModel | yes | |
store |
VectorStoreHandle | yes |
| Output | Type | Description |
|---|---|---|
documents |
DocumentSet |
- Control branches:
done - Permissions:
network,filesystem,database,credentials - Execution policy: timeout 120s, max attempts 2, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
top_k |
integer | 5 |
Number of chunks to return. |
score_threshold |
number | Drop results scoring below this (cosine similarity). | |
filters |
object | Exact-match filters, e.g. {“filename”: “handbook.pdf”, “page”: 3, “metadata.lang”: “en”}. |
Vector Store
agenticmind.rag.vector_store · version 1.0.0
Selects a vector database collection. Connect it to both Index Documents and Retriever.
Typical use. Chooses a vector database collection, as a handle. Qdrant (embedded) is the default; 12 backends are available. Connect the same node to Index Documents and the retrieval nodes.
No data inputs.
| Output | Type | Description |
|---|---|---|
store |
VectorStoreHandle |
- Control branches:
done - Permissions:
credentials - Execution policy: timeout 30s, max attempts 1, idempotent
| Setting | Type | Default | Description |
|---|---|---|---|
backend |
qdrant · chroma · faiss · lancedb · pgvector · pinecone · milvus · weaviate · elasticsearch · opensearch · mongodb · redis |
qdrant |
Embedded on this server (no URL): qdrant, chroma, faiss, lancedb. Servers / cloud: qdrant, chroma, lancedb (db://), milvus / Zilliz, weaviate, elasticsearch, opensearch, redis (URL); pgvector and mongodb (Atlas Vector Search) via a dsn secret; pinecone via an api_key secret. |
collection |
string | documents |
Collection (index/table) name. |
namespace_by_project |
boolean | true |
Prefix the collection with the project ID so projects never share data. |
distance |
cosine · dot |
cosine |
Distance |
url |
string | Server URL, e.g. http://localhost:6333 (Qdrant), http://localhost:19530 (Milvus), https://my-cluster.weaviate.cloud, https://localhost:9200 (Elasticsearch; OpenSearch with user:password@), redis://localhost:6379, db://my-database (LanceDB Cloud). Empty = embedded on this server where the backend supports it. | |
api_key |
secret ref | API key / token secret (Pinecone, Qdrant Cloud, Chroma Cloud, LanceDB Cloud, Milvus/Zilliz token, Weaviate Cloud, Elasticsearch) | |
dsn |
secret ref | Connection string secret: PostgreSQL (pgvector), mongodb+srv://… (MongoDB Atlas) or redis://… with a password | |
cloud |
string | Pinecone cloud (default aws) | |
region |
string | Pinecone region (default us-east-1); LanceDB Cloud region. | |
namespace |
string | Pinecone namespace; MongoDB database (default agenticmind). |

