Skip to main content
This example shows how to build a Retrieval-Augmented Generation (RAG) system that automatically redacts PII from both user queries and retrieved documents before sending to the LLM.

Overview

RAG systems often process sensitive documents (HR records, customer data, legal contracts). This example demonstrates:
  • Auto-redacting PII from user queries
  • Sanitizing retrieved documents before LLM context
  • Maintaining answer quality while protecting data

Architecture

Implementation

Setup

Basic RAG with Protection

With LangChain

PII Types Detected

Next Steps

Data Privacy Example

More data protection patterns

Threat Detection

Understand detection capabilities