Skip to content

Search Agent

The SearchAgent is a built-in utility in the AI Refinery SDK designed to answer user queries by searching the internet. For example, if asked "Who won the FIFA 2022 World Cup?", the SearchAgent will:

  • search the web via Google,
  • gather relevant information,
  • generate the answer.

This documentation outlines the workflow and configurations needed to use the SearchAgent.

Workflow Overview

The SearchAgent, a subclass of the ResearchAgent, follows a similar workflow with a few key differences. Notably, the SearchAgent standardizes the information source to Google Search and uses predefined query transformation examples. This streamlined approach results in the following workflow components for the SearchAgent:

  1. Query Transformation: Transforms the user query into one or more queries suitable for Google Search.
  2. Retrieval: Conducts a Google Search using the transformed queries and retrieves the most relevant information.
  3. Answer Generation: Uses the retrieved information to generate a detailed answer to the user query.

Usage

As a built-in utility agent in the AI Refinery SDK, you can easily integrate SearchAgent into your project by updating your project YAML file with the following configurations:

  • Add a utility agent with agent_class: SearchAgent under utility_agents.
  • Ensure the agent_name you chose for your SearchAgent is listed in the agent_list under orchestrator.

Quickstart

To quickly set up a project with a SearchAgent, use the following YAML configuration. Note that additional agents can be added per your needs. You can add more agents and retrievers as needed. Refer to the next section for a detailed overview of configurable options for SearchAgent.

utility_agents:
  - agent_class: SearchAgent
    agent_name: My Search Agent # A name that you choose for your search agent. This needs to be listed under orchestrator.

orchestrator:
  agent_list:
    - agent_name: "My Search Agent" # The name you chose for your SearchAgent above.

Template YAML Configuration of SearchAgent

In addition to the configurations mentioned for the example above, the SearchAgent supports several other configurable options. See the template YAML configuration below for all available settings.

agent_class: SearchAgent
agent_name: <name of the agent> # A name that you choose for your SearchAgent
agent_description: <description of the agent> #Optional
config:
# Optional configurations for SearchAgent
  output_style: <"markdown" or "conversational" or "html">  # Optional field
  contexts:  # Optional field
    - "date"
    - "chat_history"
    - "chat_summary"
  llm_config:
  # Optional. Customized llm config (if you want the search agent to use a different LLM than the on in your base config)
    model: <model_name>