LLM and RAG capabilities illustrated by a customer support bot implementation

Alexander Volynsky17 Dec 2024

Problem

A cloud provider's support team gets many requests that only need a consultation or product information. Small teams cannot handle that load, so the business must either hire more people or automate part of the work. A bot must answer fast, understand context, find the right passage among hundreds or thousands of documents, rank them in real time and understand jargon and abbreviations. Most simple bots fail on this. Fine-tuning an LLM on the documentation is a poor fit: GPUs are scarce, the docs change almost daily, and one bad update can degrade the model.

Example from the article: the VK Cloud AI consultant explains how to deploy a virtual machine with the VK Cloud Terraform provider.

Solution in brief

Keep the LLM frozen and put RAG in front of it. Documents are cut into sentence-based chunks and embedded in advance. The user query is first checked by a jailbreak classifier, then rewritten into a hypothetical answer (HyDE), matched against the vector store, reranked by an LLM, and only the top passages go to the answering LLM.

Questions this case answers
  • How to answer questions over a large, frequently updated document base without retraining a language model on every update
  • How to retrieve relevant passages when user queries are short, informal or misspelled and their embeddings match nothing
  • How to block adversarial prompts before they reach the language model of a public assistant
  • How to deflect consultation requests from a small support team to a chatbot that answers from daily-changing documentation?

Tools and methods

  • RAG — grounds answers in retrieved documentation, so doc updates apply at once.
  • Sentence-based chunking — splits large documents into pieces.
  • HyDE — searches with an LLM-written hypothetical answer instead of the raw query.
  • LLM reranker — orders the retrieved candidates by usefulness for the question.
  • Jailbreak classifier — a separate model that blocks forbidden requests.
Continue reading — it's free

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