LiyaEngine Docs
Configuration

RAG Configuration

Configure retrieval-augmented generation — per-collection chunking, embedding model, and retrieval behaviour for your knowledge base.

Dashboard

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

ValueDescription
fixedSplit by token count, non-overlapping — simple and fast (default)
semanticSplit at sentence boundaries
sliding_windowFixed-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

ModelNotes
text-embedding-3-smallDefault — cost-efficient, high quality
text-embedding-3-largeHigher 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

ValueDescription
collection_onlyOnly retrieve from this collection (default)
collection_plus_domainAlso 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

ValueDescription
no_resultsReturn nothing if this collection has no matching chunks (default)
domain_fallbackFall 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.

On this page