Skip to main content

Overview

Genesis stores searchable document content in document indexes backed by ChromaDB. The same indexes power the Document Indexes page in the dashboard, the agents’ “search the docs” abilities, the “Ask” feature, and the Knowledge Base feature that bundles indexes for assignment to specific agents. This page covers the REST surface for indexes. Two equivalent paths are available — pick whichever fits your client:
  • REST endpoints (this guide) — typed schemas, REST verbs.
  • All-in-one tool function via /api/tool_call with {"func": "_document_index", "func_args": {"action": "...", ...}}. Same code path the bots use.
For background on what indexes are and how they fit with knowledge bases, see the user-guide Document Indexes page. For the field-by-field schema of the destructive DELETE flow, see the API reference Document index management endpoints section.
Authenticate with a Personal Access Token. See Personal Access Tokens.Index and document mutations require the manage_document_indexes permission. Other read-only listing, search, and ask endpoints are available to any authenticated caller; polling background upload status also requires manage_document_indexes.

Endpoint summary

{file_id} in path templates accepts URL-encoded values, including slashes inside the id. The destructive DELETE flow (DELETE /api/indexes/{index_name}, /delete-impact, and /operations/{operation_id}) is documented in detail in the API Reference — document index management endpoints.

Indexes

List indexes

When no document manager can be built because embeddings are not configured, data is an empty array and state carries the embedding identity discriminator (for example "unset" or "incomplete"). The dashboard uses this to show the no-embedding banner instead of treating the inventory as genuinely empty. Omit state (or receive null) on successful reads when a manager is active. Each item in data includes:
Document embeddings are stored in model-specific collections named {provider}_{sanitized_model}_index. When the active embedding model changes, listing and search use the new collection. Indexes stranded in a prior collection still appear here with needs_reindex: true instead of vanishing from inventory. Saving a new embedding configuration on Config → AI Providers → Embeddings starts a full background re-embed of those documents into the active collection. See Setup AI Model — Document indexes and embedding-model changes.
On Databricks Apps with durable document indexes configured, a missing index may be restoring from its volume snapshot after startup. Search then returns no results with a restore-in-progress message; wait and retry. Mutations to an index awaiting restore are refused until it is available. See Durable document indexes on Databricks.

Create an index

Index creation requires a resolvable embedding identity. When none is configured, the route returns HTTP 409 with error_type: "embedding_not_configured". When a pointer is set but the provider lacks credentials, the response uses error_type: "provider_not_configured". See Setup AI Model and Embedding provider validation and coherence. On Databricks Apps, creation and rename can also return HTTP 503 while snapshot restoration is pending or when the volume cannot remove a saved copy; retry after restoration or when volume access is available.

Rename an index

Successful create, rename, and completed delete operations refresh Genesis capability discovery immediately. After a mutation, agents can find the updated index list through manage_context(action="SEARCH_CONTEXT", search_scope="document_indexes") without a service restart.

Delete an index

Index deletion is destructive and runs in the background. The DELETE returns HTTP 202 with an operation_id you poll. Use GET /api/indexes/{index_name}/delete-impact first to see which knowledge bases and agents would be affected. Genesis removes the index from every embedding-model Chroma collection that holds it — the active collection and any prior model-specific collections where stranded chunks still exist (the same indexes listed with needs_reindex: true). Stranded copies are purged first; attached files are detached only after every physical copy is confirmed gone. Progress polling may show steps such as Deleting from prior embedding collection (1/2). The full schema for the delete flow lives in the API reference: Document index management endpoints. A typical end-to-end delete:

Documents

List documents in an index

Query params: The response includes pagination metadata plus a data array of document items. Each item includes file_id, path, relative_path, file_name, file_type, file_size, mimetype, is_binary, and created_at. Example response (truncated):
When no document manager is active for the requested index, data is empty, pagination fields reflect the empty page, and state carries the embedding identity discriminator (same semantics as GET /api/indexes). When has_more is true, request the next page with start=<next_start> until has_more is false. The dashboard Config → Documents file list uses the same endpoint and follows every page automatically.

Add a document

You can add a document either by referencing a file already known to the file manager (file_id) or by giving a direct filepath. Provide exactly one of the two.
ADD_DOCUMENTS uses the document-index exclusion rules described in the Document Index Tools guide. An explicitly named excluded path returns HTTP 400; a filename that merely contains words such as target, build, or .o is accepted unless it matches an excluded path segment or filename pattern.
Conflict policies (DocumentConflictPolicy): The route returns HTTP 202 Accepted after checking the request and queueing the upload; it does not wait for embedding or indexing to finish. Uploads are written one at a time in arrival order across indexes in the process. The document becomes available in the indexed document list and search after indexing completes. Use the returned operation_id to locate the upload in GET /api/indexes/{index_name}/uploads results:
For a direct filepath add, file_id can be null until indexing finishes. The upload-status response lists records oldest first: The service keeps active uploads and up to 200 recently finished uploads in process memory. A server restart loses queued work and its status records; a file accepted but not yet indexed remains in the file store and must be submitted again.
Example response:
The dashboard’s Config → Documents upload drawer polls while uploads are queued or indexing. See the Document Indexes guide for the dashboard experience. If you need to add many files at once, use glob patterns / recursive walks / Git-repo sources via the all-in-one tool form:

Rename a document

Delete a document

Get document content (with pagination)

Query params:
With no pagination_mode, the response is a window over ChromaDB chunks. Chunks may be reordered or de-duplicated relative to the on-disk file. For exact, ordered file content prefer pagination_mode=lines, or fetch the original file via the /api/files/{file_id} endpoint.
For UI consumers that render a docs site:
Returns an ordered list of groups, each containing pages with stable ids and titles, plus an optional home_page_id.

Search and Ask

Query params: Response:

Ask (RAG with LLM-generated answer)

top_n is 1–10 (default 1) and controls how many top documents are used to ground the LLM answer. Response:
/api/ask requires an LLM backend to be configured. On a fresh install without an LLM provider this call returns an error.

Knowledge Bases (assigning indexes to agents)

A Knowledge Base is a named bundle of one or more document indexes that you can assign to specific agents. Use the Knowledge Base Admin Tools or the /api/knowledge-bases REST routes after creating the indexes you want to expose:
Then assign the KB to an agent through the agent settings endpoints (/api/bots/{bot_id}/...). The dashboard’s Knowledge Bases flow does the same thing interactively.

Git-backed document indexes

When a managed source registers documents in scan_types_enabled, Genesis syncs markdown from documents_root into document indexes and routes UI and agent edits through the managed workspace (/api/managed-sources/{source_id}/workspace/*). Use POST /api/managed-sources/preview-documents before first sync to see how repo folders map to target indexes, and pass overwrite_indexes on sync when adoption would replace index-only documents that are not yet in Git. For long-running syncs, use POST /api/managed-sources/{source_id}/sync-async and poll GET /api/managed-sources/{source_id}/sync-status/{job_id} instead of the synchronous POST .../sync route. For agent tooling, use propose_kb_edit and open_kb_pull_request via /api/tool_call — see Document Index Tools. Full REST field reference: API Reference — unified managed sources.

Working through /api/tool_call

If you prefer parity with what the bots see, every action above is available via the single _document_index tool. The action names are upper-snake-case:
Examples:
The full action list with parameter docs is in Document Index Tools.

Common pitfalls

  • 409 Conflict with embedding_not_configured or provider_not_configured on a write call. No embedding identity resolves, or the active provider is not fully configured. Configure embeddings on Config → AI Providers → Embeddings, recover a stranded corpus, or set embedding.active_provider / embedding.active_model in genesis-config.yaml. Genesis does not infer an OpenAI embedding fallback from chat configuration.
  • GET /api/indexes returns "data": [] with a non-null state. The list is empty because embeddings are not configured, not because no indexes exist. Check state (unset or incomplete) before assuming a greenfield deployment.
  • 403 Forbidden on a write call. The PAT’s user is missing the manage_document_indexes permission. Add the matching role in Users and Roles and try again.
  • Only the first page of documents is visible. GET /api/indexes/{index_name}/documents and _document_index action LIST_DOCUMENTS return at most 50 documents per request. Use start and count (or follow next_start until has_more is false) to reach every file in large indexes.
  • Documents appear in LIST_DOCUMENTS but SEARCH finds nothing. Embeddings must be configured. See Setup AI Model. After a restart, search server logs or Pulse Live Logs for failed startup smoke test — Genesis runs a one-time embedding connection check at boot and logs misconfigured providers before the first index call.
  • An index is listed with needs_reindex: true or shows a Needs reindex badge in the dashboard. The index still exists in a prior embedding-model collection. Wait for background re-embedding after an embedding change, or switch back to the prior embedding model to restore the original collection without re-embedding. See Setup AI Model — Document indexes and embedding-model changes.
  • ASK returns an error. The deployment has no LLM provider configured for ask-style answers. Set one up in Setup AI Model.
  • GET_DOCUMENT returns garbled or out-of-order content. That is the ChromaDB-chunk caveat — switch to pagination_mode=lines or fetch the original file via /api/files/{file_id}.
  • Deleting an index appears stuck at low progress. Large indexes can take a while; poll /api/indexes/operations/{operation_id}. Progress may include Deleting from prior embedding collection when the index still exists in a prior embedding-model collection. If status becomes failed, inspect error_message — it may list collection names that still hold the index (for example Index 'wiki' still exists in openai_text_embedding_3_large_index; retry to finish removing it). Issue another DELETE /api/indexes/{index_name} to finish removal after fixing storage access.