Skip to content

Pattern: RAG over documents

The examples/docmind walkthrough is a small internal knowledge-base copilot built entirely on collections plus one pb_hooks file: uploading a document triggers a hook that chunks the text and writes rows to a chunks collection whose vector field auto-embeds; asking a question does an application-side nearestTo search over chunks, calls the LLM chat gateway with the matched chunks as context, and streams the answer back over the same realtime connection the page already has open. No separate vector database, RAG service, or chat backend — one custom endpoint (routerAdd) composing existing primitives.