The AutoDoc Reference Book
New to AutoDoc? Start with the short tutorials; this book is the reference they point to.
Welcome to the AutoDoc User Reference Book—a 19-chapter, hands-on guide and architectural reference covering every surface of AutoDoc: the terminal editor (autodoc --ui), the native GPU desktop window (autodoc --gui), the Neovim integration (autodoc.nvim), the AI agent CLI (autodoc --call), the Lua & out-of-process plugin ecosystem (Protocols 1–9, the plugin UI kits, autodoc-autodb and autodoc-jupyter), and the headless multi-tenant PostgreSQL RAG server (autodoc --server).
Designed to Be Read Inside AutoDoc (or Exported to the Web)
Every chapter in docs/reference/ is written in AutoDoc's native rich Markdown dialect (core/export/embed.go). Instead of static ASCII art or external image links, each chapter <nn>-<slug>.md sits alongside a companion <nn>-<slug>/ resource directory containing live, editable visual assets:
- Mermaid Diagrams (
.mmd): Rendered natively as GPU vector graphics inautodoc --gui(Ctrl+TRendered View /SPC HPreview HTML) and via bundled Mermaid inautodoc --exportHTML. - Vega-Lite Charts (
.chart.json): Rendered natively on the Gio canvas bygolib/gui/vegaliteinautodoc --guiand via Vega-Lite in HTML exports. - Structured CSV Tables (
.csv): Rendered as formatted tables in both--guiRendered View and HTML exports.
Open this folder (docs/reference/) as a workspace in autodoc --gui and press Ctrl+T on any chapter to explore the diagrams, charts, and tables live—or click any embedded diagram or chart in Rendered View to inspect and edit its underlying .mmd or .chart.json source inline.
Complete Chapter Index
Part-by-Part Guide
Part I — Foundations & Surface Mastery
- Chapter 01: What Is AutoDoc? Architecture & File-Canonical Guarantee
How AutoDoc keeps your Markdown and YAML files 100% canonical on disk while deriving a real-time SQLite WAL index shared across
--ui,--gui,autodoc.nvim, and--call. - Chapter 02: 5-Minute Quickstart & Workspace Registration
Installing the single binary, registering your first workspace, tuning
include/exclude/section_tokens, and understanding how thewatch-before-scanfollower converges on external Git edits. - Chapter 03: Mastering the Modal Editor, Panels & Navigation The 120-column page and its breadcrumb, the Vim and Text editor modes, buffers, SPC's leader keys, the panels (the explorer, the links, the todos, the terminal, the AI agent, the HTML preview), preferences, files changed on disk, and the command line.
- Chapter 04: Rich Authoring — Mermaid (
.mmd), Vega-Lite (.chart.json), CSVs & Export Using the<note-stem>/companion resource directory convention to embed native vector diagrams, quantitative charts, CSV tables, and self-contained data-URI images—plus exporting offline HTML pages (autodoc --export).
Part II — Search, Schemas & Knowledge Graphs
- Chapter 05: The 3-Stage Hybrid Search Pipeline (
Lexical+Semantic+Rerank) Inside AutoDoc's retrieval funnel: FTS5 BM25 with structural signals, 1-bit quantized + float32 vector recall, Reciprocal Rank Fusion (RRF), cross-encoder reranking, facet filter syntax, and honest stage reporting. - Chapter 06: Configuring Local & Cloud Embedding and Reranker Models
Wiring local Ollama (
qwen3-embedding) and TEI (BAAI/bge-reranker-v2-m3) or cloud providers (OpenAI,Vertex AI) in the store (embedding.add,ranker.add), switching models live in the background, and automatic orphan vector reclamation. - Chapter 07: Frontmatter Schemas (
v1&v2), Live Validation & Search Facets Declaring_schema/frontmatter.yamlwithversion: 2(discriminator: type,basefields, and per-type rules), reading non-blocking live editor diagnostics, and turning YAML fields into queryable search facets. - Chapter 08: Knowledge Graphs — Wikilinks, Backlinks & ADR Lifecycle Relations
Navigating
[[wikilinks]]and typed architectural edges (supersedes,superseded_by,amends,sources,adr,review), using the Relations Panel (SPC l), demoting superseded ADRs, and auditing broken links (graph.unresolved). - Chapter 09: Code Symbol & Declaration Indexing (
golib/search/chunk/code) Indexing declarations across Go (.go), TypeScript/JavaScript (.ts,.tsx,.js,.jsx,.mjs), Python (.py), and Rust (.rs) alongside custom chunkers (app.Options.Chunkers) and plain-text extensions (text_extensions).
Part III — Tasks, Workflows & AI Agent Orchestration
- Chapter 10: The
.todo-list/Task Engine & Crash-Recoverable Journal Managing tasks as canonical Markdown+YAML files backed by AutoDoc's 3-phase SQLite journal (pending→staged→committed), using the interactive Todos Panel (SPC x), and portable$KB_ROOT/$PROJECT_ROOTsymbolic paths. - Chapter 11: Terminal Tabs & One-Key Agent Task Handoff (
SPC x→A) Setting up CLI coding agent profiles (System › Agent profiles…) and pressingAon any todo task to atomically mark itin-progress, assign it toautodoc:<codename>, and paste the structured task brief into the agent's live terminal. - Chapter 12: Wiring External AI Coding Agents (
--call,KB_OPERATIONS.md, & Token Efficiency) Teaching Claude Code, Gemini, and Codex to query AutoDoc via--call, follow the adaptive retrieval ladder, and read exact[line_start, line_end]spans—cutting context token usage by over 60% and achieving 94%–100% top-3 accuracy. - Chapter 13: Optimistic Concurrency,
watch-before-scan& Safe Multi-Agent Writes Howstat-read-stat, SHA-256 revision tokens, atomic.partrenames, single-writer SQLite leases, and UI ticket invalidation prevent concurrent humans and AI agents from ever overwriting each other's work.
Part IV — Programmability, Plugins & Neovim
- Chapter 14: Sandboxed Lua Scripting (
~/.config/autodoc/lua/) Writing custom:commands, modal keymaps, single-step undo buffer transformations, interactiveautodoc.ui.pickworkflows, and capability-gated async RPC scripts inside the 2-second Lua sandbox. - Chapter 15: The Out-of-Process Plugin System (Protocols 1–6) & Vetted Registry
Building isolated child-process plugins in Go or Python across Protocols 1 to 9: modal dialogs, docked non-modal cards, document feeds with byte offsets, hosted paged tables (
[table]), typed cell kinds, the pointer, the session slot, a plugin's Lua package, notifications, opening files ([open]), and theplugin/cardandplugin/declUI kits. - Chapter 16: Live Database Workbenches in Markdown — The AutoDB Plugin
Running PostgreSQL, MySQL, and SQLite queries directly from
.sqlfiles and Markdown notes viaautodoc-autodb, streaming session-pinned paged cursors into AutoDoc's 100k-row sortable Results table, and exporting CSV or Markdown tables. - Chapter 17: Notebooks in Markdown — The Jupyter Plugin
Running a lab note's (
*.lab.md) code cells in any Jupyter kernel throughautodoc-jupyter, keeping their outputs (text, plots, Vega-Lite charts, DataFrames) beside the note for the HTML export and the Rendered View to draw, and opening or exporting.ipynbnotebooks. - Chapter 18: Neovim Integration (
autodoc.nvim) & Reversible KB Migration Using AutoDoc's generated Neovim pickers, live stage toggles, relations drawer, 6-slot floating previewer, and the 6-step reversible:AutodocKbMigratepipeline.
Part V — Enterprise RAG Server (autodoc --server)
- Chapter 19: Multi-Tenant PostgreSQL RAG Server (
autodoc --server&.viewContracts) Ingesting live PostgreSQL tables via declarative.viewtemplates with keyset cursors and tenant advisory locks, serving snapshot-enforcedPOST /v1/searchoverpgvector, and evaluating self-hosted versus managed cloud RAG deployment scenarios.