Skip to main content

CrewAI tools for Quercle web search and URL fetching

Project description

quercle-crewai

CrewAI tools for Quercle web search and URL fetching.

Installation

uv add quercle-crewai

Or with pip:

pip install quercle-crewai

Quick Start

from quercle_crewai import QuercleSearchTool, QuercleFetchTool

# Initialize tools (uses QUERCLE_API_KEY env var by default)
search = QuercleSearchTool()
fetch = QuercleFetchTool()

# Or with explicit API key
search = QuercleSearchTool(api_key="qk_...")
fetch = QuercleFetchTool(api_key="qk_...")

Standalone Tool Usage

Use the tools directly without any agent:

Search

from quercle_crewai import QuercleSearchTool

search = QuercleSearchTool()

# Basic search
result = search.run(query="What is TypeScript?")
print(result)

# With domain filtering
result = search.run(
    query="machine learning tutorials",
    allowed_domains=["*.edu", "*.org"],
    blocked_domains=["ads.com"],
)

Fetch

from quercle_crewai import QuercleFetchTool

fetch = QuercleFetchTool()

result = fetch.run(
    url="https://docs.python.org/3/whatsnew/3.12.html",
    prompt="Summarize the key new features in bullet points",
)
print(result)

Usage with CrewAI Agents

Basic Agent Setup

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

# Initialize tools
search_tool = QuercleSearchTool()
fetch_tool = QuercleFetchTool()

# Create an agent with Quercle tools
researcher = Agent(
    role="Research Analyst",
    goal="Find and analyze information from the web",
    backstory="You are an expert researcher who finds accurate information.",
    tools=[search_tool, fetch_tool],
    verbose=True,
)

# Create a task
research_task = Task(
    description="Research the latest features in Python 3.13 and summarize them.",
    expected_output="A summary of Python 3.13 features with key highlights.",
    agent=researcher,
)

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

result = crew.kickoff()
print(result)

Multi-Agent Example

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

# Tools
search_tool = QuercleSearchTool()
fetch_tool = QuercleFetchTool()

# Research agent - finds information
researcher = Agent(
    role="Web Researcher",
    goal="Find relevant information from the web",
    backstory="Expert at finding and extracting information from web sources.",
    tools=[search_tool, fetch_tool],
)

# Writer agent - synthesizes information
writer = Agent(
    role="Content Writer",
    goal="Write clear and engaging content based on research",
    backstory="Skilled writer who creates well-structured content.",
)

# Tasks
research_task = Task(
    description="Research the benefits and challenges of remote work in 2024.",
    expected_output="Detailed research findings with sources.",
    agent=researcher,
)

writing_task = Task(
    description="Write a blog post based on the research findings.",
    expected_output="A well-written blog post about remote work.",
    agent=writer,
    context=[research_task],
)

# Create and run crew
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, writing_task],
    verbose=True,
)

result = crew.kickoff()

Configuration

Environment Variable

Set your API key as an environment variable:

export QUERCLE_API_KEY=qk_your_api_key_here

Tool Parameters

Both tools accept these optional parameters:

  • api_key: Your Quercle API key (falls back to QUERCLE_API_KEY env var)
  • timeout: Request timeout in seconds
tool = QuercleSearchTool(
    api_key="qk_...",
    timeout=60.0,
)

Tool Descriptions

QuercleSearchTool

  • Name: quercle_search
  • Description: Search the web and get AI-synthesized answers with citations
  • Arguments:
    • query (required): The search query
    • allowed_domains (optional): List of domains to include (e.g., ["*.edu"])
    • blocked_domains (optional): List of domains to exclude

QuercleFetchTool

  • Name: quercle_fetch
  • Description: Fetch a URL and analyze its content with AI
  • Arguments:
    • url (required): The URL to fetch
    • prompt (required): Instructions for content analysis

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-0.1.0.tar.gz (265.9 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-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for quercle_crewai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b64cd4f9af6b8eaf21f27aef8a85170722e6004eb064ad30da695606c0266a2
MD5 d6f6b24d682108717fd8da93c2bf4873
BLAKE2b-256 7e1e0197de9446909a8bbfb75f1b9957bae26d225f6c6855bdd7b9e6536240b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for quercle_crewai-0.1.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-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quercle_crewai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee8f842dc5dce2d5d3acbaa5f7fbcafd0be2682744029a39ba77b96898acc742
MD5 f8c5e2b71a98b2cfdf64c3632ad2340b
BLAKE2b-256 536c98a97227d1167d1f4ce95d8224fcd1bb023933e39870d436a70c171221aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for quercle_crewai-0.1.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