SwarmZero Docs
Main WebsitePricingGitHubDiscordX
  • GETTING STARTED
    • Welcome
    • Developing on SwarmZero
    • Quickstart
    • Key Concepts
      • AI
      • ML
      • LLM
      • AI Agents
      • Swarms
    • Contributing to SwarmZero
  • SDK
    • Agent Kit
    • Agent API Schema
    • Observability
      • Langtrace
      • OpenLIT
      • AgentOps
  • EXAMPLES
    • AI Agents
      • Build a Dune Agent with SwarmZero.ai
      • Build a News Agent with SwarmZero.ai using the GDELT API
      • Build a Uniswap Docs Retrieval Agent with SwarmZero.ai
      • Build an AAVE AI Agent to Lend and Borrow Crypto
      • Build & Monitor a Web Search Agent
      • Build a Multi-Chain Crypto Trading Telegram Bot with SwarmZero, Bitquery and DEXRabbit
    • Swarms
      • AI Researcher Swarm
      • Build a Web3 dApp with a Swarm of AI Agents
      • Livepeer Youtube Video Generator Swarm
    • Tools
      • Tools for Building Agents with Livepeer
      • Tools for Building Agents with Dune
      • YouTube Video Editor & Upload Tools
      • File Operations Tools
Powered by GitBook
LogoLogo

Quick Links

  • Main Website
  • Pricing
  • GitHub
  • Discord

© 2025 SwarmZero Technology Solutions Inc. All rights reserved.

On this page
  • Description
  • Prerequisites
  • Installation
  • Usage
  • Dependencies
  • Learn more

Was this helpful?

  1. EXAMPLES
  2. AI Agents

Build & Monitor a Web Search Agent

A powerful web search agent built using SwarmZero framework that enables intelligent web searching capabilities.

PreviousBuild an AAVE AI Agent to Lend and Borrow CryptoNextBuild a Multi-Chain Crypto Trading Telegram Bot with SwarmZero, Bitquery and DEXRabbit

Last updated 4 months ago

Was this helpful?

Description

This agent utilizes the Tavily API for performing web searches and is built on top of the SwarmZero framework, providing enhanced search capabilities with AI-powered processing.

Prerequisites

  • Python 3.11 or higher

  • Poetry package manager

  • OpenAI API key

Installation

  1. Clone the repository:

git clone https://github.com/swarmzero/examples.git
cd examples/agents/web-search-agent
  1. Install dependencies using Poetry:

poetry install --no-root
  1. Set up environment variables: Create a .env file in the root directory and add your API keys:

TAVILY_API_KEY=your_tavily_api_key_here
AGENTOPS_API_KEY=your_agentops_api_key_here
OPENAI_API_KEY=your_openai_api_key_here

Usage

  1. Activate the Poetry shell:

poetry shell
  1. Run the agent:

poetry run python main.py
  1. Send a message to the agent:

curl -X 'POST' \
  'http://localhost:8000/api/v1/chat' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'user_id=test_user' \
  -F 'session_id=test_web_search_agent' \
  -F 'chat_data={"messages":[{"role":"user","content":"what is swarmzero.ai about?"}]}'
  1. AgentOps will automatically capture the session:

  • View the auto-generated agentops.log file.

Dependencies

  • swarmzero: Main framework for agent development

  • agentops: Agent operations and monitoring

  • tavily-python: Web search API client

Learn more

See the

Visit to learn more about the SwarmZero framework.

Tavily API key
AgentOps API key
AgentOps Dashboard
SwarmZero