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_callwith{"func": "_document_index", "func_args": {"action": "...", ...}}. Same code path the bots use.
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
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.Create an index
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. TheDELETE
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
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):
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.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:
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.
Rename a document
Delete a document
Get document content (with pagination)
Navigation tree
For UI consumers that render a docs site:home_page_id.
Search and Ask
Semantic search
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:
/api/bots/{bot_id}/...). The dashboard’s
Knowledge Bases flow does the same
thing interactively.
Git-backed document indexes
When a managed source registersdocuments 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:
Common pitfalls
409 Conflictwithembedding_not_configuredorprovider_not_configuredon 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 setembedding.active_provider/embedding.active_modelingenesis-config.yaml. Genesis does not infer an OpenAI embedding fallback from chat configuration.GET /api/indexesreturns"data": []with a non-nullstate. The list is empty because embeddings are not configured, not because no indexes exist. Checkstate(unsetorincomplete) before assuming a greenfield deployment.403 Forbiddenon a write call. The PAT’s user is missing themanage_document_indexespermission. Add the matching role in Users and Roles and try again.- Only the first page of documents is visible.
GET /api/indexes/{index_name}/documentsand_document_indexactionLIST_DOCUMENTSreturn at most 50 documents per request. Usestartandcount(or follownext_startuntilhas_moreisfalse) to reach every file in large indexes. - Documents appear in
LIST_DOCUMENTSbutSEARCHfinds nothing. Embeddings must be configured. See Setup AI Model. After a restart, search server logs or Pulse Live Logs forfailed 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: trueor 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. ASKreturns an error. The deployment has no LLM provider configured for ask-style answers. Set one up in Setup AI Model.GET_DOCUMENTreturns garbled or out-of-order content. That is the ChromaDB-chunk caveat — switch topagination_mode=linesor 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 includeDeleting from prior embedding collectionwhen the index still exists in a prior embedding-model collection. Ifstatusbecomesfailed, inspecterror_message— it may list collection names that still hold the index (for exampleIndex 'wiki' still exists in openai_text_embedding_3_large_index; retry to finish removing it). Issue anotherDELETE /api/indexes/{index_name}to finish removal after fixing storage access.

