(Part 2) From RAG to Agents : Doctolib’s journey to revolutionize Customer Care

Anouk Barnoud7 Oct 2024

Problem

Doctolib built a RAG assistant for customer care that answers questions from documentation. It cannot handle requests that need an action in the product, such as changing who can see a practitioner's agenda. One LLM choosing among many tools is unreliable. It sometimes calls the wrong tool or fills parameters wrongly, and the longer its prompt, the less it follows instructions.

Example from the article: a practitioner wants to give a secretary access to their agenda. The system must find the use case, collect the name and agenda, and act only after confirmation.

Solution in brief

A root assistant greets the user and routes the request to one of several narrow specialized assistants. Each one has a small prompt, few tools and one or two use cases. Tools that change data are marked sensitive: their arguments are fact-checked and the user must confirm before they run.

Questions this case answers
  • How to let an LLM assistant execute state-changing actions in product systems when its tool choice and arguments vary between runs
  • How to structure a multi-agent assistant so that prompt size and tool count per agent stay small as use cases are added
  • How to move a customer-care assistant from FAQ-style RAG to one that performs back-end actions for the user?
  • How to keep an LLM agent from calling the wrong tool or filling its arguments wrongly?

Tools and methods

  • LangGraph — framework for the agent graph (nodes are LLM agents or plain functions, cycles allowed); chosen over crew.ai and autogen
  • Root assistant — LLM that chats until a clear Doctolib request appears, then routes it
  • Specialized assistants — one per use case group, each with its own prompt, context data and tools
  • Sensitive tools — back-end actions that require a fact-check step and user validation
  • OpenAPI specifications — API documentation turned into tool definitions
Continue reading — it's free

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