Agentic RAG vs vector RAG: two separate choices for database agents
Agentic vs fixed pipelines and vector vs SQL retrieval are separate choices. How to pick for agents that read relational data, and when controlled access beats indexing.
Updated October 2026. This article was first written when Claix was a document API. It has been rewritten around what Claix is today: a controlled retrieval layer over your own relational database. The core argument, that "agentic" and "vector" are separate choices, hasn't changed.
Retrieval-augmented generation started as a pipeline. Chunk the documents, embed the chunks, store the vectors, and before each answer pull the nearest passages and hand them to the model. It's easy to describe, which is partly why it's still what most tutorials teach.
Agents changed the shape of that, not what's inside it. Once models were reliable at calling tools, retrieval turned into something the model can do, repeat or skip, and many teams have worked that way for a while. What didn't change on its own is what sits behind the tool call. In a lot of projects it's still a vector search over a copy of the data, because that's what the tutorial built, even when the real source of truth is a Postgres table that already knows the answer.
What RAG for AI agents means
It means giving an agent access to information outside its context while it works. In a fixed pipeline that access happens once, up front. In an agentic setup it's a tool the agent calls whenever it decides it needs something.
Fixed pipeline
question → embed → vector search → chunks → model → answer
Agentic
task → agent decides what it needs → calls a database or search tool
→ looks at the result → calls another tool, or actsNothing in the second flow says the tool uses embeddings. It could be a BM25 index, a SQL query or an API. That's the next section.
Two choices that get mixed up
| Decision | Options |
|---|---|
| When does retrieval happen? | Always, before generation (fixed pipeline). Or when the agent calls a tool (agentic). |
| How are results matched? | Embeddings. Keyword search (BM25). A hybrid of the two. SQL or structured filters. No matching: the data goes into context directly. |
Any option in the first row combines with any option in the second. An agent can call a BM25 index. A fixed pipeline can run hybrid search. So "agentic RAG vs vector RAG" compares things on different axes, which is why those arguments tend to go in circles. It also means that a SQL query feeding a model is retrieval too: RAG only requires that retrieved information feeds the model, whatever did the retrieving.
Where fixed vector pipelines struggle with database records
Copies go stale. A vector index is a snapshot. A customer changes their consent, a booking is cancelled, a price is updated, and the index is wrong until the next sync. Meanwhile the database already had the right answer.
Similarity isn't lookup. Embeddings can tell you two passages are about the same thing. They can't tell you which reservation is next for a guest, or that 14 tables are booked on Saturday evening. Questions about exact values, counts and dates ask for a filter, a join or an aggregation, and nearest-neighbor search doesn't compute any of those.
Flattening loses relationships. A row means little without its keys: an order belongs to a customer, a reservation to a table, an employee to a shift. Turning rows into text chunks throws away the structure the database was built to enforce.
Access control doesn't survive the copy. In the source database, permissions decide which tables and columns a role can read. Once the data is embedded into a separate store, those rules have to be rebuilt there, and every rebuild is a chance to expose something that was meant to stay private.
One lookup is rarely enough. Finding a customer, then their latest booking, then checking the deposit against a policy is several steps, each depending on the last. A fixed chain assumes one retrieval covers it. This is the part the agent loop genuinely fixed.
Vector stores come with upkeep. Ingestion, syncing, re-embedding when the schema changes, deletions, and evaluating whether retrieval is any good. None of it is exotic, but it's work that exists before the product does anything.
None of this makes vector search a bad tool. If someone asks for everything in a company wiki related to data retention, without knowing which words the authors used, embeddings do something SQL can't. The complaint is about using them as the default for data where the questions are about exact values.
What agentic retrieval looks like
The agent decides whether it needs to retrieve at all, picks a source, rewrites its query if the first attempt was off, checks whether the result is enough, and either tries again or stops. The tools it gets can be as ordinary as search_wiki(), query_database(), get_customer(), check_availability(), call_api() and request_human_review().
This is the baseline now, not a frontier. The open question is what query_database() does well, and under whose rules: which tables the agent can touch, what it's allowed to return, what happens when the data isn't there, and who can see what it asked.
How retrieval for agents evolved
Roughly in this order: retrieve and generate; add reranking; mix vector, keyword and metadata filters in a hybrid setup; let the agent call retrieval as a tool instead of running it on a fixed path; and, for business data, point that tool at the system of record instead of a copy. The early steps aren't new anymore. What's still being worked out is the layer under the tool, where a generic connection stops being enough and boundaries start to matter.
Alternatives to vector-based retrieval
Calling these "alternatives to RAG" is loose, since most of them still hand external context to a model. They differ in how that context gets chosen.
Direct SQL generation. The model writes a query from the question and the schema. Flexible and quick to prototype. The hard parts are keeping it read-only, keeping it inside the tables it should use, and keeping it correct.
Predefined queries and function tools. You write a fixed set of functions (get_order_status, list_bookings) and the agent calls them. Predictable and safe, but every new kind of question needs new code.
Semantic layers. Define metrics and entities once, and agents query those instead of raw tables. Good for analytics and governed metrics, and often heavier than a small team wants to run.
Database MCP servers. Expose a database to an agent through the Model Context Protocol. Quick to connect. The access model depends on the server and on the role you connect with.
Keyword and hybrid search. BM25 on its own is often enough when people search with the same terms the content uses. Combined with vectors it covers a lot of ground.
Knowledge graphs. They capture relationships that similarity doesn't, at the cost of building and maintaining the graph.
Full context. For small datasets, giving the model everything in a clean, structured form can be more reliable than retrieving pieces.
Structured extraction. If the information is still locked in PDFs or spreadsheets, extract it into fields and load it into a table first. After that it's a database question.
Retrieval over databases for agents
"Text-to-SQL" often just means a model writing queries, which is one implementation. An agent working with a company database might need to look up a record, count rows that match a condition, check a flag, join two tables, and tell the difference between "no" and "the data isn't there". It has to do all of that inside limits someone chose on purpose. That's closer to a controlled interface than to a search index.
Where Claix fits
Claix is a controlled data retrieval layer for AI agents. It connects to any SQL database, so it doesn't copy your data into a vector store or build an index over it. "No vector database" on its own says very little, so here is what it does.
You connect the database with a read-only role. Claix reads its structure and drafts a Data Map (tables, descriptions and relationships) for you to review and edit. You then create routes: each route lists the tables and columns it may use, plus a short guide in plain language with your rules and vocabulary. Finally you create an agent: a name that becomes its endpoint, a business prompt that says what it does and when to use each route, the routes attached to it, and a response mode, either raw results or reasoned answers returned in the type you ask for.
Calling an agent is one request. You send up to five questions, each tagged with the type you expect (string, integer, boolean, array or object), and get typed answers back in the same order. Behind that, the model writes SELECT queries inside the boundaries of the agent's routes. Queries are validated before they run, and every request is traced, so you can see which route answered, what ran and what came back. When the allowed tables don't contain the answer, the field comes back empty instead of a guess. Agents are reachable over REST, MCP and A2A, and you can run them on Claix Managed AI or with your own LLM key.
That design has a ceiling, and it's worth saying plainly. It works when the answers live in relational data and you can describe the relevant tables. It doesn't do semantic discovery over a pile of unstructured text; for that you want a search step in front, and whether that's embeddings or BM25 is its own decision. Access is scoped per agent, not per end user: if each person must see only their own rows, enforce that in your database or your application. And a model can still write a query that is allowed and valid but wrong, which is why good descriptions, explicit relationships and traces matter. If your information is still in PDFs, Claix Ingest extracts it into structured fields and loads it into your database, so an agent can then ask questions about it.
One more thing worth knowing: choosing which agent gets which tables is the part you control. Claix doesn't decide what your agents should be allowed to see. It enforces what you decided, and shows you what happened.
Alternatives to Vanna and LlamaIndex
Vanna is a text-to-SQL framework you host and extend yourself, and LlamaIndex is built around connectors, indexes and query engines. If you want a framework you run and tune, they fit. If you don't, there are other routes: calling tools directly from a provider SDK when you want control over state, retries and permissions; LangChain and LangGraph for branching workflows and human approval steps; a semantic layer such as Cube when you need governed metrics; a database MCP server for quick access; or a managed layer such as Claix. Claix isn't an agent framework and doesn't replace one. It's something you call from inside one.
When vector databases still make sense
When you have millions of text segments, a large permanent collection, heavy and repeated query volume, many users on the same content, or a product where search is the product. In those cases embeddings earn their upkeep. The useful question isn't vectors or agents, it's which kind of lookup each task needs: semantic discovery, exact values, aggregation across rows, live records, or documents.
A better architecture for database agents
Think in layers. First, a described data model: tables, columns and relationships in business language, so an agent knows what each thing means. Second, scoped access: which tables and columns each capability can use, over a read-only connection. Third, retrieval operations: look up, filter, join, count, compare, with validation and limits. Fourth, the agent's own reasoning: planning, picking tools, checking results, deciding whether to continue. Fifth, the business action: create a record, notify someone, escalate, ask for review.
A fixed vector pipeline can embed the rows of a bookings table and ask a model for a guest's next reservation. It may return a stale one, or one that merely looks similar. A controlled approach asks the database which reservation is next for that guest, joined with the table and the deposit, using only the columns the agent is allowed to read, and returns an object the workflow can use directly. A compliance check works the same way: has this customer accepted marketing consent is a boolean your workflow can branch on, not a paragraph to interpret. A support agent checks an order's status before replying, using only the columns it needs.
Why agentic retrieval became the default
Agents need context from several sources over several steps. Retrieval is one tool among databases, CRMs, calculators, web search and human review. They have to judge whether the evidence is enough, whether two sources disagree, and whether it's safe to act. And a task like confirming a booking doesn't fit one search followed by one answer.
What changes for developers
The work shifts from building one big retrieval pipeline to designing a small set of capabilities with boundaries. Instead of asking how to index everything, ask what the agent should be able to read, from which tables, under which rules, and how you'll see what it did. Instead of syncing your data into a new system, ask whether the system that already holds it can answer, with the right limits around it.
A practical decision framework
- Small dataset, known fields: skip retrieval and put it in context.
- Data in a relational database, questions about exact values: query it where it lives, scoped to the tables the agent needs.
- The same questions over and over: predefined functions or routes, so behavior is predictable.
- Data in documents: extract it to structured fields first, or search with embeddings if the questions are semantic.
- Many sources: let an agent call each one as a tool.
- Need to know what happened: trace every request, including the question, the route and the result.
Common mistakes
Treating every data problem as semantic search when the workflow needs counts, dates or identifiers. Copying a database into a vector store before checking whether the database can answer. Giving an agent a connection with broad permissions and relying on the prompt to keep it in line. Describing tables badly, so the model guesses what a column means. Treating missing data as a negative answer, when unknown isn't the same as false. Letting an agent act on customer or financial systems without a trail of what it read. And comparing "agentic" against "vector" as if they were one axis.
Where this leaves things
The part where an agent calls retrieval as a tool is settled. The part still being worked out is what those tools look like for business data: how much access they get, who defines it, how wrong answers get caught, and how you review what happened. That's where we're spending our time.
Frequently asked questions
- What is RAG for AI agents?
- Giving an agent access to information outside its context while it works, through retrieval or data tools. The agent can decide when to retrieve, from which source, and whether it needs more.
- What is agentic RAG?
- Retrieval as a tool the agent calls, instead of a fixed step that always runs. The agent decides when to retrieve, rewrites queries, checks whether the result is enough, and continues or stops.
- Is agentic RAG replacing traditional RAG?
- Largely, in the sense that agents calling retrieval tools is now the common pattern. It doesn't replace vector search itself. "Agentic" and "vector" are separate choices.
- Is SQL retrieval RAG?
- Yes. RAG means retrieved information feeds the model. It doesn't require embeddings, and the retrieved information doesn't have to be text chunks.
- Is keyword search (BM25) RAG?
- Yes, for the same reason.
- Are vector databases or embeddings obsolete?
- No. They're the right tool for semantic discovery over large collections of text. They aren't needed for every workflow, especially when the data already lives in a relational database and the questions are about exact values.
- Can I build an agent without a vector database?
- Yes. Use SQL, predefined functions, keyword search, APIs or other tools. A vector database is worth it when the use case needs semantic retrieval over a large collection.
- What are alternatives to vector-database RAG?
- Direct SQL generation, predefined function tools, semantic layers, database MCP servers, keyword or hybrid search, knowledge graphs, and full-context prompts.
- What are alternatives to Vanna and LlamaIndex?
- Direct tool calling from a provider SDK, LangChain and LangGraph, a semantic layer such as Cube, a database MCP server, a custom runtime, or a managed layer such as Claix. Which one fits depends on whether you want a framework to host, a metrics layer, or a managed service.
- Does Claix use embeddings?
- Claix doesn't copy your data or build a vector index over it. Agents query your database where it lives, within the tables and columns you allow.
- Does Claix write to my database?
- No. Claix connects with a read-only role. Loading data is a separate product, Claix Ingest, which you choose to use.
- Which databases does Claix support?
- Any SQL database, including Postgres, MySQL, and MariaDB. You connect with a read-only role.
- Can I use my own LLM key?
- Yes. You can use Claix Managed AI or connect your own key and choose your model. With your own key, results depend on the model you pick, so test it before going live.
- Is Claix a replacement for LlamaIndex, Vanna or LangChain?
- No. Claix is a retrieval layer you can call from a custom runtime or from frameworks such as LangChain and LangGraph. It doesn't replace an agent framework.
- How does Claix fit into agentic retrieval?
- An agent can call it as a tool: ask typed questions about your data over REST, MCP or A2A. It doesn't decide which databases matter. You decide what each agent can access, and Claix enforces it and records what happened.