Collections & access
A collection is the unit you govern. It holds documents, carries the retrieval settings, and is bound to one or more resource groups. Only calls made under a bound group (or a child that inherits from it) retrieve from it.
All endpoints on this page are on the Control Plane at
http://localhost:5050/v1/admin/knowledge-base and take an admin JWT. The tenant comes from
the token. The tenant feature flag knowledge_base must be on: creating a collection on a
tenant without it returns 403 (Feature 'knowledge_base' is not enabled for this tenant…).
| Method | Path | Purpose | Permission |
|---|---|---|---|
| GET | /collections |
List the tenant’s collections, sorted by name | knowledge_base:read |
| POST | /collections |
Create a collection (201) |
knowledge_base:create |
| GET | /collections/{collection_id} |
Get one collection | knowledge_base:read |
| PATCH | /collections/{collection_id} |
Partial update, optionally replacing group bindings | knowledge_base:update |
| DELETE | /collections/{collection_id} |
Delete the collection, its documents and its vectors (204) |
knowledge_base:delete |
| POST | /collections/{collection_id}/groups |
Replace the group bindings (204) |
knowledge_base:update |
| POST | /collections/{collection_id}/search |
Admin retrieval preview (see Retrieval) | knowledge_base:read |
Create a collection
Section titled “Create a collection”curl -s -X POST http://localhost:5050/v1/admin/knowledge-base/collections \ -H "Authorization: Bearer $ADMIN_JWT" \ -H "Content-Type: application/json" \ -d '{ "name": "sales-playbooks", "description": "EMEA sales enablement", "top_k": 5, "similarity_threshold": 0.75, "max_context_tokens": 2000, "system_prompt_template": "Answer from these sales playbook excerpts and cite them by number:\n\n{context}", "group_ids": ["group-01M61N36QYK1HVPN41KAE35PHP"] }'import requests
BASE = "http://localhost:5050"r = requests.post( f"{BASE}/v1/admin/knowledge-base/collections", headers={"Authorization": f"Bearer {ADMIN_JWT}"}, json={ "name": "sales-playbooks", "description": "EMEA sales enablement", "top_k": 5, "similarity_threshold": 0.75, "max_context_tokens": 2000, "group_ids": ["group-01M61N36QYK1HVPN41KAE35PHP"], },)r.raise_for_status()collection = r.json()print(collection["id"], collection["groups"])const BASE = "http://localhost:5050";const res = await fetch(`${BASE}/v1/admin/knowledge-base/collections`, { method: "POST", headers: { Authorization: `Bearer ${ADMIN_JWT}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "sales-playbooks", description: "EMEA sales enablement", top_k: 5, similarity_threshold: 0.75, max_context_tokens: 2000, group_ids: ["group-01M61N36QYK1HVPN41KAE35PHP"], }),});const collection = await res.json(); // 201Response 201:
{ "id": "01K8ZQ3V7M2T4N6P8R0S2U4W6Y", "tenant_id": "default", "name": "sales-playbooks", "description": "EMEA sales enablement", "enabled": true, "top_k": 5, "similarity_threshold": 0.75, "max_context_tokens": 2000, "system_prompt_template": "Answer from these sales playbook excerpts and cite them by number:\n\n{context}", "group_ids": ["group-01M61N36QYK1HVPN41KAE35PHP"], "groups": [ {"id": "group-01M61N36QYK1HVPN41KAE35PHP", "name": "borealis-consumer-finance", "display_name": null} ], "document_count": 0, "version": null, "created_at": "2026-10-28T09:12:03.418211+00:00", "updated_at": "2026-10-28T09:12:03.418211+00:00", "created_by": "admin", "updated_by": null}Collection IDs are bare ULIDs (no prefix). Names are unique within a tenant.
Collection fields
Section titled “Collection fields”| Field | Type / range | Default | Example | Meaning |
|---|---|---|---|---|
name |
string, 1–255 | required | "sales-playbooks" |
Unique per tenant |
description |
string, ≤1024 | null |
"EMEA sales enablement" |
Shown in the Admin UI and the portal |
enabled |
bool | true |
false |
Master switch. A disabled collection is never retrieved from and is hidden from the portal list by default |
top_k |
int, 1–50 | 5 |
8 |
Chunks returned by the hybrid search per query |
similarity_threshold |
float, 0.0–1.0 | 0.75 |
0.6 |
Cosine cutoff applied to the dense (semantic) candidates before fusion |
max_context_tokens |
int, 100–32000 | 2000 |
4000 |
Budget for injected context, estimated at 4 characters per token |
system_prompt_template |
string, ≤4096 | built-in | "Use these excerpts:\n\n{context}" |
Wrapper for the injected context. {context} is replaced by the numbered chunks |
group_ids |
list of group IDs | none | ["group-01M61N36…"] |
Resource groups bound on create (PATCH: replaces all bindings) |
version |
string, ≤50 | "1.0" |
"2026.3" |
Operator-authored label; change history lives in the audit log |
The built-in template, used when system_prompt_template is null:
Use the following context from the knowledge base to answer the user's question. If the context doesn't contain relevant information, say so.
{context}There is no per-collection embedding model: every collection uses the tenant’s model (see Embeddings).
Bind resource groups
Section titled “Bind resource groups”A collection reaches a chat call only through a group binding. Two ways to set bindings, both of which replace the existing set:
# Replace bindings (must name at least one group)curl -s -X POST \ http://localhost:5050/v1/admin/knowledge-base/collections/01K8ZQ3V7M2T4N6P8R0S2U4W6Y/groups \ -H "Authorization: Bearer $ADMIN_JWT" -H "Content-Type: application/json" \ -d '{"group_ids": ["group-01M61N36QYK1HVPN41KAE35PHP", "group-01M61N37B05BXZ6H95P9NSAXXB"]}'# → 204 No Content
# Remove every binding: PATCH with an empty listcurl -s -X PATCH \ http://localhost:5050/v1/admin/knowledge-base/collections/01K8ZQ3V7M2T4N6P8R0S2U4W6Y \ -H "Authorization: Bearer $ADMIN_JWT" -H "Content-Type: application/json" \ -d '{"group_ids": []}'# → 200 with the updated collectionPOST …/groups rejects an empty list (422), so unbinding everything goes through PATCH.
Both calls invalidate the Core Proxy’s group cache, so the change applies to the next chat
call; POST …/groups also notifies members of the groups that gained or lost the
collection. Bindings made in the create call are picked up when the group cache next
reloads (it is invalidated tenant-wide when the first document becomes ready, and
otherwise expires after 5 minutes).
Binding a collection to a group also binds the tenant’s embedding model to that group, hidden from the portal model picker. Retrieval embeds each question with that model through the gateway’s own embeddings endpoint, which is access-checked like any other call; without the binding the question’s embedding is refused and the chat is answered without grounding. The binding follows the configuration and is removed again when no collection (or semantic cache) on that group needs it; a binding an admin made by hand is never touched.
Inheritance
Section titled “Inheritance”Collections are resources, so they follow the additive inheritance rule: a group
retrieves from its own collections plus those of each ancestor it can reach through an
unbroken chain of inherit_from_parent = true. Bind a company-wide handbook to a parent
group once and every inheriting child grounds on it; set inherit_from_parent = false on a
child to cut it off.
To see what a group actually reaches, use the group’s effective view:
curl -s http://localhost:5050/v1/admin/resource-groups/group-01M61N37B05BXZ6H95P9NSAXXB/effective-kb-collections \ -H "Authorization: Bearer $ADMIN_JWT"{ "group_id": "group-01M61N37B05BXZ6H95P9NSAXXB", "group_name": "brutor-demo-fraud-screener", "direct_collections": [], "direct_count": 0, "inherited_collections": [ { "id": "01K8ZQ3V7M2T4N6P8R0S2U4W6Y", "name": "sales-playbooks", "description": "EMEA sales enablement", "enabled": true, "top_k": 5, "similarity_threshold": 0.75, "max_context_tokens": 2000, "document_count": 12, "is_inherited": true, "source_group_id": "group-01M61N36QYK1HVPN41KAE35PHP", "source_group_name": "borealis-consumer-finance", "group_ids": ["group-01M61N36QYK1HVPN41KAE35PHP"], "groups": [{"id": "group-01M61N36QYK1HVPN41KAE35PHP", "name": "borealis-consumer-finance", "display_name": null}] } ], "inherited_count": 1, "effective_collections": ["…same objects, direct and inherited…"], "effective_count": 1}GET /v1/admin/resource-groups/{group_id}/effective-kb-connectors is the equivalent for
connectors.
Several collections on one group
Section titled “Several collections on one group”When a group reaches more than one enabled collection, retrieval searches all of them in a single query with merged settings:
| Setting | Merge rule | Example (collections A, B) |
|---|---|---|
| collections searched | union | A + B |
top_k |
maximum | A=5, B=8 → 8 |
similarity_threshold |
minimum | A=0.75, B=0.6 → 0.6 |
max_context_tokens |
maximum | A=2000, B=4000 → 4000 |
system_prompt_template |
the first non-null one found | A’s or B’s, not combined |
The merge is generous by design, so a strict collection bound next to a loose one is searched at the loose threshold. If that matters, put the collections in separate groups.
Update and delete
Section titled “Update and delete”curl -s -X PATCH \ http://localhost:5050/v1/admin/knowledge-base/collections/01K8ZQ3V7M2T4N6P8R0S2U4W6Y \ -H "Authorization: Bearer $ADMIN_JWT" -H "Content-Type: application/json" \ -d '{"top_k": 8, "similarity_threshold": 0.6}'Every field is optional; the response is the full collection as on create. Unknown IDs
return 404 {"detail": "Collection not found"}.
DELETE /collections/{collection_id} returns 204, deletes the collection’s vectors from
Qdrant, and cascades to its documents and chunks. It cannot be undone.
In the Admin UI
Section titled “In the Admin UI”AI Estate → Resources → Knowledge Base → Collections lists collections with their document count, Top K, Similarity, Max Tokens and Assigned Groups. Create Collection opens a dialog with tabs General, RAG Settings, System Prompt and Access Control (pick the resource groups); editing adds Audit Info. Each row has Enable/Disable, Edit and View Documents. The Embedding Model column shows the tenant’s embedding model, the same for every collection, because the model is configured tenant-wide.


A resource group’s own Knowledge Base tab (AI Estate → Resource Groups → group → Knowledge Base) is read-only: it shows the group’s direct and inherited collections and connectors with an All / Direct / Inherited toggle. Bindings are edited from the collection.
Related
Section titled “Related”- Upload & ingestion: put documents into the collection
- Retrieval & grounding: how the settings above are applied
- Resource groups: membership and inheritance

