Document updated on May 21, 2025
AI Security
RAG Pipelines (DRAFT)
You can use KrakenD as a secure, lightweight proxy layer in a RAG (Retrieval-Augmented Generation) pipeline, and even enforce exfiltration prevention and data sanitization on the fly.
As per today, the usage of RAG requires you to make manual use of the sequential proxy and implement the flow in the configuration.
A typical RAG pipeline looks like this:
- User prompt
- API Gateway (KrakenD)
- Retriever (e.g., vector DB)
- Enricher / Processor (e.g., metadata enrichers, relevance filters)
- LLM
- Response to user (with or without additional data manipulation)
See the Sequential Proxy and Workflow components to implement this logic.
This component is valid both for:
- Training the LLM
- Query model