Knowledge Sources
Define custom source types and upload documents to power RAG retrieval for your custom domain intents.
Each custom domain draws on one or more collections — a tenant-defined source type (slug) that's attached to a domain via a many-to-many join, not owned 1:1 by it. A collection's slug is unique per tenant; it is not namespaced or prefixed with the domain key.
Create a collection (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 collection with slug contract, attached to the legal-ops domain. The same collection can later be attached to other domains too (POST /dashboard/collections/:id/domains/:domainKey) — it is never renamed or re-namespaced when that happens.
Upload documents
Documents are a first-class, tenant-wide entity that a collection references rather than owns. Upload one and attach it to a collection in the same call via collectionIds (the collection's id from the response above, not its slug):
POST /dashboard/knowledge/documents
Authorization: Bearer <dashboard_jwt>
Content-Type: application/json
{
"fileName": "nda_template.pdf",
"fileBase64": "<base64-encoded file contents>",
"collectionIds": ["<contract-collection-id>"]
}Uploaded documents are chunked, embedded, and stored. When a contract_review intent is called, the engine retrieves contextually relevant chunks from documents attached to collections attached to legal-ops.
Supported file types
| Type | How it's read |
|---|---|
| Text layer, labelled by page. Pages with no text layer (scans) are transcribed with AI when available. | |
| DOCX, TXT, MD, HTML, JSON | Plain text extraction |
| XLSX, CSV | One labelled Header: value line per row, per sheet |
| PPTX | Slides in order, with speaker notes |
| PNG, JPG, JPEG, WEBP | Transcribed with AI |
Scans and images
Images and scanned PDF pages are transcribed by a vision-capable model through your workspace's own model routing — your BYOM endpoint, your BYOK key, or the platform model your plan allows. Nothing is sent to a separate OCR service. For a PDF that mixes text and scanned pages, only the scanned pages are transcribed. Transcription counts toward your token quota and shows up in Cost Explorer under domain knowledge, intent document_transcription.
Transcription is on by default for paid plans. To turn it off, set enable_document_transcription to false in your feature config. Images are then rejected, and scanned pages are skipped and listed as warnings on the sync job. BYOM endpoints accept images but not PDFs. If your model can't read the input, the upload reports why rather than falling back to another provider.
Reading a file without storing it
To use a document's text in a single request, without adding it to a collection, call POST /v1/files/parse. It uses the same parser and transcription and returns the text; nothing is stored. Use a secret API key, not an embed token.
POST /v1/files/parse
Authorization: Bearer liya_sk_...
Content-Type: application/json
{ "file_name": "acord-125.pdf", "file_base64": "<base64>" }The response contains { file_name, format, pages, text, warnings, transcribed_pages }. Pass text into POST /v1/run. Workflows can take files directly; see Files in a run.
How retrieval is scoped
RAG retrieval for a custom domain's intents is filtered to the collections attached to that domain, not to any string-prefix convention. A legal-ops intent retrieves only from collections attached to legal-ops — never from a hiring domain's collections — unless the domain's retrieval scope is explicitly widened via PATCH /dashboard/custom-domains/legal-ops with { "retrievalScope": "domain_plus_global" } or "global_only".
This isolation means you can safely enable multiple domains for the same tenant without knowledge bleed, while still letting the same collection be shared across domains deliberately when you attach it to more than one.
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.