New Tool Radar

AI Agents & Automation

How to Add a Web Search Tool to a Langflow Agent

Enable Tool Mode on a Web Search component in Langflow and connect it to the Agent component so the agent can look up current facts.

Schematic diagram with three steps: Add Web Search component, Enable Tool Mode, then Ask a current-events question.

An agent without a search tool can only answer from its training, so questions about anything recent get guessed answers. A Web Search component in Tool Mode gives the Langflow agent a way to look the fact up before it answers.

Before you start

You need a working Langflow agent flow with Chat Input, Agent and Chat Output connected. Note the model the Agent component uses, because the tool result is only as good as the model reading it.

Add the Web Search component and turn on Tool Mode

Add a Web Search component to the flow and click it to expose its header menu, then enable Tool Mode. Connect its Toolset port to the Tools port on the Agent component. Do the same for a URL component if the agent should also open a page it finds.

Test with a question only search can answer

In the Playground, ask a question whose answer changed recently, for example the result of an event from the last week. Check the reply names a source the search returned. If the agent answers from memory instead, ask it to search first, or tighten the agent instructions to require a search for recent facts.

Worked example: Three questions for a fictional news desk agent

Maple News is a fictional news desk. Its Langflow agent has a Web Search tool. The table shows which questions need the tool.

Question Needs web search? Why
Who won the match yesterday? Yes The result is newer than the model training
What is the capital of Norway? No A stable fact the model already knows
What did the mayor announce today? Yes The announcement is from today

Expected result (UNTESTED): the two recent questions produce replies that cite search results, and the stable fact is answered without a search. We checked the Langflow agents documentation, which describes enabling Tool Mode and connecting the Toolset port to the Agent, but we did not run the test on a live Langflow instance.

Limits

Web search returns what the search returns, including wrong or stale pages, so the agent still needs to check the source before quoting it. Search results also cost a call on top of the model call. For facts that must be exact, give the agent a trusted source to open, not an open search.

Sources

See all