All articles

Article

Alternatives to RAG: 6 Options and When Retrieval Still Wins

Alternatives to RAG compared: long-context prompting, fine-tuning, text-to-SQL, GraphRAG, cache-augmented generation and agentic search, with when to keep RAG.

· alternatives · rag

Ian KikuCTO & Founder, Team Nebula

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

ApproachGood forCost driversData freshnessMain risk
Long-context promptingSmall corpora, whole-document reasoningInput tokens on every callAs fresh as what you paste inMissed facts in the middle of long inputs
Fine-tuningTone, format, narrow task behaviorTraining runs, labeled data, re-trainingFrozen at training timeWeak at adding new facts
Tool calling / text-to-SQLExact figures from live systemsEngineering for tools, schemas, permissionsLiveWrong query returns a confident wrong answer
GraphRAG / knowledge graphsCorpus-wide themes, multi-hop linksLLM calls to build and refresh the graphStale until re-indexedExtraction errors baked into the graph
Cache-augmented generationSmall, stable knowledge, low latencyContext size, cache refreshesStale until the cache is rebuiltBreaks when knowledge outgrows the window
Agentic searchCodebases, file trees, messy foldersMany tool calls and turns per answerLiveSlow, and harder to bound

Long-context prompting

Current Claude models accept 1M-token context windows. Anthropic's guidance 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 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 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, 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 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 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" (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 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 and adding semantic search only when you need speed. Its context engineering post 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, or see how we take pilots to production.

Article

Pinecone Alternatives: 8 Vector Databases Compared for Production RAG

Pinecone alternatives compared: pgvector, Qdrant, Weaviate, Milvus, Chroma, LanceDB, OpenSearch and Turbopuffer, by hosting, license and hybrid search.

Read the article

Article

Zapier Alternatives for AI Automation: 7 Options Compared in 2026

Zapier alternatives for AI automation compared: n8n, Make, Power Automate, Workato, Pipedream, Activepieces and custom agent code, with hosting and license.

Read the article

Article

Amazon Bedrock Alternatives: Where to Run Your LLM Apps in 2026

Compare Amazon Bedrock alternatives: Google's Agent Platform, Microsoft Foundry, direct APIs, self-hosted vLLM, Databricks and Snowflake, plus when to stay.

Read the article

Get in touch

A short call is the fastest way to find out. No pitch, just the work.