RAG Configuration
Configure retrieval-augmented generation — per-collection chunking, embedding model, and retrieval behaviour for your knowledge base.
Retrieval-augmented generation is turned on for a tenant via featureConfig: set enable_rag: true (which requires enable_embeddings: true as a prerequisite).
There is no tenant-wide ragConfig block. Chunking, embedding model, and retrieval behaviour are configured per knowledge collection instead, since different collections often need different settings.
Updating a collection's retrieval settings
PATCH https://api.liyaengine.ai/dashboard/collections/{id}
Authorization: Bearer <dashboard_jwt>
Content-Type: application/json
{
"default_embedding_model": "text-embedding-3-small",
"default_chunking_strategy": "fixed",
"default_chunk_size": 512,
"default_chunk_overlap": 0,
"retrieval_config": {
"scope": "collection_only",
"boost_priority": 1.0,
"fallback_when_empty": "no_results"
}
}Requires the supervisor role or higher. All fields are optional — only the fields you send are updated. The same fields (except retrieval_config) can also be set at creation time via POST /dashboard/collections.
Chunking
Controls how documents attached to this collection are split before embedding.
default_chunking_strategy
| Value | Description |
|---|---|
fixed | Split by token count, non-overlapping — simple and fast (default) |
semantic | Split at sentence boundaries |
sliding_window | Fixed-size chunks with overlap — good for dense documents |
default_chunk_size
Token count per chunk. Clamped to the range 100–2000. Default: 512.
default_chunk_overlap
Only takes effect when default_chunking_strategy is sliding_window — the API rejects a non-zero overlap under any other strategy. Clamped to 0–default_chunk_size - 1.
Embedding model
| Model | Notes |
|---|---|
text-embedding-3-small | Default — cost-efficient, high quality |
text-embedding-3-large | Higher quality for complex retrieval tasks |
Set via default_embedding_model on the collection. Changing the embedding model after documents have been ingested requires re-embedding all existing documents. Contact support before changing this on a production knowledge base.
Retrieval behaviour
retrieval_config.scope
| Value | Description |
|---|---|
collection_only | Only retrieve from this collection (default) |
collection_plus_domain | Also fall back to the other collections attached to the same domain |
retrieval_config.boost_priority
Relative weight applied to this collection's results during retrieval ranking. Clamped to 0.5–3.0. Default: 1.0.
retrieval_config.fallback_when_empty
| Value | Description |
|---|---|
no_results | Return nothing if this collection has no matching chunks (default) |
domain_fallback | Fall back to the domain's other collections if this one returns no matches |
Reading current settings
GET /dashboard/collections
Authorization: Bearer <dashboard_jwt>Each collection in the response includes retrieval_config, default_embedding_model, default_chunking_strategy, default_chunk_size, and default_chunk_overlap.