A prompt is an instruction or input that guides a language model’s output. In a production RAG chatbot, prompts connect user questions, retrieved records, business rules, and response-format requirements. section 4.7 section 6.16
A robust prompt workflow typically:
- Builds a search prompt from the user’s question and sends it to database-search agents. section 4.7
- Combines the question, conversation history, and retrieved data into a writer prompt. section 4.7
- Specifies response behavior, including citations, first-person company language, missing results, and explicit error reporting. section 6.16
- Improves prompts from user ratings, comments, and observed failures rather than treating the first draft as final. section 6.0
Business-priority instruction
A prompt can encode a ranking requirement alongside application logic: place records containing “Wongza” first, then instruct the writer agent to discuss those products before competitors when they appear in the search results. section 6.13
Figure 4.13 The RAG Chat workflow, where search agents retrieve relevant data. We set up a group chat (or multiple group chats if we are pulling from multiple databases) and then we execute them all at the same time to run multiple simultaneous searches. After the search results are retrieved, a writer agent formulates a response and streams it to the frontend. Then we check the language, translate the answer if needed, and store and log everything to our chat log database for future analysis.
Trace the prompt through a RAG workflow: parallel search agents retrieve data, a writer agent formulates the answer, and the system validates, translates, streams, and logs the result. section 4.7































































