I see this mistake all the time with RAG in n8n:
Someone realizes their agent needs external knowledge, so they immediately wire up a vector database and hope that fixes accuracy.
Sometimes it does.
A lot of times, it makes the agent feel smart while still being wrong.
The big unlock for me is simple: RAG is really a context delivery problem.
Not a “just embed everything” problem.
If I know what kind of question the agent needs to answer, picking the right retrieval method gets a lot easier.
The main trap is chunk-based retrieval.
It’s fast. It’s cheap. It’s great for semantic matching. But it also strips away the bigger picture. The agent often answers based on the chunks it found, not the full reality of the source.
That’s exactly why hallucinations sneak in.
If I ask for something like a full summary, a timeline, the highest sales week, or an average across a dataset, chunk retrieval can break hard because the model is only seeing fragments. It’s not reasoning over the entire thing.
So instead of treating vector search like the default, I think in a much more practical order:
If a human would use filters, use filters.
If a human would use formulas or a pivot table, use SQL.
If a human would read the whole doc before answering, give the model the whole doc.
Only use vector search when semantic matching is actually the right tool.
That framing cleans up a lot.
For structured data, filters are ridiculously underrated.
If the question is something like “how many Bluetooth speakers did we sell on September 16,” I don’t need embeddings. I need the agent to filter product = Bluetooth speaker and date = September 16, then sum the quantity.
That’s cleaner, cheaper, and more accurate.
The catch is that filters aren’t magic. The agent needs to know the exact field values and formats. If the database says Bluetooth Speaker and the model sends bluetooth speaker, the filter can fail. So I like being explicit in the prompt about valid product names, date formats, and expected schema.
Then there’s SQL, which is where a lot of n8n builders should probably go way earlier.
If I need totals, averages, rankings, comparisons, or trends across many rows, SQL is the move.
Instead of shoving a giant table into the model and hoping it does math correctly, I let the database do database things. The agent writes the query, Postgres does the grouping/sorting/aggregation, and the model just explains the result.
That’s such a better pattern.
It’s also one of those moments where elegant beats fancy.
I’d rather have one solid SQL query than a “clever” RAG setup that feels advanced but gives shaky answers.
For documents, I’ve also become way more bullish on full-context retrieval than most people are.
If the document is small enough to fit comfortably inside the context window, I’ll often just pass the whole thing in.
Why?
Because sometimes the most reliable RAG strategy is barely RAG at all. It’s just giving the model the actual source.
This is especially true for:
- summaries
- chronological breakdowns
- step-by-step explanations
- anything where order matters
Yes, it costs more tokens.
Yes, it can be slower.
But if accuracy is the priority and the data fits, full context is often the easiest win.
And with modern context windows getting bigger, this is more viable than people think.
Then vector search still absolutely has a place.
I use it when I need semantic lookup across larger knowledge bases and I don’t need the model to understand the entire document end-to-end. It’s great when the right answer lives in a few relevant passages and I want fast retrieval without passing everything in.
But I don’t expect it to do jobs it’s not built for.
If I ask for a full chronological breakdown of a transcript, vector search might return useful chunks, but it still doesn’t truly “understand” the whole sequence unless I do extra work with metadata, chunk ordering, retrieval limits, or hybrid approaches.
So my practical rule now is:
Don’t start with the tool.
Start with the question.
What exactly will users ask?
What data does the agent need to see to answer correctly?
Does it need a few rows, aggregated results, the full document, or just semantically similar passages?
That’s the real build logic.
I think a lot of bad agent performance gets blamed on prompts, models, or “AI being dumb,” when the real issue is that the agent never got the right context in the first place.
That’s why context engineering matters so much.
Not in a buzzword way. In a very hands-on way.
If I’m building in n8n, I’m constantly asking:
What’s the smallest amount of the right context I can give the model to produce the best answer?
That question alone will make a lot of RAG agents way better.
And honestly, once I started looking at it like that, building RAG agents got a lot less confusing.
Not because the systems became simpler.
Because the decision-making did.