Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions integrations/free_web_search/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Free Web Search Integration with CrewAI (v13.0.0)

This example demonstrates how to use [`free-web-search-ultimate`](https://github.com/wd041216-bit/free-web-search-ultimate) as a zero-cost web search tool within CrewAI agents.

## Why free-web-search-ultimate?

Unlike paid search APIs (Tavily, Brave, Exa, SerpAPI), `free-web-search-ultimate` requires **no API key** and **no subscription**. It supports:

- **Multiple engines**: DuckDuckGo, Bing, Google, Brave, Yahoo
- **Content types**: web pages, news articles, images, videos
- **MCP protocol**: compatible with any MCP-enabled client

## Installation

```bash
pip install crewai free-web-search-ultimate==13.0.0
```

## Usage

```python
from crewai import Agent, Task, Crew
from crewai.tools import tool
from free_web_search_ultimate import UltimateSearcher

searcher = UltimateSearcher()

@tool("Web Search")
def web_search(query: str) -> str:
"""Search the web for up-to-date information. No API key required."""
results = searcher.search(query, engine="duckduckgo", max_results=5)
return "\n\n".join([
f"Title: {r['title']}\nURL: {r['url']}\nSnippet: {r['snippet']}"
for r in results
])

researcher = Agent(
role="Research Analyst",
goal="Find accurate, up-to-date information on any topic",
backstory="Expert researcher with access to real-time web search",
tools=[web_search],
verbose=True
)

research_task = Task(
description="Research the latest developments in {topic} and provide a comprehensive summary.",
expected_output="A detailed summary with sources and key findings.",
agent=researcher
)

crew = Crew(agents=[researcher], tasks=[research_task], verbose=True)
result = crew.kickoff(inputs={"topic": "AI agents in 2025"})
print(result)
```

## MCP Server Usage

You can also use `free-web-search-ultimate` as an MCP server with CrewAI's MCP integration:

```bash
# Start the MCP server
python -m free_web_search_ultimate.server
```

## Links

- **PyPI**: https://pypi.org/project/free-web-search-ultimate/
- **GitHub**: https://github.com/wd041216-bit/free-web-search-ultimate
- **Version**: 13.0.0
86 changes: 86 additions & 0 deletions integrations/free_web_search/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
"""
Free Web Search + CrewAI Example (v13.0.0)
Zero-cost, API-key-free web search for CrewAI agents.
"""

from crewai import Agent, Task, Crew
from crewai.tools import tool
from free_web_search_ultimate import UltimateSearcher

searcher = UltimateSearcher()


@tool("Web Search")
def web_search(query: str) -> str:
"""Search the web for up-to-date information using free-web-search-ultimate.

No API key required. Supports DuckDuckGo, Bing, Google, Brave, Yahoo.

Args:
query: The search query string.

Returns:
Formatted search results with titles, URLs, and snippets.
"""
results = searcher.search(query, engine="duckduckgo", max_results=5)
if not results:
return "No results found."
return "\n\n".join([
f"Title: {r['title']}\nURL: {r['url']}\nSnippet: {r['snippet']}"
for r in results
])


@tool("News Search")
def news_search(query: str) -> str:
"""Search for recent news articles using free-web-search-ultimate.

Args:
query: The news search query.

Returns:
Formatted news results with titles, URLs, and publication dates.
"""
results = searcher.search_news(query, max_results=5)
if not results:
return "No news found."
return "\n\n".join([
f"[{r.get('date', 'N/A')}] {r['title']}\nURL: {r['url']}"
for r in results
])


researcher = Agent(
role="Research Analyst",
goal="Find accurate, up-to-date information using free web search",
backstory=(
"You are an expert researcher with access to real-time web search. "
"You use free-web-search-ultimate to find information without any API costs."
),
tools=[web_search, news_search],
verbose=True,
)

research_task = Task(
description=(
"Research the latest developments in {topic}. "
"Use web search to find current information and news. "
"Provide a comprehensive summary with sources."
),
expected_output=(
"A detailed 3-paragraph summary with key findings, "
"recent developments, and relevant source URLs."
),
agent=researcher,
)

crew = Crew(
agents=[researcher],
tasks=[research_task],
verbose=True,
)

if __name__ == "__main__":
result = crew.kickoff(inputs={"topic": "AI agents and MCP protocol in 2025"})
print("\n=== Research Result ===")
print(result)