---
title: Alternatives to RAG: 6 Options and When Retrieval Still Wins
description: Alternatives to RAG compared: long-context prompting, fine-tuning, text-to-SQL, GraphRAG, cache-augmented generation and agentic search, with when to keep RAG.
keywords: alternatives to RAG, RAG vs fine-tuning, RAG vs long context, cache-augmented generation, GraphRAG vs RAG
canonical: https://teamnebula.ai/lab/blog/alternatives-to-rag
url: https://teamnebula.ai/lab/blog/alternatives-to-rag
markdown: https://teamnebula.ai/lab/blog/alternatives-to-rag.md
---

# Alternatives to RAG: 6 Options and When Retrieval Still Wins

The main alternatives to RAG are long-context prompting, fine-tuning, tool calling against the system of record (including text-to-SQL), knowledge graphs such as GraphRAG, cache-augmented generation, and agents that search documents on their own. Each one fixes a different RAG weakness, and none replaces it everywhere. A good rule: use retrieval for large, changing text, use tools for numbers that live in a database, and put small, stable knowledge straight into the prompt.

## Quick comparison

| Approach | Good for | Cost drivers | Data freshness | Main risk |
|---|---|---|---|---|
| Long-context prompting | Small corpora, whole-document reasoning | Input tokens on every call | As fresh as what you paste in | Missed facts in the middle of long inputs |
| Fine-tuning | Tone, format, narrow task behavior | Training runs, labeled data, re-training | Frozen at training time | Weak at adding new facts |
| Tool calling / text-to-SQL | Exact figures from live systems | Engineering for tools, schemas, permissions | Live | Wrong query returns a confident wrong answer |
| GraphRAG / knowledge graphs | Corpus-wide themes, multi-hop links | LLM calls to build and refresh the graph | Stale until re-indexed | Extraction errors baked into the graph |
| Cache-augmented generation | Small, stable knowledge, low latency | Context size, cache refreshes | Stale until the cache is rebuilt | Breaks when knowledge outgrows the window |
| Agentic search | Codebases, file trees, messy folders | Many tool calls and turns per answer | Live | Slow, and harder to bound |

## Long-context prompting

Current Claude models accept [1M-token context windows](https://platform.claude.com/docs/en/about-claude/models/overview). [Anthropic's guidance](https://www.anthropic.com/engineering/contextual-retrieval) says a knowledge base under about 200,000 tokens can go straight into the prompt, with no retrieval step.

Pick it when:

- The whole corpus fits comfortably in one prompt.
- Questions need reasoning across a full document, not one passage.
- You can live with the [lost in the middle](https://arxiv.org/abs/2307.03172) effect, where accuracy drops for facts buried mid-context.

## Fine-tuning

Fine-tuning changes model weights. Research comparing the two found that [RAG beat unsupervised fine-tuning](https://arxiv.org/abs/2312.05934) for injecting knowledge, both for facts seen in training and for new ones.

Pick it when:

- You need a consistent style, format or classification behavior.
- The knowledge itself rarely changes.
- You still pair it with retrieval for facts.

## Tool calling and text-to-SQL

With [tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview), the model calls functions you define, such as a database query or an API, and your code runs them. The answer comes from the system of record, not from a text chunk.

For a state audit office, [code checks the ledger arithmetic deterministically](/cases/government-audit-oversight-ai) instead of asking a model, and auditors decide every finding.

Pick it when:

- The answer is a number, status or record in a database.
- Figures must match the source exactly.
- You can scope tools to read-only access with the caller's permissions.

## Knowledge graphs and GraphRAG

Microsoft's [GraphRAG paper](https://arxiv.org/abs/2404.16130) has an LLM extract an entity graph, then pre-write summaries for clusters of related entities. It targets global questions such as "what are the main themes?", where plain vector RAG struggles.

Pick it when:

- Users ask about patterns across the whole corpus.
- Answers depend on links between people, contracts or assets.
- You can budget for rebuilding the graph when sources change.

## Cache-augmented generation (CAG)

The term comes from the paper ["Don't Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Tasks"](https://arxiv.org/abs/2412.15605) (Chan et al., WWW 2025). CAG preloads the knowledge into the context and caches the model's runtime state, so there is no retrieval step at query time. The authors scope it to knowledge bases small enough to fit in the context window. In practice, provider features like [prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) reuse a processed prompt prefix for a set time.

Pick it when:

- The knowledge is small and changes rarely.
- Latency matters and retrieval errors are your main failure.

## Agents that browse documents

Instead of a pre-built index, an agent searches files with tools like grep and reads what it finds. Anthropic's Agent SDK guidance suggests [starting with agentic search](https://www.anthropic.com/engineering/building-agents-with-the-claude-agent-sdk) and adding semantic search only when you need speed. Its [context engineering post](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) notes that just-in-time search sidesteps stale indexes.

Pick it when:

- Content changes constantly, as in a codebase.
- Files have clear names and structure an agent can navigate.
- A few extra seconds per answer is acceptable.

## When RAG is still right

- The corpus is too large for any context window.
- Content changes often, and re-indexing is cheaper than retraining or re-caching.
- Every answer needs a citation to a specific passage.
- Different users may see different documents, so retrieval must filter by permission.
- You need fast answers at high volume.

Many production systems mix these: retrieval for text, tools for numbers, and a cached prompt for policies that rarely change.

## How to choose

1. **Classify the questions.** Lookup, calculation, summary across the corpus, or style.
2. **Measure the corpus.** If it fits in a prompt with room to spare, try long context first.
3. **Find the system of record.** If the answer lives in a database, call it with a tool.
4. **Check how often data changes.** Fast-changing data rules out fine-tuning and favors retrieval or tools.
5. **Build an eval set before you build.** Score each approach on real questions, then pick.

## FAQ

### Is RAG obsolete now that context windows are so large?

No. Long context works well for small corpora. Large or changing corpora, citations and per-user permissions still favor retrieval.

### What is the difference between RAG and fine-tuning?

RAG fetches facts at question time. Fine-tuning changes the model's weights, which suits behavior and format better than new facts.

### What is cache-augmented generation?

It preloads a small, stable knowledge set into the model's context and caches it, so answers skip the retrieval step. The term comes from a 2024 paper by Chan et al.

### When is text-to-SQL better than RAG?

Use it when the answer is a figure or record in a database. Retrieval over text is the wrong tool for arithmetic.

Not sure which approach fits your data? [Request a free one-pager](/f/one-pager), or see how we take [pilots to production](/services/pilot-to-production).
