> ## Documentation Index
> Fetch the complete documentation index at: https://panopticon-cli.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Docs RAG: Overdeck's own docs in agent prompts

> How Overdeck injects snippets from its own docs, skills and rules into agent prompts, and how to query, reindex or turn it off.

Docs RAG is retrieval over Overdeck's own developer documentation, skills and rules, injected into an agent's prompt when the prompt looks like it is asking about Overdeck itself. It never indexes your project's own code or docs, and it never touches the published documentation site.

## What it indexes

Docs RAG indexes Overdeck's own package: the Markdown files under `docs/` (not `docs/prds/`), every `SKILL.md` under `sync-sources/skills/`, every rule under `sync-sources/rules/` and `.claude/rules/`, and the root `CLAUDE.md`. PRDs are not indexed. Search runs as SQLite full-text search plus local embeddings.

Queries and injection read the index at `~/.overdeck/docs/index.sqlite` (`pan docs query --index-path` can point at another file). The published npm package also ships a prebuilt copy as `dist/docs-index.sqlite`, but no install or sync step copies it into place, and until `~/.overdeck/docs/index.sqlite` exists, injection silently adds nothing. On an npm install, run `pan docs reindex` once to build the index; it covers only the bundled skills and rules there. For the full prebuilt index instead, create `~/.overdeck/docs/` if it does not exist and copy `dist/docs-index.sqlite` from the installed package to `~/.overdeck/docs/index.sqlite`.

## When snippets are added to a prompt

Injection is on by default once the index exists. The trigger is nine case-insensitive patterns, matched as a substring anywhere in the prompt rather than as a whole word: a prompt containing "Japan" matches the `pan` pattern even though it does not contain the word `pan`. When one matches, Docs RAG adds a block of at most 5 snippets and 3000 tokens to the prompt, at most once every 10 turns:

```text theme={null}
pan, overdeck, cloister, deacon, workspace, specialist, harness, vbrief, workhorse
```

The callers that inject this way are the Claude Code `UserPromptSubmit` hook and Codex app-server turns.

## Query the index

```bash theme={null}
pan docs query "how does the merge train work"
pan docs reindex
```

`pan docs query` takes `--top` (the snippet count, default 5), `--format` (`markdown`, `json` or `text`, default `markdown`) and `--kind` (one of `docs`, `skill`, `rule`, `claude-md` or `prd`).

`pan docs reindex` rebuilds the index from this package's own `docs/` folder, using the default corpus and embedding settings rather than your `docs.*` configuration: it does not read `docs.corpus.prds` or any other `docs.corpus.*` key, so turning PRDs on in `config.yaml` does not bring them into a reindex.

That `docs/` folder, `CLAUDE.md` and `.claude/rules/` do not ship in the published npm package. Running `pan docs reindex` from an installed copy does not fail or warn: it silently rebuilds from whatever sources are still present (Overdeck's bundled skills and rules) and replaces your existing index with that smaller one. That is enough to create a missing index on an npm install; rebuilding an index that covers `docs/` needs a source checkout of Overdeck.

## Turn it off

```bash theme={null}
pan docs disable --scope global
pan docs enable --scope global
```

`pan docs disable` and `pan docs enable` take `--scope session`, `--scope project` or `--scope global`, and the default is `session`. The command records no session ID or project path, so today the scopes behave differently than their names suggest: a `session` setting matches no agent session and has no effect, and a `project` setting applies to every session, because injection also sends no project path, and it takes precedence over a `global` setting. Use `--scope global`. `pan docs disable --scope global` turns injection off everywhere; `pan docs enable --scope global` turns it back on. You can also set `docs.enabled: false` to turn off the whole feature, or `docs.prompt_injection: false` to keep the index but stop automatic injection into prompts, in `~/.overdeck/config.yaml`.

## Configuration keys

All Docs RAG keys in `config.yaml` are snake\_case, under the top-level `docs` key:

| Key | Controls |
| - | - |
| `docs.enabled` | Turns the whole feature on or off |
| `docs.prompt_injection` | Turns automatic prompt injection on or off, independent of the index |
| `docs.trigger.regexes` | The list of trigger words or patterns above |
| `docs.trigger.case_sensitive` | Whether trigger matching cares about case |
| `docs.corpus.*` | Accepted in `config.yaml`, but no index build reads these keys today |
| `docs.budget.injection_rate` | How often a prompt is allowed to receive an injection |
| `docs.budget.turn_window` | The turn window the injection rate is measured over |
| `docs.budget.max_tokens_per_injection` | The token cap on one injected block |
| `docs.budget.max_chunks_per_injection` | The snippet-count cap on one injected block |
| `docs.embedding.provider` / `.model` / `.dimensions` | The embedding model, default local `gte-small` at 384 dimensions. Curated memory fact vectors read this key; the docs index build always uses the default model |

## Get help

Join the [Overdeck Discord](https://discord.gg/ZpHE2ZTv5P) or file an issue on [GitHub Issues](https://github.com/eltmon/overdeck/issues).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.