Loading...
const hits = await grep('handleLogin');
return agent.answer(question, hits);let query = 'handleLogin';
for (let i = 0; i < 5; i++) {
const hits = await grep(query);
const step = await agent.review(question, hits);
if (step.done) return step.answer;
query = step.nextQuery;
}Agentic search feeds each result back to the agent, which refines the next 'grep' query until it has enough context instead of answering from one search.
Usually, yes. Each extra search adds a model call and a tool call, so it suits harder questions more than simple lookups.
Commonly web search, file search, database queries or a vector index, exposed as tools the agent can call.
When one retrieval step reliably finds the answer, such as FAQ or docs lookup. It is faster and cheaper than an agent loop.