---
Title: "What Is Retrieval-Augmented Generation (RAG)?"
Url: "https://computer.io/glossary/retrieval-augmented-generation"
Topic: "AI foundations"
Description: "Retrieval-augmented generation (RAG) is a technique where AI retrieves information from trusted sources and uses it to generate grounded, cited answers."
---

# What is retrieval-augmented generation (RAG)?

Retrieval-augmented generation (RAG) is a technique in which an AI system first retrieves relevant information from trusted sources, such as documents, knowledge bases or databases, and then gives it to a language model to generate an answer. This grounds responses in current, company-specific facts and allows sources to be cited.

## How RAG works

1. User asks a question.
2. The system searches sources (often with vector embeddings).
3. Top passages are added to the prompt.
4. The model writes an answer using them.
5. Sources are cited.

## Strengths and limits

| Strengths | Limits |
| --- | --- |
| Uses current data | Only as good as retrieval |
| Cites sources | Misses relationships across records |
| No retraining | Context window limits |

## Beyond basic RAG

GraphRAG and knowledge-graph approaches add relationships; agentic RAG lets the agent decide what to retrieve next.

## FAQ

### Why is RAG used?

To give AI accurate, up-to-date, company-specific answers without retraining the model.

### Does RAG prevent hallucinations?

It reduces them but doesn't eliminate them.

### What is the difference between RAG and a knowledge graph?

RAG retrieves text passages; a knowledge graph stores entities and relationships. They're often combined.

## Related terms

- [Knowledge graph](https://computer.io/glossary/knowledge-graph)
- [Vector database](https://computer.io/glossary/vector-database)
- [Embeddings](https://computer.io/glossary/embeddings)
- [Should you use RAG or fine-tuning for enterprise AI?](https://computer.io/answers/should-you-use-rag-or-fine-tuning)

## How Computer helps

- [Enterprise search and answers](https://devrev.ai/enterprise-search-and-answers)
- [How computer works](https://computer.io/how-computer-works)

## Further reading

- [Knowledge graphs vs rag enterprise ai](https://devrev.ai/blog/knowledge-graphs-vs-rag-enterprise-ai)
- [Rag vs knowledge graph ai](https://devrev.ai/blog/rag-vs-knowledge-graph-ai)
- [Continuous improvement of rag results](https://devrev.ai/blog/continuous-improvement-of-rag-results)
