Skip to content

RAG Template

A chat assistant that answers questions about your own documents and shows the exact page each answer came from.

You point it at a folder of files. It reads them, and afterwards people can ask questions in normal language. To set it up you edit one settings file. No programming needed.

Under the hood: Chainlit draws the chat window, LiteLLM talks to the AI models, and Qdrant stores your text so it can be searched.

What you can change from config

Everything below is a setting in that one file, so you never have to touch code.

What Setting Your options
Your documents data_sources[] PDFs, plain text and Markdown, or spreadsheet-like json/csv files
How text is split up chunking.strategy by size, by heading, one piece per record, by meaning, or Docling's own way. Can differ per document type
Which model answers models.chat_model any model your AI service offers
Which model makes text searchable models.embed_model any search model your AI service offers
How sources look citation.* the wording and layout of the reference under an answer
What the assistant is told prompt, profiles its instructions, the example questions, and optional roles that limit what it may search
What the assistant may do tools.enabled search, list all documents, read a whole document, fetch surrounding text, double-check a claim
Pictures and charts images.mode ignore them, describe them in words so they are findable, or show them to a model that can see

How it fits together

Your documents are read, cut into pieces and stored so they can be searched. When a question comes in, the matching pieces are looked up and given to the AI model, which writes the answer and lists its sources.

data_sources ─► parser (by format) ─► chunker (by strategy) ─► embed ─► Qdrant
                                                                         │
user question ─► retrieve (top_k, optional filters) ◄────────────────────┘
             └─► LLM tool loop ─► answer + config-driven citations