Case study2026 · Applied AI · GenAI

Customer-interaction RAG agent

A retrieval and tool-use workflow for policy and account questions, with citations, scoped lookups, and human escalation.

Decision and workflow

LinenFlow is a fictional commercial linen provider. The system must decide whether a customer-operations answer is authorised, evidence-backed, and complete enough to send. It can explain approved policy and read scoped synthetic records, but it cannot change a quote, order, route, credit, or entitlement.

System approach

The MVP compares lexical, dense, and hybrid retrieval before wrapping the selected retriever in a constrained single-agent workflow. Retrieval is filtered by persona scope, tool arguments are validated, citations point back to versioned policy evidence, and a confidence gate routes uncertainty, conflicts, access violations, and authority requests to a human.

LinenFlow customer operations RAG architecture showing simulated persona scope, retrieval, synthetic records, tools, confidence gate, cited response, and human handoff
LinenFlow customer operations RAG architecture showing simulated persona scope, retrieval, synthetic records, tools, confidence gate, cited response, and human handoff

Baseline and evaluation

The offline evaluation contains 60 attributed synthetic cases across sales, fulfilment, service, access, clarification, conflict, and adversarial behavior. It records retrieval hit rate, workflow-status accuracy, citation correctness, tool selection, escalation accuracy, coverage, latency, and safe refusal.

Operational boundary

The workflow separates policy evidence from operational records. Prompt injection, stale policy, unavailable tools, and missing identifiers are routed to review or refusal. All records and incidents are synthetic or simulated.

Reproducibility

The repository includes versioned policy fixtures, a scoped SQLite tool layer, an evaluation set, offline traces, monitoring reports, and a Streamlit presentation surface. All results shown here are portfolio evidence rather than observed production outcomes.

Selected evidence

Each visual answers a specific question about system behavior. Read the caption and limitation together.

Synthetic case matrix showing customer questions, retrieved sources, tool actions, and final outcomes
Synthetic case matrixMultiple synthetic cases show how evidence, tool use, and authority boundaries lead to answer, clarification, refusal, or human review outcomes. Limitation: The cases, records, and outcomes are deterministic portfolio simulations.
Summary of retrieval and workflow outcomes across tested methods
Workflow outcomeThe agent is evaluated on whether it chooses the right workflow status, not only whether it generates fluent text. Limitation: The evaluation set and routing are deterministic and synthetic.
Retrieval hit at five comparison across lexical, dense, and hybrid methods
Retrieval comparisonRetrieval quality is treated as a measurable part of the system contract. Limitation: The corpus is deliberately small.
Tool and escalation accuracy view for the customer operations agent
Tools and escalationAuthority boundaries turn uncertain or consequential requests into inspectable handoffs. Limitation: Tool records and escalations are simulated.
Simulated monitoring dashboard showing stale-policy and unavailable-tool incidents
MonitoringThe monitoring story includes stale evidence and dependency failure, not only happy-path quality. Limitation: Both incidents are injected simulations.