(Part 1) From Retrieval Augmented Generation (RAG) to Agents : Doctolib’s journey to revolutionize Customer Care

Anouk Barnoud30 Sep 2024

Problem

Doctolib, a European e-health company, serves health professionals through a customer-care team. Rule-based bots follow fixed scripts and cannot adapt to the user or the context. A plain LLM does not know the company's recent or private content. The team needed an assistant that answers from the help center, takes load off care agents and answers with low latency.

Example from the article: a health professional asks the assistant «Comment extraire les données patients ?» (how to extract patient data), as in the query-pipeline diagram.

Solution in brief

A RAG assistant over FAQ articles that are re-embedded every day. A reranking step improves retrieval, and an evaluation harness built on Ragas lets the team test each parameter against ground-truth answers. A classifier decides whether to show the assistant at all, and several latency measures bring responses from about 1 minute to under 5 seconds.

Questions this case answers
  • How to build a retrieval-augmented question-answering assistant over a regularly updated knowledge base that reduces the load on human support
  • How to choose retrieval and generation parameters of a RAG pipeline with metrics that separate retrieval quality from answer quality
  • How to build a RAG assistant on a FAQ that deflects customer-care cases?
  • How to evaluate a RAG system by component and end to end before changing its parameters?

Tools and methods

  • RAG — embed the query, retrieve FAQ chunks, pass them to the LLM as context.
  • LLM reranking — a reranking step on the retrieved chunks before generation.
  • Ragas — component and end-to-end evaluation metrics.
  • OpenSearch — vector database for FAQ chunk embeddings.
  • Azure OpenAI / GPT-4o — LLM hosted for security and confidentiality.
Continue reading — it's free

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