Retrieval-Augmented Generation with Knowledge Graphs for Customer Service Question Answering

Zhentao Xu, Mark Jerome Cruz, Matthew Guevara, Tie Wang, Manasi Deshpande, Xiaofeng Wang, Zheng LiMay 2024

Problem

Support engineers often resolve issues that resemble tickets closed earlier. The usual RAG setup cuts each ticket into fixed-length chunks and embeds them. That loses the ticket's fields and its links to other tickets ("copied from", "caused by"), so retrieval gets worse. Chunking can also put a ticket's description in one chunk and its fix in another, so answers come back incomplete.

Example from the article: a query asks how to reproduce a "csv upload error in updating user email" issue with major priority and a data-issue root cause. The system finds the ticket and returns its "steps to reproduce" section.

Solution in brief

Turn each ticket into a tree of sections, link tickets into one graph, and retrieve by section instead of by chunk. At question time an LLM extracts entities and intent from the query, embedding search picks the best tickets, and an LLM-written graph query pulls out exactly the requested section.

Questions this case answers
  • How to retrieve answers from a corpus of semi-structured, cross-referenced documents without losing field structure and links to fixed-length chunking
  • How to prove in production that a retrieval-based assistant shortens the time staff need to resolve a task
  • How to answer support agents' questions from a large archive of past issue tickets with an LLM?
  • How to keep the structure of tickets and the links between them when building a retrieval index for RAG?

Tools and methods

  • Knowledge graph of tickets — a tree of sections per ticket, plus explicit and implicit links between tickets
  • LLM parsing with a YAML template — fills the tree from free text
  • Embeddings (E5, BERT) in a vector database such as Qdrant — score nodes by section
  • LLM query translation to Cypher (Neo4j) — extracts the needed sub-graph
  • GPT-4 — parsing, query rewriting and answer generation in the paper's evaluation
Continue reading — it's free

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