LiyaEngine Docs
Platform

Knowledge Collections

Organize documents into collections, scope retrieval per collection, and attach them to one or many domains.

Dashboard

Knowledge Collections group the documents that back retrieval — each collection has its own retrieval config (embedding model, chunking strategy) and can be attached to one or many domains, so you don't have to re-upload the same source library for every domain that needs it.

Two doors, one collection

Collections are reachable both from the dashboard (JWT-authenticated, below) and from your own backend via API key (/v1/collections — see Collections API Reference). Both call the same underlying service, so a collection created through either one is immediately visible and usable through the other — create it via API on signup, manage it by hand in the dashboard afterward, or any mix of the two.

API reference (dashboard, JWT)

GET    /dashboard/collections                              # list collections
POST   /dashboard/collections                               # create a collection
PATCH  /dashboard/collections/:id                            # update config
DELETE /dashboard/collections/:id                             # delete
POST   /dashboard/collections/:id/domains/:domainKey           # attach to a domain
DELETE /dashboard/collections/:id/domains/:domainKey           # detach from a domain
GET    /dashboard/collections/:id/documents                    # list documents in the collection
POST   /dashboard/collections/:id/documents/:documentId          # attach a document
DELETE /dashboard/collections/:id/documents/:documentId          # detach a document
GET    /dashboard/collections/:id/analytics                     # retrieval hit-rate, top queries
GET    /dashboard/collections/:id/connections                   # which domains use this collection

Domain/document attach-detach, analytics, and connections are dashboard-only today — the API-key surface below covers create/list/get/update/delete.

API reference (API key)

GET    /v1/collections           # list collections
POST   /v1/collections            # create a collection
GET    /v1/collections/:id         # get one
PATCH  /v1/collections/:id          # update config
DELETE /v1/collections/:id           # delete

Same validation, same writeTenantAuditLog trail, same response shape as the dashboard door — see the full Collections API Reference for request/response bodies, or use the JavaScript or Python SDK.

Create a collection:

POST https://api.liyaengine.ai/dashboard/collections
Authorization: Bearer <jwt>
Content-Type: application/json

{
  "slug": "support-kb",
  "label": "Support Knowledge Base",
  "domain_keys": ["support"],
  "default_embedding_model": "text-embedding-3-large",
  "default_chunking_strategy": "semantic"
}

domain_keys is required — a collection must be attached to at least one active domain at creation time. tags and visibility aren't set here; update them afterward via PATCH /dashboard/collections/:id.

Uploading documents

Documents are uploaded independently, then attached to a collection:

POST /dashboard/knowledge/documents          # upload a document
GET  /dashboard/knowledge/documents           # list documents
GET  /dashboard/knowledge/documents/:id        # get one
DELETE /dashboard/knowledge/documents/:id       # delete

Once attached to a collection, a document is retrievable by every domain the collection is connected to — update the source once, every domain sees the change.

On this page