Doc retrieval

Doc retrieval

Doc retrieval keeps a search index of published documentation pages, split into chunks, so an assistant can find the passage it needs and cite the docs rather than guess. It matches exact words in any language and, when an embedding model is connected, meaning as well.

In the sidebar under Files → Doc retrieval. Needs: Pages.

Doc retrieval screen

The screen lists the chunks in the index:

  • each row shows the chunk's text, the page it came from, its number within that page, and the model that embedded it. It also shows an estimate of its tokens and when it was embedded;
  • at the top: how many chunks there are, how many pages they cover, and the estimated tokens in all (estimated when the chunk was embedded, not measured);
  • before anything is published: "Nothing indexed". Chunks are made when a page is published.

How pages get into the index

You do not add anything here by hand. The index follows what Pages publishes:

  1. Publishing a page splits its text into chunks and indexes them. The old chunks of that page are replaced once the new ones are ready.
  2. Unpublishing or deleting a page removes its chunks. So does a Doc sync pull that deletes a page, or turns it back into a draft.
  3. Drafts are never indexed.

If indexing fails, the page is still published. The failure is logged, and the next publish of that page puts it right.

Words and meaning

  • Words always work. Search matches exact words in any script: English, Persian, Russian, Armenian and others. It also matches English and Russian word forms and exact codes such as INV-2024-0042. "Quoted phrases", or, and a leading - to exclude a word all work. There is no prefix matching: "inv" does not find "invoice".
  • Meaning works when the AI module offers a model with the embed role. Without one, chunks are stored with a words-only vector and the Model column says lexical. Once a model is connected, the hourly job re-embeds them in place.

Each result says whether it matched by its words, by meaning or both. Results also say how many chunks are still waiting to become searchable.

Search the docs

People search documentation through Search, which looks at published pages. Agents use docrag.search.

Remove a chunk

The screen offers no delete. The usual way to take text out of the index is to unpublish the page.

Who can do what

PermissionLabelLets you
docrag:readView doc retrievalSee the index and search it.
docrag:writeManage doc retrievalDelete a single chunk through the API. Nobody can write chunks directly: only publishing a page adds text to the index.

See People, roles and permissions.

What happens on its own

JobWhenWhat it does
search-backfillEvery hour at 17 minutes past (17 * * * *)For each workspace, fills in any chunks still missing from the word index or the vector index. Once a real model is connected, it also re-embeds chunks another embedder made, up to 200 per workspace per run, so a large library catches up within a day.

What agents can do

An agent can search published documentation for a passage to cite. This is page text, not agent memory: memories are searched in Knowledge (agent memory).

Read only: docrag.search

docrag.search takes a query and how many chunks to return, from 1 to 20 (5 by default). There is no tool that writes to the index. Over MCP it is named docrag__search. See API keys and MCP access.