LiyaEngine Docs

Knowledge base

The documents your AI answers from. Upload them, group them into collections, and attach them to the domains, intents and agents that should use them.

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.

How knowledge reaches an answer

  1. You upload documents. Each is split into passages and indexed.
  2. You group documents into a collection and attach the collection to one or more domains.
  3. An intent names the collections it may use in retrieval_config.source_types; an agent names the domains whose knowledge it may search in knowledge_domain_keys.
  4. At call time the engine retrieves the best passages and puts them in front of the model. Passages below a similarity floor (0.15 by default) are not used, so a question your knowledge cannot answer finds nothing instead of something unrelated. Set similarity_threshold and top_k in an intent's retrieval_config to be stricter or looser.
  5. Every answer returns the sources it used, and a wrong answer can be reported with a correction so the passage behind it can be reviewed.

A domain can also restrict retrieval by who is asking: documents can be limited to access groups, and a call passes the end user's groups. See Access control on retrieval.

The Knowledge area

In the dashboard, Knowledge has five pages:

PageUse it to
DocumentsUpload and manage sources.
CollectionsGroup sources for targeted retrieval.
Sync JobsFollow source updates and indexing jobs.
RetrievalAsk a question and inspect the evidence it retrieves.
AnalyticsSee how knowledge is used.

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