Agentic Search
Using an Agent to iteratively search for information is called Agentic Search and the process of searching, reasoning and responding is known as Agentic RAG.
The model interprets your query, generates relevant keywords and searches its knowledge.
The Agent’s response is only as good as its search. Better search = Better responses
You can use semantic search, keyword search or hybrid search. We recommend using hybrid search with reranking for best in class agentic search.
Because the Agent is searching for the information it needs, this pattern is called Agentic Search and is becoming very popular with Agent builders.
Let’s build some examples to see Agentic Search in action.
Agentic RAG
When we add a knowledge base to an Agent, behind the scenes, we give the model a tool to search that knowledge base for the information it needs.
The Model generates a set of keywords and calls the search_knowledge_base()
tool to retrieve the relevant information or few-shot examples.
Here’s a working example that uses Hybrid Search + Reranking:
You may remove the reranking step if you don’t need it.
Agentic RAG with Reasoning
We can further improve the Agents search capabilities by giving it the ability to reason about the search results.
By adding reasoning, the Agent “thinks” first about what to search and then “analyzes” the results of the search.
Here’s an example of an Agentic RAG Agent that uses reasoning to improve the quality of the search results.