Skip to content

New AI assistant answers: ChatGPT, Gemini, Copilot and AI Mode by API

SerpKite
Get API key

Python · serpkite[crewai]

CrewAI + SerpKite

Give your crew live Google search with one import. The official SerpKiteSearchTool ships in the serpkite Python SDK: install the crewai extra and hand the tool to any agent.

Overview

What CrewAI is, and where SerpKite fits

CrewAI runs teams of role-playing agents that collaborate on tasks. Tools are BaseTool instances with a name, a description and an argument schema.

SerpKiteSearchTool is SerpKite's first-party CrewAI tool. It reads SERPKITE_API_KEY, returns compact Markdown the agent can read directly, and can target another vertical (endpoint="news"), country or result count.

Setup

Set it up in 4 steps

  1. 1

    Get an API key

    Sign up (no card), create a key in the dashboard and export it as SERPKITE_API_KEY. New accounts get 2,500 free credits, then 1,000 every month.

    export SERPKITE_API_KEY=skt_live_…
  2. 2

    Install the SDK with the CrewAI extra

    The crewai extra pulls in CrewAI alongside the serpkite SDK.

    pip install -U "serpkite[crewai]"
  3. 3

    Create the tool

    SerpKiteSearchTool() searches Google web results. Pass endpoint, country or num to change the defaults.

  4. 4

    Assign it to an agent and kick off the crew

    Give the tool to the agents that need the web.

Code

Complete example

crew.py
from crewai import Agent, Crew, Task
from serpkite.crewai import SerpKiteSearchTool

search = SerpKiteSearchTool()  # reads SERPKITE_API_KEY
news = SerpKiteSearchTool(endpoint="news", country="us", num=10)

researcher = Agent(
    role="Market researcher",
    goal="Find current, sourced facts about a market",
    backstory="You verify every claim with a web search and cite URLs.",
    tools=[search, news],
)

task = Task(
    description="List the five most-funded AI agent startups this year with sources.",
    expected_output="A Markdown table: company, amount, round, source URL.",
    agent=researcher,
)

print(Crew(agents=[researcher], tasks=[task]).kickoff())

Need more control?

Build your own tool on the SDK

For custom parameters (for example include_content to read top pages, or a fixed location), subclass BaseTool and call the serpkite SDK directly.

Python
from serpkite import SerpKite, SerpKiteError

sk = SerpKite()  # reads SERPKITE_API_KEY


def serpkite_search(query: str, country: str = "us", num: int = 10) -> str:
    """Google search via SerpKite. Returns the results page as compact Markdown."""
    try:
        # format="markdown" returns a str: results, People Also Ask, related searches
        return sk.search(query, country=country, num=num, format="markdown")
    except SerpKiteError as e:
        return f"Search failed: {e.message}"


from crewai.tools import BaseTool
from pydantic import BaseModel, Field


class SearchInput(BaseModel):
    query: str = Field(..., description="What to search Google for")
    country: str = Field("us", description="Two-letter country code, e.g. us, gb, de")


class GoogleSearchTool(BaseTool):
    name: str = "google_search"
    description: str = "Search Google for current information. Returns the top results with links, People Also Ask and related searches as Markdown. Use for recent events, facts and anything after your training cutoff."
    args_schema: type[BaseModel] = SearchInput

    def _run(self, query: str, country: str = "us") -> str:
        return serpkite_search(query, country)

AI assistants

Ask ChatGPT, Gemini and other AI assistants

The serpkite SDK asks ChatGPT, Gemini, Copilot Search, Google AI Mode and Brave's AI answer as a logged-out visitor (sk.chatgpt, sk.gemini, sk.copilot, sk.ai_mode, sk.brave_ai) and returns the answer as Markdown with the sources it cited. Wrap a method with CrewAI's @tool and give it to an agent next to SerpKiteSearchTool. Give the agent a second opinion, or have it check what assistants say about your brand: track adds mentions of the brands and domains you list. See AI assistants.

ChatGPT 4, Gemini 3, Copilot Search 3, Google AI Mode 2 and Brave AI 2 credits per answer; failed, refused and empty answers are free. Brave answers in 1–10 s, ChatGPT in 10–30 s and Gemini in 5–30 s, so allow at least 120 seconds per call.

Python
from crewai import Agent
from crewai.tools import tool
from serpkite import SerpKite, SerpKiteError
from serpkite.crewai import SerpKiteSearchTool

sk = SerpKite()  # reads SERPKITE_API_KEY


@tool("Ask ChatGPT")
def ask_chatgpt(prompt: str) -> str:
    """Ask ChatGPT (logged out, searching the web) and return its answer as Markdown
    with the sources it cited. Use it to see what ChatGPT tells people. Takes 10–30 s."""
    try:
        return sk.chatgpt(prompt=prompt, format="markdown")
    except SerpKiteError as e:
        return f"ChatGPT failed: {e.message}"


analyst = Agent(
    role="AI visibility analyst",
    goal="Find which brands ChatGPT recommends for our category and which sources it cites",
    backstory="You compare what AI assistants answer with what Google ranks.",
    tools=[ask_chatgpt, SerpKiteSearchTool()],
)

FAQ

CrewAI and SerpKite: common questions

Start building

Give your CrewAI project Google search

2,500 free credits, then 1,000 every month. No credit card.