Stop using web search for every little thing in AI agents
Source: Dev.to
The Problem with Web Search in AI Agents
When building AI agents, simple queries like “What’s the price of Bitcoin?” or “Is it raining in London?” often trigger a web‑search tool. The agent spends several seconds browsing, scrapes noisy webpages, and consumes thousands of tokens just to extract a single piece of data. It’s akin to using a bulldozer to pick up a coin—slow, costly, and inefficient.
Introducing @neuledge/graph
To eliminate the overhead of web searches, I created @neuledge/graph, a lightweight lookup tool that lets an agent request a specific “path” to a fact instead of surfing the web.
Example Paths
Weather: cities.tokyo.weather
Stocks: stocks.aapl.quote
Money: currencies.usd.rate.eur
Because the data is pre‑fetched and structured, responses return in under 100 ms with no “Searching…” spinner. The AI appears instantly knowledgeable.
Handling Missing Paths
LLMs sometimes guess incorrect paths (e.g., get_the_weather_of_london). Rather than returning an error, the tool suggests the correct path:
“I don’t have that, but I have
cities.london.weather. Use that instead.”
The agent can then retry with the suggested path, making the overall experience more robust.
Why It Matters
- No multiple API keys – One package replaces separate accounts for weather, finance, and currency services.
- Framework‑agnostic – Works with Vercel AI SDK, LangChain, and other ecosystems.
Current Features
- Live Weather – Coverage for any city worldwide.
- Stock Prices – Real‑time quotes.
- Currency – Over 150 live exchange rates.
- Time & Dates – Time zones and holiday calendars.
All features are open source and free to start. You receive 100 requests per day without needing an API key.
Getting Started
npm install @neuledge/graph
Future Plans
I’m planning to add News and Sports scores next. Suggestions for additional data sources are welcome!