Prerequisites
- Python 3.10+
- A Groq API key (free tier available at console.groq.com). Any tool-calling model works.
Build it
1
Install and set your key
2
Create the agent
3
Ask a question whose answer has changed recently
4
Verify it actually searched
Set
verbose=True on the agent while you are developing. You will see the tool calls in the log — if there are none, the model answered from memory and the grounding did not happen.The complete script
Making grounding stick
Three prompt-level habits, in the order they pay off:- Say what to do when the search fails. “If the docs do not cover it, say so” prevents the most common failure — a plausible answer assembled from training data after an empty search.
- Ask for the URL, not just the claim. A cited answer is checkable; an uncited one is not.
- Give it two loops. Search results often need a follow-up fetch before the answer is complete.
Next
- Several servers at once — cross-reference Learn with a repo server in one run.
- Exa web search — when the answer is not in any one vendor’s docs.