Engineering
How to Add Web Search to a Local LLM Agent
Local agents do not need a full search product to become useful on fresh information. They need a narrow research loop: search, inspect the promising pages, extract relevant evidence, and hand the model a compact prompt with URLs attached.
TinySearch packages that loop as MCP tools. The client asks for research, TinySearch does the retrieval work, and the model answers from the returned evidence instead of improvising from raw webpages.
The important design choice is restraint. Search is only useful when the result fits the model’s context budget and preserves enough source detail to be checked.
A small MCP flow
Use get_current_datetime() before time-sensitive questions, research(query) when the agent needs to discover sources, and scrape_url(url, query) when a page is already known.
That keeps the client routing simple and makes the research layer easy to inspect.
