0PricingLogin
AI Agents · Lesson

Common Tool Sets (Web, Calculator, RAG)

The starter toolbox: search the web, do math, query your knowledge base — covers 80% of demos.

The Starter Toolbox

Three tools cover 80% of agent demos:

  1. web_search — search the public web
  2. calculator — eval math expressions
  3. retrieve — search internal knowledge base (RAG)

Tool 1: Web Search

Use Tavily, Serper, or Brave Search API:

import requests

def web_search(query: str, k: int = 5):
    r = requests.post('https://api.tavily.com/search',
        json={'api_key': TAVILY_KEY, 'query': query, 'max_results': k})
    results = r.json()['results']
    return [
        {'title': r['title'], 'url': r['url'], 'snippet': r['content'][:300]}
        for r in results
    ]

All lessons in this course

  1. ReAct: Reason + Act Pattern
  2. Implementing ReAct from Scratch
  3. Common Tool Sets (Web, Calculator, RAG)
  4. Detecting and Recovering from Tool Errors
← Back to AI Agents