Skip to main content

CrewAI tools for Quercle web search and URL fetching

Project description

quercle-crewai

Quercle web search and fetch tools for CrewAI.

Installation

uv add quercle-crewai
# or
pip install quercle-crewai

Setup

Set your API key as an environment variable:

export QUERCLE_API_KEY=qk_...

Get your API key at quercle.dev.

Quick Start

from crewai import Agent, Task, Crew
from quercle_crewai import QuercleSearchTool, QuercleFetchTool

researcher = Agent(
    role="Research Analyst",
    goal="Find and analyze the latest information",
    backstory="You are an expert research analyst.",
    tools=[QuercleSearchTool(), QuercleFetchTool()],
)

task = Task(
    description="Research the latest developments in AI agents",
    expected_output="A summary of key developments",
    agent=researcher,
)

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

Tools

Tool Description
QuercleSearchTool AI-synthesized web search with citations
QuercleFetchTool Fetch a URL and analyze its content with AI
QuercleRawSearchTool Raw web search results without AI synthesis
QuercleRawFetchTool Raw URL content (markdown/HTML) without AI processing
QuercleExtractTool Extract content chunks relevant to a query from a URL

Direct Tool Usage

Sync

from quercle_crewai import (
    QuercleSearchTool,
    QuercleFetchTool,
    QuercleRawSearchTool,
    QuercleRawFetchTool,
    QuercleExtractTool,
)

# AI-synthesized search
search = QuercleSearchTool()
result = search._run(query="best practices for building AI agents")
print(result)

# Search with domain filtering
result = search._run(
    query="Python documentation",
    allowed_domains=["docs.python.org"],
)

# Fetch and analyze a page with AI
fetch = QuercleFetchTool()
result = fetch._run(
    url="https://en.wikipedia.org/wiki/Python_(programming_language)",
    prompt="Summarize the key features of Python",
)
print(result)

# Raw search results (no AI synthesis)
raw_search = QuercleRawSearchTool()
result = raw_search._run(query="Python web frameworks", format="markdown")
print(result)

# Raw URL content (no AI processing)
raw_fetch = QuercleRawFetchTool()
result = raw_fetch._run(url="https://example.com", format="markdown")
print(result)

# Extract relevant content from a URL
extract = QuercleExtractTool()
result = extract._run(
    url="https://example.com/pricing",
    query="pricing details",
    format="markdown",
)
print(result)

Async

import asyncio
from quercle_crewai import (
    QuercleSearchTool,
    QuercleFetchTool,
    QuercleRawSearchTool,
    QuercleRawFetchTool,
    QuercleExtractTool,
)

async def main():
    # AI-synthesized search
    search = QuercleSearchTool()
    result = await search._arun(query="latest AI agent frameworks")
    print(result)

    # Fetch and analyze with AI
    fetch = QuercleFetchTool()
    result = await fetch._arun(
        url="https://en.wikipedia.org/wiki/TypeScript",
        prompt="What is TypeScript?",
    )
    print(result)

    # Raw search results
    raw_search = QuercleRawSearchTool()
    result = await raw_search._arun(query="Python web frameworks")
    print(result)

    # Raw URL content
    raw_fetch = QuercleRawFetchTool()
    result = await raw_fetch._arun(url="https://example.com")
    print(result)

    # Extract relevant content
    extract = QuercleExtractTool()
    result = await extract._arun(
        url="https://example.com/docs",
        query="authentication setup",
    )
    print(result)

asyncio.run(main())

Custom API Key

search = QuercleSearchTool(api_key="qk_...")
fetch = QuercleFetchTool(api_key="qk_...")
raw_search = QuercleRawSearchTool(api_key="qk_...")
raw_fetch = QuercleRawFetchTool(api_key="qk_...")
extract = QuercleExtractTool(api_key="qk_...")

Agentic Usage

Multi-Agent Crew

from crewai import Agent, Task, Crew
from quercle_crewai import (
    QuercleSearchTool,
    QuercleFetchTool,
    QuercleRawSearchTool,
    QuercleRawFetchTool,
    QuercleExtractTool,
)

search = QuercleSearchTool()
fetch = QuercleFetchTool()
raw_search = QuercleRawSearchTool()
raw_fetch = QuercleRawFetchTool()
extract = QuercleExtractTool()

researcher = Agent(
    role="Web Researcher",
    goal="Find the most relevant and up-to-date information on {topic}",
    backstory="You are a skilled web researcher who finds authoritative sources.",
    tools=[search, fetch, raw_search, raw_fetch, extract],
)

writer = Agent(
    role="Content Writer",
    goal="Write a clear, concise summary of the research on {topic}",
    backstory="You are a technical writer who distills complex topics into readable summaries.",
)

research_task = Task(
    description="Search the web for the latest information about {topic}. "
    "Find the most relevant pages and analyze their content.",
    expected_output="Detailed research findings with sources",
    agent=researcher,
)

writing_task = Task(
    description="Based on the research, write a concise summary about {topic}.",
    expected_output="A well-structured summary in 3-5 paragraphs",
    agent=writer,
    context=[research_task],
)

crew = Crew(agents=[researcher, writer], tasks=[research_task, writing_task])
result = crew.kickoff(inputs={"topic": "WebAssembly in 2025"})
print(result)

API Reference

Tool Parameters
QuercleSearchTool query, allowed_domains?, blocked_domains?
QuercleFetchTool url, prompt
QuercleRawSearchTool query, format?, use_safeguard?
QuercleRawFetchTool url, format?, use_safeguard?
QuercleExtractTool url, query, format?, use_safeguard?

Configuration

Parameter Default Description
api_key QUERCLE_API_KEY env var Your Quercle API key
timeout None Request timeout in seconds

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quercle_crewai-1.0.0.tar.gz (267.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quercle_crewai-1.0.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file quercle_crewai-1.0.0.tar.gz.

File metadata

  • Download URL: quercle_crewai-1.0.0.tar.gz
  • Upload date:
  • Size: 267.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quercle_crewai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 12ce9133e03acea220c0f0fe6a44222febfc35da2a9fdbd7732fe525f88eddb8
MD5 083c8dac77ab37e7ec86bc953cbb587a
BLAKE2b-256 425b8741e0fc1b1aba328e110f1fb708a112aa0aeb5eebadb92219c47fdb69f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for quercle_crewai-1.0.0.tar.gz:

Publisher: publish.yml on quercledev/quercle-crewai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quercle_crewai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: quercle_crewai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quercle_crewai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d3a8fc8c5bca460bc6bdb8379336748bd1291fa069d4c7737fbc75a2fee23fe
MD5 12471c3f4f2767e359fc75b9162ba91e
BLAKE2b-256 eb07ed0c9b3cae28dbcf7335a4f5270aa974148c21d2d12e06afecbe90dd325e

See more details on using hashes here.

Provenance

The following attestation bundles were made for quercle_crewai-1.0.0-py3-none-any.whl:

Publisher: publish.yml on quercledev/quercle-crewai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page