· Dave Brewster (dave@augustdata.ai) · logicunit · 2 min read
Search Logic Unit: Configuring an agent to search the web
Learn how to use search in an agent.
The search tool is a LogicUnit that can be registered with any APU to provide Google search capabilities to that APU. It uses Google site search and must be configured with a cse_id
and a cse_token
.
The full specification for Search
is:
- By default, the
cse_id
andcse_token
are read from the environment variablesCSE_ID
andCSE_TOKEN
. - The
name
, optional and defaults tosearch
, is the name of the LogicUnit. - The
description
is a description of the LogicUnit. This is used by the LLM to determine if this tool is called. The value is optional but hightly recommended. - The
defaultDateRestrict
is an optional parameter that can be used to restrict the search to a specific date range. The value is optional. - The
params
is an optional dictionary of additional parameters that can be passed to the search engine. The value is optional. Theparams
are passed to the Google search engine as its configuration parameters so searches that restrict to a particular domain, etc…, are supported.
The Search
tool will execute the query and return a list of SearchResult
objects. The full specification for SearchResult
is:
These are filled directly from the search with the values returned.
Typically, the Search
tool is used in conjunction with the Browser
tool so the LLM can scrape the contents of the most relavent web pages in the results.