> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RAG and RLHF Workflows

> Design Retrieval-Augmented Generation and RLHF workflows that improve accuracy, grounding, and alignment.

# RAG and RLHF workflows

RAG and RLHF address two of Gen AI’s biggest risks: **hallucination** and **misalignment**.

This page outlines how to structure both workflows using shared data foundations.

***

## Retrieval-Augmented Generation (RAG)

### Key challenges

* Low-quality or outdated sources
* Poor chunking strategies
* Weak retrieval relevance
* Silent failure modes

### Recommended workflow

1. Curate trusted knowledge sources
2. Embed and cluster content
3. Evaluate retrieval relevance
4. Annotate failures and gaps
5. Refine sources and prompts

**Recommended docs**

* [Files](/platform-documentation/Curate/index-files)
* [Embedding Plots](/platform-documentation/Curate/embedding-plots)
* [Collections](/platform-documentation/Curate/curation-basics)

***

## RLHF and preference learning

### Common feedback signals

* Binary correctness
* Pairwise preference
* Safety and policy compliance
* Style and tone alignment

### Recommended workflow

1. Define feedback ontologies
2. Collect structured human judgments
3. Review for consistency
4. Analyze trends and disagreement
5. Iterate on data and prompts

**Recommended docs**

* [Ontologies](/platform-documentation/Annotate/annotate-ontologies/annotate-ontologies)
* [Annotate & Review](/platform-documentation/Annotate/annotate-label-editor/annotate-label-editor-annotate)
* [Quality Metrics](/platform-documentation/Validation/label-validation-basics#quality-metrics)

***

## Bringing RAG and RLHF together

The strongest Gen AI systems combine both:

* RAG reduces hallucinations
* RLHF improves behavior and alignment
* Evaluation connects the two

Together, they form a continuous improvement loop.

***

## Key takeaway

Gen AI quality improves fastest when **grounding and alignment are treated as first-class data problems**, not post-hoc fixes.
