Liya Engine

Knowledge Sources

Define custom source types and upload documents to power RAG retrieval for your custom domain intents.

Each custom domain can have its own set of source type categories for the knowledge base. When RAG is enabled, retrieval is scoped to source types prefixed with your domain key — {domainKey}:{slug}.


Create a source type

POST /dashboard/custom-domains/legal-ops/source-types
Authorization: Bearer <dashboard_jwt>
Content-Type: application/json
 
{
  "slug": "contract",
  "label": "Contract",
  "color": "#6366f1"
}

This creates a source type with the namespaced ID legal-ops:contract.


Upload documents

Upload documents to your knowledge base tagged with the namespaced source type:

POST /dashboard/knowledge
Authorization: Bearer <dashboard_jwt>
Content-Type: multipart/form-data
 
file=@nda_template.pdf
source_type=legal-ops:contract
title=Standard NDA Template

Uploaded documents are chunked, embedded, and stored. When a contract_review intent is called, the engine retrieves contextually relevant chunks from documents tagged legal-ops:contract.


How retrieval is scoped

RAG retrieval for custom domain intents is automatically filtered to source types matching {domainKey}:*. A legal-ops intent will only retrieve from legal-ops:contract, legal-ops:regulation, etc. — never from hiring:resume or another domain's data.

This isolation means you can safely enable multiple domains for the same tenant without knowledge bleed.


Requiring RAG to be enabled

RAG must be enabled in your tenant feature config:

{
  "featureConfig": {
    "enable_rag": true,
    "enable_embeddings": true
  }
}

Configure via PATCH /dashboard/account/config. See RAG Configuration for full options.

On this page