What this prompt does
This prompt builds a complete RAG chatbot for [use_case] over [data_sources]. It specifies the entire pipeline: document ingestion for [file_types], a chunking strategy of [chunk_size] tokens with [overlap] using [chunk_method], embedding via [embedding_model], storage in [vector_db], and hybrid retrieval that combines vector similarity with keyword BM25 returning [top_k] results.
The structure works because answer quality in RAG is decided by retrieval, not by the language model alone. Hybrid search plus a [reranker] re-ranking pass surfaces the right chunks before generation ever runs. The generation step adds source attribution and anti-hallucination guardrails, and the evaluation pipeline measures retrieval accuracy, answer relevance, and faithfulness — the three numbers that actually tell you whether the bot is grounded or guessing.
The ingestion and conversation layers are what make it usable day to day. Parsing and cleaning across [file_types] keeps messy real-world documents from poisoning the index, metadata filtering on the [vector_db] lets you scope retrieval to the right source, and conversation-history management condenses follow-up questions so a vague "and what about that?" still retrieves the right context. Streaming responses with inline citations then let users trust and verify each answer as it arrives.
When to use it
- You need a grounded Q&A bot over
[data_sources]and want answers tied to citations. - You are mixing
[file_types](Markdown, PDF, HTML) and need ingestion and cleaning handled per format. - You want hybrid retrieval rather than vector-only search, which alone misses exact keyword matches.
- You need a re-ranking stage to lift the most relevant chunks before generation.
- You want an evaluation pipeline that measures faithfulness so you can catch hallucinations.
- You need a containerized setup with API endpoints to deploy.
Example output
Expect a full pipeline implementation in [language] with [framework]: ingestion and chunking code, embedding and [vector_db] storage setup, hybrid retrieval with re-ranking, a grounded generation prompt with citations, streaming responses, and an evaluation harness. It typically ships with a Docker setup and documented API endpoints.
Pro tips
- Match
[chunk_size]and[overlap]to your content. Dense technical docs often want smaller chunks; long prose tolerates larger ones. - Use heading-aware
[chunk_method]for structured docs so chunks respect section boundaries instead of splitting mid-thought. - Do not skip the
[reranker]. Hybrid search casts a wide net; re-ranking is what filters[top_k]down to genuinely relevant context. - Pick
[embedding_model]and[vector_db]that fit your scale and budget rather than defaulting to the biggest option. - Keep the anti-hallucination guardrail strict — instruct the model to say it does not know when retrieval comes back empty.
- Run the evaluation pipeline early; retrieval accuracy is the metric that makes or breaks the whole bot.
- Add metadata to chunks at ingestion so you can filter retrieval by source, date, or document type later.
- Condense follow-up questions before retrieval so multi-turn conversations still pull the right context.