ClouisleClouisle

Create a Knowledge Base

Build a searchable document collection for a team and choose the indexing models

A knowledge base must belong to a team. Two decisions are hard to reverse: the embedding model fixes the vector dimension (it cannot be changed once documents are processed), and visibility decides who can read it without a share. The name must be unique within the team.

Prerequisites

  1. You are a member of the target team with the kb:create permission; 2) the team is authorized for an embedding model (an unauthorized model is rejected at creation, and without one the knowledge base cannot be searched); 3) authorize a rerank model too if you want reranking. See Managing Models for authorization and provider setup.

Permissions and visibility

ActionPermissionTeam role requirement
View knowledge base / documents / chunkskb:readWithin the visibility rules
Hit testing (retrieval)kb:testRead access
Create a knowledge basekb:createTeam member
Edit settings, upload/process/delete documents, edit chunkskb:updateThe creator, or a team owner/admin
Delete a knowledge basekb:deleteTeam owner/admin
Share with another teamkb:updateOwning team owner/admin
Revoke a sharekb:deleteOwning team owner/admin

Visibility is set in the create/edit dialog:

VisibilityWho can readNotes
privateThe creator onlyOther team members cannot see it; cannot be shared with other teams
teamAll members of the teamWriting still requires the creator or a team admin
publicReserved valueNot offered in the UI, kept for compatibility

Cross-team access is only ever granted through a share and is always read-only — see “Cross-team sharing (read-only)” below.

Creating a knowledge base

  1. Go to Knowledge Bases and select Create Knowledge Base.
  2. Fill in the basics:
    • Name: 1-100 characters, unique within the team; a duplicate returns kb_name_exists.
    • Description: up to 500 characters describing purpose and scope.
    • Team: the current team (the admin dashboard form can target another team).
  3. Select models:
    • Embedding Model: an embedding model authorized for the team. embedding_model_id cannot be changed after creation.
    • Rerank Model: optional; once bound, recall results can be re-scored during retrieval.
  4. Configure chunking and reranking:
    • Chunk Size chunk_size: default 1000 characters, minimum 100 (UI suggests a maximum of 2000).
    • Chunk Overlap chunk_overlap: default 100 characters, minimum 0 (UI suggests a maximum of 500).
    • Custom Separator: escape sequences such as \n\n are allowed and act as a hard split boundary.
    • Enable Reranking: on by default; Rerank Candidate Pool defaults to 10 (1-100); Rerank Score Threshold defaults to empty (0-1).
  5. Choose visibility (private or team).
  6. Click Create Knowledge Base and open the detail page; confirm the status is Active.

When editing an existing knowledge base the dialog also offers an Enable Knowledge Base switch (turning it off sets archived, and archived knowledge bases are not searched).

Create Knowledge Base dialog
Create Knowledge Base dialog: models, chunking, reranking, and visibility

The embedding model cannot be replaced

Stored vectors are bound to the embedding model chosen at creation. Updating embedding_model_id is rejected outright (embedding_model_locked_after_kb_creation), while the rerank model can be swapped at any time (team authorization is checked on change). To use another embedding model, create a new knowledge base and process its documents with the new model.

Models and vector dimensions

Embedding model

A platform model with model_type = embedding. It appears in the create form only after being granted to the team through model authorization. A knowledge base references exactly one embedding model; without an available model, neither document processing nor retrieval can run.

Vector dimensions

embedding_dimension is written and frozen when the first batch of documents finishes vectorization. From then on:

  • documents with a matching dimension are indexed normally;
  • vectors with a mismatched dimension raise a dimension mismatch error, and retrieval reports the configuration_mismatch category so you can verify the model and index dimension;
  • changing the embedding model never rebuilds the index automatically — create a new knowledge base or run a full reprocessing flow.

Chunking and retrieval settings

FieldDefaultRangeWhere it applies
chunk_size1000>=100 charactersDocument processing (next process/reprocess)
chunk_overlap100>=0 charactersDocument processing
separatoremptyany stringDocument processing, a hard split boundary
rerank_enabledtruebooleanRetrieval (needs a bound rerank model)
rerank_candidate_k101-100Retrieval
rerank_score_thresholdempty0-1Retrieval
search_modeempty (null)vector / fulltext / hybridDefault mode for Agent/workflow retrieval
top_kempty (null)1-100Agent/workflow retrieval
score_thresholdempty (null)0-1Agent/workflow retrieval
dense_weight / lexical_weightempty (null)>=0Hybrid retrieval weights
rrf_kempty (null)1-1000Hybrid fusion constant

KB settings and search requests are two separate sets of defaults

The retrieval fields in the knowledge base settings default to empty and only apply once set explicitly, whereas a search request without parameters runs with search_mode=hybrid, top_k=5, score_threshold=0, and rrf_k=60. The hit-testing panel initializes from the knowledge base settings and Apply to Production writes the configuration back. In practice the setting mainly drives Agent/workflow retrieval, as described in Retrieval & Quality Tuning.

For the character semantics of chunking, the Markdown versus plain-text difference, preview, and failure retries, see Chunking and Document Processing.

Cross-team sharing (read-only)

Sharing gives another team read and retrieval access to a knowledge base, but no editing rights. It is the only form of cross-team access.

Steps

  1. In the Knowledge Bases list, hover a card, open the ⋯ menu, and choose Share.
    • The entry is only shown for knowledge bases your own team owns, and only to team owners/admins.
  2. In the Share dialog, select a team.
    • The list comes from the teams you belong to and automatically excludes the current team and teams already shared with.
    • The Permission Level offers only Read Only and cannot be changed.
  3. Click Share. The entry appears with a read-only badge and a "Shared by …" note.
  4. To revoke, click the delete icon on that entry under Shared With and confirm; the knowledge base disappears from the receiving team's list immediately.

Rules and failure reasons

RuleResult
A private knowledge baseCannot be shared; returns private_kb_cannot_be_shared (400)
Sharing with the owning teamRejected with kb_cannot_share_to_own_team (400)
Sharing with the same team twiceRejected with kb_already_shared (400)
What the receiving team seesOnly knowledge bases whose visibility is team or public
Receiving-team permissionread_only only: view, retrieve, and associate with Agents/workflows; cannot change settings, upload, process, or delete documents
Revoking a share that does not existReturns kb_share_not_found (404)

After sharing, both sides show a marker in their lists:

  • Receiver: a From + team name badge, and every write entry point is disabled on the detail page (is_owned = false).
  • Owner: a Shared with N teams badge, with N coming from shared_with_count.

Sharing through the API

# Share with another team (read_only is the only valid permission value)
curl -X POST "https://your-domain.com/api/v1/knowledge-bases/$KB_ID/share" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"team_id": "TARGET_TEAM_UUID", "permission": "read_only"}'

# List the teams it is shared with (owning-team members only)
curl "https://your-domain.com/api/v1/knowledge-bases/$KB_ID/shares" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

# Revoke a share
curl -X DELETE "https://your-domain.com/api/v1/knowledge-bases/$KB_ID/share/$TARGET_TEAM_ID" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

On the receiving side, GET /api/v1/knowledge-bases accepts include_shared (default true) and own_only (default false); set include_shared=false or own_only=true to see only your own teams' knowledge bases.

Document management

Document management covers upload, processing, reprocessing, and deletion; the detailed steps are in Import Documents and Chunking and Document Processing.

CapabilityNotes
UploadPOST /api/v1/knowledge-bases/{kb_id}/documents/upload (multipart); the document becomes pending and is not processed automatically
URL importAfter a safety check a url document is created and you confirm its chunks on the preview page
Supported formatsPDF, DOC/DOCX, PPTX, TXT, Markdown, HTML, CSV, XLS/XLSX, JSON, URL (no .ppt, archives, or OCR)
Bulk actionsSelect several documents: Quick Process pending ones, Retry Failed Chunks on failed ones, or Delete
Single-file limitSite setting kb_document_max_upload_size_mb, default 50MB, range 1-1024MB

Uploading and processing are two separate stages: a document appearing in the list does not mean it has been embedded. Only completed documents are retrievable, and only those are suitable for binding to an Agent.

Statistics

The knowledge base detail page shows statistic cards at the top (documents, chunks, tokens, and per-status counts); Hit Testing in the dropdown opens the retrieval lab.

GET /api/v1/knowledge-bases/{kb_id}/stats returns:

  • document_count (recomputed from actual documents, not the cached value)
  • total_chunks, total_tokens (aggregated from documents and written back to the KB cache fields)
  • documents_by_status, documents_by_type
  • embedding_dimension and embedding_stats

Not implemented / Roadmap: retrieval analytics (query volume, latency, cache hit rate, top queries), storage usage trends, and statistics export are unavailable.

Troubleshooting

Document processing failed

  1. Confirm the format is supported, the file is not corrupted, and it is within the size limit.
  2. Open the document detail to read the error and identify whether extraction, chunking, or embedding failed.
  3. Common causes and fixes:
CauseFix
Extraction failed (corrupted, encrypted, image-only)Convert the format or remove the password and upload again
Zero chunksConfirm the file contains extractable text, or turn text cleaning off and retry
Embedding failed (credentials, quota, dimension)Verify model authorization and embedding_dimension, then retry failed chunks
Indexing failed (vector store unavailable)Check Qdrant and the Worker logs

No results or irrelevant results

  1. Confirm the documents are completed.
  2. Use Hit Testing to verify scores: with zero results, lower score_threshold first, then switch search mode.
  3. Check whether an Agent overrides the knowledge base settings (retrieval_top_k, score_threshold, and search_mode on the association).
  4. Check that the vector store and pg_search are healthy; reprocess documents if needed.

Cost or performance anomalies

  • High cost: avoid unnecessary reprocessing, tune chunking (larger chunks, less overlap), switch to a cheaper embedding model, and delete redundant documents.
  • Slow retrieval: lower top_k, disable reranking for simple queries, narrow the document scope, and check vector store resources.

Not implemented / Roadmap: per-knowledge-base document limits, daily embedding quotas, and cost alerts are all unavailable.

Best practices

  • ✅ Name knowledge bases by content scope; avoid names like "Docs" or "Materials" that carry no information.
  • ✅ Get one representative document working with the defaults (1000/100), then compare adjustments with hit testing.
  • ✅ Clean up stale documents regularly; duplicate content competes with itself in the ranking.
  • ✅ Keep private knowledge bases for personal drafts; use team visibility for anything the team shares.
  • ❌ Do not expect to "add metadata" to improve retrieval — metadata is generated by the processing pipeline and has no editing entry point.
  • ❌ Do not replace the embedding model in production, and do not scale chunk size up without validating retrieval first.

API access

Manage knowledge bases through the API; the endpoint list is in the Knowledge Base API. Knowledge base endpoints accept only a signed-in user's JWT session (Authorization: Bearer <ACCESS_TOKEN>) and do not accept a clou_ API key.

# List knowledge bases — supports team_id, search, status, own_only, include_shared
kbs = api.get("/api/v1/knowledge-bases", params={"team_id": "team-123", "include_shared": True})

# Create a knowledge base for a team
kb = api.post("/api/v1/knowledge-bases", json={
    "name": "Product Docs",
    "team_id": "team-123",
    "embedding_model_id": "model-456",
    "visibility": "team",
    "settings": {"chunk_size": 1000, "chunk_overlap": 100, "rerank_enabled": True}
})

# Upload a document
with open("document.pdf", "rb") as f:
    doc = api.post(
        f"/api/v1/knowledge-bases/{kb_id}/documents/upload",
        files={"file": f}
    )

# Search a knowledge base
results = api.post(f"/api/v1/knowledge-bases/{kb_id}/search", json={
    "query": "How to reset password?",
    "top_k": 5
})

Document processing API:

EndpointNotes
POST /api/v1/knowledge-bases/{kb_id}/documents/{doc_id}/processProcess a pending document (chunk settings optional)
POST /api/v1/knowledge-bases/{kb_id}/documents/{doc_id}/process-with-chunksSubmit the chunks confirmed in the preview
POST /api/v1/knowledge-bases/{kb_id}/documents/{doc_id}/reprocessDelete old chunks and process again
POST /api/v1/knowledge-bases/{kb_id}/documents/{doc_id}/rechunkRe-chunk with new chunk settings
POST /api/v1/knowledge-bases/{kb_id}/documents/{doc_id}/retry-failed-chunksRetry embedding for failed chunks only
POST /api/v1/knowledge-bases/{kb_id}/documents/{doc_id}/chunks/{chunk_id}/retry-embeddingRetry a single chunk embedding

How is this guide?

On this page