▶️ Watch the video tutorial (8 minutes)
Our agent can look up orders, search the knowledge base, and hold real conversations. But ask it "is FedEx having delays right now?" and it has nothing useful to say. Our knowledge base covers our policies, not things that change by the minute. Shipping carrier delays, current product availability, outage pages. The agent either guesses or admits it doesn't know.
In this episode we fix that by giving the agent access to the live web. The SDK ships with two provider tools: WebSearch to find information online and WebFetch to read a specific page. The provider handles the actual searching, so we just configure which domains to allow and how many results to return.
I add WebSearch to the support agent, cap it at five results, and lock the allow list down to shipping carriers. That allow list is the part you don't skip. Without it the agent could browse anywhere on the internet and hand whatever it finds back to a customer. I also update the instructions so the agent stays transparent about where its answer came from, our official policy versus something it pulled off the web.
Then I test it. I ask about an order that shipped via FedEx with no tracking update, and the agent checks both the order and FedEx's status. I ask how long USPS Priority Mail takes, and it returns the current answer instead of guessing from training data that might be months old. I also show how to bias results by location if your customers are in a specific region.
One note: WebFetch is currently supported on Anthropic and Gemini. Since this series runs on OpenAI, we stick with WebSearch, which handles the use case fine.
That gives the agent five tools: order lookup, customer history, knowledge base search, document search, and now live web search. It can answer from our database, our documentation, and the live web.
Next episode we add the production infrastructure. Queued responses, provider failover, and middleware for logging and rate limiting. The stuff that keeps this running at 2am when you're asleep.