“I’ve built a RAG system that retrieves the right chunks but the model keeps answering from its training knowledge instead of the retrieved context. What changes to the prompt and system prompt would force it to use only the provided sources?”
“My RAG pipeline works well in testing but gives wrong answers on some queries in production. Walk me through a systematic debugging process — starting from the query and tracing through retrieval, augmentation, and generation — to find where the failure occurs.”
“How would I add streaming responses to a RAG system built on the OpenAI API? Show me the code change needed in the generate() function and explain how streaming affects the response structure.”
“I want to add conversational memory to my RAG system so users can ask follow-up questions. How do I combine the conversation history pattern (from earlier chapters) with the RAG query pipeline without the history overwhelming the context window?”
“What is reranking in the context of RAG, and when is it worth the extra latency? Show me a simple implementation using a cross-encoder model from the sentence-transformers library.”
