Knowledge¶
Put company documents in a storage folder. When a user asks a question the assistant searches them, answers from what it finds, and cites the file and page. An answer without a citation is not backed by a document: check it like any answer from a language model.
Add documents¶
Each tenant has a folder in the deployment's bucket, <tenant>/knowledge/. Put a file there and it is indexed; overwrite it and it is indexed again; delete it and it leaves the search. Subfolders are fine, and the path under knowledge/ is the name the assistant cites. Use any tool you already have (the S3 console, the CLI, a sync job). A daily check also catches any change the bucket's events missed. Who may change the knowledge base is decided in AWS permissions on that folder, not in the assistant.
Formats: PDF, Word (.docx), Markdown and text, up to 50 MB. Scanned images of text are not read (no OCR), and a password-protected PDF is refused with a message that says so. Documents over 500 pages are refused; split them.
Status¶
GET /api/v1/documents lists each file and GET /api/v1/documents/{id} shows one. It needs a user holding one of the deployment's admin roles.
| Status | Meaning |
|---|---|
queued |
Received, waiting for the indexer |
processing |
Being read |
ready |
Searchable (chunk_count passages) |
failed |
error says why, in words you can act on. Fix the file and put it again |
Who can read what¶
Documents belong to one tenant; another tenant's users never see them. Within a tenant you can limit a folder to roles, in the tenant settings file:
{"tenants": {"acme": {"knowledge_roles": {"hr/": ["hr"], "management/": ["hr", "managers"]}}}}
A file in hr/ can be read, cited and found only by users whose identity includes the role hr. The longest matching folder wins; a file in no listed folder is general knowledge for the whole tenant. Settings load at restart.
The same file sets the assistant's instructions (your product's name and tone) and token limits per tenant.
Citations¶
A finished run has numbered markers in answer and a citations list:
{"status": "completed",
"answer": "Employees get 25 days of paid leave a year [1].",
"citations": [{"number": 1, "document_id": "doc_...", "source": "handbook.pdf", "page": 2,
"section": null, "excerpt": "Employees receive 25 days of paid annual leave..."}]}
page is set for PDFs; for Word and Markdown, section is the heading above the passage.
Chat attachments¶
Users can also attach files to a chat for their own questions. They are private to that user and chat, never part of the knowledge base: POST /api/v1/threads/{id}/attachments returns a short-lived upload URL, then .../complete starts reading. Up to 20 MB and 20 files per chat by default.
Deleting¶
Delete the file from the folder. What deletion does not erase: conversations that already used it keep what the assistant read, until that conversation is deleted or expires under your retention settings. Tell users before they add sensitive material.