Knowledge Graph-Enhanced RAG for Customer Service Question Answering

linkedin · Tech · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Customer service question answering

LinkedIn customer service representatives needed to retrieve and use relevant historical issue tickets quickly, but conventional RAG treated tickets as flat text and lost ticket structure plus relationships across issues. That hurt retrieval accuracy, answer quality, and issue-resolution time.

Constraints:

Architecture

LinkedIn built a knowledge-graph-enhanced RAG system for customer-service QA. Offline, Jira tickets are parsed into graph trees that preserve issue sections, explicit ticket relationships, and implicit semantic links from E5 title embeddings. Text-rich nodes are embedded into a vector store. Online, GPT-4 extracts query entities and intent using the same structural template, semantic retrieval selects top relevant tickets, GPT-4 translates a reformulated query into Cypher for subgraph extraction, and GPT-4 generates the answer from the original question plus retrieved graph context. If graph execution fails, the system falls back to traditional text retrieval.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  Historical_issue_tickets["Historical issue tickets"] --> Offline_graph_construction["Offline graph construction"]
  Offline_graph_construction --> GPT4_ticket_parser["GPT-4 ticket parser"]
  GPT4_ticket_parser --> Issue_knowledge_graph["Issue knowledge graph"]
  Issue_knowledge_graph --> Node_embedding_index["Node embedding index"]
  Customer_service_query["Customer service query"] --> GPT4_query_parser["GPT-4 query parser"]
  GPT4_query_parser --> Semantic_retriever["Semantic retriever"]
  Node_embedding_index --> Semantic_retriever
  Semantic_retriever --> Cypher_query_generator["Cypher query generator"]
  GPT4_query_parser --> Cypher_query_generator
  Cypher_query_generator --> Issue_knowledge_graph
  Issue_knowledge_graph --> Retrieved_subgraph["Retrieved subgraph"]
  Cypher_query_generator --> Fallback_text_retriever["Fallback text retriever"]
  Retrieved_subgraph --> GPT4_answer_generator["GPT-4 answer generator"]
  Fallback_text_retriever --> GPT4_answer_generator
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Historical issue tickets Past Jira-style customer-service tickets used as the knowledge base. Offline graph construction
Offline graph construction Parses issue tickets into tree-structured graph records with sections and relationships. Historical issue tickets, GPT-4 ticket parser, Issue knowledge graph
GPT-4 ticket parser Parses unstructured ticket portions according to a YAML structural template. Offline graph construction, Issue knowledge graph
Issue knowledge graph Stores intra-issue section trees plus explicit and implicit relationships across tickets. Offline graph construction, Node embedding index, Cypher query generator, Retrieved subgraph
Node embedding index Embeds text-rich graph nodes for semantic retrieval over cohesive ticket sections. Issue knowledge graph, Semantic retriever
Customer service query Representative's natural-language question about a customer issue. GPT-4 query parser
GPT-4 query parser Extracts entities and intent aligned to the graph template. Customer service query, Semantic retriever, Cypher query generator
Semantic retriever Ranks candidate historical tickets using node-level embedding similarities. Node embedding index, Cypher query generator
Cypher query generator Uses GPT-4 to translate the reformulated request into graph queries over selected ticket IDs. GPT-4 query parser, Semantic retriever, Issue knowledge graph, Retrieved subgraph, Fallback text retriever
Retrieved subgraph Graph context extracted for answer generation. Issue knowledge graph, GPT-4 answer generator
Fallback text retriever Traditional text-based retrieval path used when graph queries fail. Cypher query generator, GPT-4 answer generator
GPT-4 answer generator Synthesizes the final customer-service answer from the user query and retrieved graph or fallback context. Retrieved subgraph, Fallback text retriever

Data flow

Historical tickets are transformed into a knowledge graph that retains each ticket's internal tree structure and relationships to other issues. Text-rich graph nodes receive BERT/E5-style embeddings and are stored for semantic retrieval. At query time, GPT-4 parses the user request into graph-aligned entities and intent, the retriever finds related tickets and subgraphs, GPT-4 translates the request into Cypher over those ticket IDs, and the answer generator synthesizes the retrieved subgraph into customer-service guidance. Graph failures fall back to text-based retrieval.

3 supporting quotes
“Our method constructs a KG from historical issues for use in retrieval, retaining the intra-issue structure and inter-issue relations.”article, stated
“During the question-answering phase, our method parses consumer queries and retrieves related sub-graphs from the KG to generate answers.”article, stated
“the system reformulates the user's natural language query to reference specific ticket IDs retrieved in the first stage, then uses GPT-4 to translate this reformulated query into Cypher”summary, stated

Why this architecture

The architecture preserves ticket structure before retrieval so answers can use sections and relationships that ordinary chunked RAG discards. Graph queries recover subgraphs spanning ticket sections and related issues, while embeddings still provide semantic recall. The fallback path keeps the system usable when generated graph queries fail.

3 supporting quotes
“The conventional retrieval methods in retrieval-augmented generation (RAG) for large language models (LLMs) treat a large corpus of past issue tracking tickets as plain text”article, stated
“ignoring the crucial intra-issue structure and inter-issue relations, which limits performance.”article, stated
“This integration of a KG not only improves retrieval accuracy by preserving customer service structure information but also enhances answering quality”article, stated

Models used: GPT-4 · E5 embeddings · BERT embeddings · Qdrant vector database · Neo4j Cypher

Scale

Alternatives considered (roads not taken)

Conventional flat-text RAG over issue tickets

Rejected because: Flat retrieval ignores ticket structure and inter-ticket relationships, limiting performance.

“treat a large corpus of past issue tracking tickets as plain text, ignoring the crucial intra-issue structure and inter-issue relations”article, stated

Document-level chunking before retrieval

Rejected because: The summary says fixed text chunks can fragment logically connected ticket content across boundaries.

“fragmentation of logically connected content across chunk boundaries.”summary, stated

Graph-only retrieval without semantic embeddings

Rejected because: The implemented design still uses semantic retrieval to find relevant candidate tickets before graph subquery extraction.

“First, embedding-based retrieval identifies the top K most relevant historical tickets by computing cosine similarities between query entity values and corresponding graph nodes.”summary, stated

Fail closed when Cypher query generation fails

Rejected because: The production design falls back to traditional text retrieval for service continuity.

“if Cypher query execution fails or encounters issues, the system reverts to traditional text-based retrieval”summary, stated

Patterns

rag-retrieval (retrieval)

LinkedIn combines semantic retrieval with graph subgraph retrieval so customer-service answers preserve issue structure and relationships.

“We introduce a novel customer service question-answering method that amalgamates RAG with a knowledge graph (KG).”article, stated

tool-use-orchestration (architecture)

GPT-4 converts the reformulated natural-language request into Cypher so the system can use graph database queries as a retrieval tool.

“then uses GPT-4 to translate this reformulated query into Cypher (Neo4j's graph query language).”summary, stated

query-rewriting (retrieval)

The system parses user queries into graph-aligned entities and intent, then reformulates them around candidate ticket IDs before generating graph queries.

“When a user submits a query, the system first uses GPT-4 to perform entity extraction and intent detection.”summary, stated
“the system reformulates the user's natural language query to reference specific ticket IDs retrieved in the first stage”summary, stated

retrieval-ranking (retrieval)

Node-level embedding similarities are aggregated to rank historical tickets before graph retrieval.

“The scoring aggregates similarities across multiple entity matches, implementing a weighted retrieval where tickets matching multiple query aspects rank higher.”summary, stated

eval-driven-development (evaluation)

The paper evaluates both retrieval and answer generation with MRR, Recall@K, NDCG@K, BLEU, ROUGE, METEOR, and production resolution-time impact.

“Empirical assessments on our benchmark datasets, utilizing key retrieval (MRR, Recall@K, NDCG@K) and text generation (BLEU, ROUGE, METEOR) metrics”article, stated

Tradeoffs

Preserve issue-ticket structure in a knowledge graph.

Chose KG-enhanced RAG over plain-text RAG.

Rationale: The graph retains intra-ticket and inter-ticket structure, improving retrieval accuracy and answer quality.

“This integration of a KG not only improves retrieval accuracy by preserving customer service structure information but also enhances answering quality”article, stated

Use GPT-4 for parsing and graph-query translation.

Chose LLM-mediated entity, intent, and Cypher generation over manual query construction or pure embedding search.

Rationale: The LLM maps natural-language support questions into graph-aligned entities and executable graph queries.

“the system first uses GPT-4 to perform entity extraction and intent detection.”summary, stated
“uses GPT-4 to translate this reformulated query into Cypher (Neo4j's graph query language).”summary, stated

Combine semantic retrieval with graph queries.

Chose embedding top-K retrieval followed by subgraph extraction over graph-only lookup or embedding-only retrieval.

Rationale: Semantic retrieval finds relevant candidate tickets while graph queries recover structured sections and relationships for the answer.

“First, embedding-based retrieval identifies the top K most relevant historical tickets by computing cosine similarities between query entity values and corresponding graph nodes.”summary, stated
“The generated Cypher queries can traverse graph relationships to extract not just individual nodes but entire subgraphs spanning multiple tickets when necessary.”summary, stated

Keep a traditional retrieval fallback.

Chose fallback text-based retrieval over depending exclusively on generated graph queries.

Rationale: Fallback preserves service continuity when graph query generation or execution fails.

“The system implements a fallback mechanism crucial for production reliability: if Cypher query execution fails or encounters issues, the system reverts to traditional text-based retrieval”summary, stated

Gotchas (what bit them)

Flat RAG loses ticket structure that customer-service answers need.

Root cause: Treating tickets as plain text ignores intra-issue fields and inter-issue relations.

Resolution: Construct a knowledge graph from historical tickets and retrieve related subgraphs.

“treat a large corpus of past issue tracking tickets as plain text, ignoring the crucial intra-issue structure and inter-issue relations”article, stated

Chunking can split logically connected ticket content.

Root cause: Fixed-length text segments do not respect ticket sections such as descriptions, reproduction steps, and fixes.

Resolution: Embed cohesive graph nodes rather than arbitrary chunks.

“The node-level embedding generation solves the chunking problem elegantly: since each node represents a cohesive section of a ticket”summary, stated

Graph-query generation can fail in production.

Root cause: The generated Cypher query or graph execution path can encounter edge cases.

Resolution: Fallback to traditional text-based retrieval when the graph path fails.

“if Cypher query execution fails or encounters issues, the system reverts to traditional text-based retrieval”summary, stated

Static graph templates may become stale as support tickets evolve.

Root cause: The current approach depends on a YAML template and offline construction phase.

Resolution: The authors identify automated graph-template extraction and dynamic graph updates as future directions.

“Automated graph template extraction would reduce manual configuration and improve system adaptability to new domains or issue tracking systems.”summary, stated
“Dynamic knowledge graph updates based on user queries represent an interesting online learning direction.”summary, stated

Evaluation

The system was evaluated on benchmark datasets with retrieval metrics (MRR, Recall@K, NDCG@K), generation metrics (BLEU, ROUGE, METEOR), and real production impact over approximately six months in LinkedIn customer service.

Metrics: 77.6% MRR improvement · 0.32 BLEU improvement · 28.6% median per-issue resolution-time reduction · Recall@K · NDCG@K · ROUGE · METEOR

“Empirical assessments on our benchmark datasets, utilizing key retrieval (MRR, Recall@K, NDCG@K) and text generation (BLEU, ROUGE, METEOR) metrics”article, stated
“outperforms the baseline by 77.6% in MRR and by 0.32 in BLEU.”article, stated

Outcomes

The fetched source is the arXiv abstract page, but it states that the method was deployed within LinkedIn customer service for approximately six months and reduced median issue-resolution time by 28.6%. The ZenML summary adds that the system served multiple product lines.

“outperforms the baseline by 77.6% in MRR and by 0.32 in BLEU.”article, stated
“Our method has been deployed within LinkedIn's customer service team for approximately six months and has reduced the median per-issue resolution time by 28.6%.”article, stated