How we built “Ask Learn”, the RAG-based knowledge service

Sarah Luck, Bob Tabor22 Apr 2024

Problem

Microsoft Learn has hundreds of thousands of technical documents, edited by hundreds of writers. Customers of Microsoft Q&A waited several hours for a community answer, and Azure portal users had to leave it to search the docs. A plain "embed, retrieve, generate" pipeline gives decent answers, but customers expect accurate, relevant and verifiable ones, and the generator is non-deterministic.

Example from the article: the Q&A Assist feature gave a possible answer with references to Learn articles; the same service was later reused as "Ask Learn" for Copilot for Azure.

Solution in brief

The team built an "advanced RAG": a service-oriented pipeline with extra processing before and after retrieval and after generation, with a separate Knowledge Service that chunks the documents, embeds them and keeps the index fresh. A golden dataset of questions, approved answers and best source articles measures every change. Production feedback, collected with user consent, feeds a manual root-cause analysis of each answer.

Questions this case answers
  • How to make answers generated from a large, constantly edited document corpus accurate and traceable to sources when the generator is non-deterministic
  • How to evaluate and root-cause the quality of a retrieval-plus-generation pipeline when user conversations cannot be read by default
  • How to make a RAG answer service over product documentation reliable and verifiable?
  • How to measure and improve the quality of a RAG system when its output is non-deterministic?

Tools and methods

  • Advanced RAG pipeline — query processing, retrieval, post-retrieval processing and post-completion checks around the LLM call
  • Knowledge Service — chunks docs, creates embeddings, keeps the vector database current, exposed as a web API
  • Golden dataset — questions, approved answers and best source articles, used for before/after tests
  • Azure OpenAI — embedding and completion APIs
  • Prompt flow — evaluation flows for retrieval, groundedness, relevance and harms, replacing early custom notebooks
Continue reading — it's free

Google or a one-time email code. No password.