Meriem B.
·Retrieval·6 min

From keyword search to agentic AI

How retrieval evolved from exact word matching to agents that decide what to search for, and why that shift is the harder problem now.

1. Keyword Search

This is the old-school search model.

It works by matching the exact words you type with the exact words inside documents.

Example:

You search:

"cheap laptop"

The system looks for documents that contain the words cheap and laptop.

This is fast and useful, but it has a big problem: it does not understand meaning.

So if a document says:

"affordable notebook computer"

A basic keyword search might miss it, even though it means almost the same thing.

Keyword search treats words like symbols, not ideas.


2. Semantic Search

Semantic search improves this by trying to understand the meaning behind words.

Instead of only matching text, it converts words, sentences, or documents into vectors.

A vector is basically a numerical representation of meaning.

So concepts with similar meaning are placed close together.

Example:

"coffee"

"espresso"

"cappuccino"

These would be close in vector space because they are similar in meaning. So you can search for:

"best coffee machine"

And the system might still find documents about:

"espresso makers"

Even if the exact word "coffee machine" is not used.

Semantic search is better because it understands similarity and intent.


3. RAG: Retrieval Augmented Generation

Then Large Language Models became popular.

But LLMs have a problem: they do not automatically know your private data, recent documents, or company knowledge.

Also, they can hallucinate.

So RAG was created.

RAG means:

Before the AI answers, it first retrieves relevant information, then uses that information to generate the answer.

The flow is usually:

User asks a question
→ system searches relevant documents
→ sends those documents to the LLM
→ LLM answers using the retrieved context

Example:

You ask:

"What is our refund policy?"

The AI searches your company docs, finds the refund policy, then answers based on that document.

RAG gives LLMs something like external memory. It lets the model answer with more accurate and source-based information without needing to retrain the model.


4. Better RAG Pipelines

Basic RAG is useful, but it is not always enough.

Sometimes the first retrieved documents are not the best ones.

So RAG systems started adding extra steps like:

Rerankers

A reranker checks the retrieved results and reorders them by relevance.

So instead of trusting the first search result, the system asks:

"Which of these documents is actually most useful for this question?"

Query Expansion

The system rewrites or expands your search query.

Example:

You ask:

"How do I fix login issues?"

The system may also search for:

"authentication errors"

"sign-in problems"

"OAuth failure"

Hybrid Retrieval

This combines keyword search and semantic search.

Keyword search is good for exact matches like names, IDs, error codes, and function names.

Semantic search is good for meaning and intent.

Together, they produce better retrieval results than either one alone.


5. Agentic AI

This is the next step.

Traditional RAG is usually a fixed pipeline:

Question → retrieve → generate answer

Agentic AI is more flexible.

An AI agent can decide what to do next.

It can:

Understand the goal
→ plan steps
→ search
→ inspect results
→ realize something is missing
→ search again
→ call tools
→ validate information
→ produce an answer

So instead of blindly retrieving once, the agent can reason through the process.

Example:

You ask:

"Compare our current pricing with competitors and suggest changes."

A normal RAG pipeline might search internal docs once and answer.

An agent could:

  1. Search your pricing docs.
  2. Search competitor pricing.
  3. Compare features.
  4. Notice missing information.
  5. Search again.
  6. Use a calculator or spreadsheet.
  7. Produce a structured recommendation.

The key difference is that the agent is not just answering. It is deciding what information it needs and how to get it.


The map looks like this

Keyword Search
= Find exact words
 
Semantic Search
= Find similar meaning
 
RAG
= Retrieve knowledge before answering
 
Advanced RAG
= Improve retrieval quality with reranking, query expansion, and hybrid search
 
Agentic AI
= Let the AI decide what to search, what tools to use, and how to reason through the task

Final point:

The biggest challenge is no longer just generating text.

LLMs are already good at writing answers.

The harder problem is:

How does the AI know what information to look for before answering?

That is why retrieval, memory, tools, and agentic reasoning are becoming so important.