Skip to main content

Quercle web search and fetch tools for Google ADK agents

Project description

google-adk-quercle

Quercle web search, fetch, and extraction tools for Google Agent Development Kit (ADK).

Installation

uv add google-adk-quercle
# or
pip install google-adk-quercle

Setup

Set your API key as an environment variable:

export QUERCLE_API_KEY=qk_...

Get your API key at quercle.dev.

Quick Start

from google.adk.agents import Agent
from google_adk_quercle import get_async_quercle_tools

agent = Agent(
    model="gemini-2.0-flash",
    name="research_agent",
    instruction="You are a helpful research assistant. Use the search and fetch "
    "tools to find accurate, up-to-date information.",
    tools=get_async_quercle_tools(),
)

Tools

Tool Description
quercle_search AI-synthesized web search with optional domain filtering
quercle_fetch Fetch a URL and analyze the content with AI
quercle_raw_search Raw web search results (no AI synthesis)
quercle_raw_fetch Raw URL content (no AI analysis)
quercle_extract Extract content relevant to a query from a URL

Direct Tool Usage

Sync

from google_adk_quercle import (
    quercle_search,
    quercle_fetch,
    quercle_raw_search,
    quercle_raw_fetch,
    quercle_extract,
)

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

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

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

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

# Raw page content
result = quercle_raw_fetch(url="https://example.com", format="markdown")
print(result)

# Extract relevant content from a page
result = quercle_extract(
    url="https://en.wikipedia.org/wiki/Python_(programming_language)",
    query="What are Python's main features?",
    format="markdown",
)
print(result)

Async

import asyncio
from google_adk_quercle import (
    async_quercle_search,
    async_quercle_fetch,
    async_quercle_raw_search,
    async_quercle_raw_fetch,
    async_quercle_extract,
)

async def main():
    result = await async_quercle_search(query="latest AI agent frameworks")
    print(result)

    result = await async_quercle_fetch(
        url="https://en.wikipedia.org/wiki/TypeScript",
        prompt="What is TypeScript?",
    )
    print(result)

    result = await async_quercle_raw_search(query="Python web frameworks")
    print(result)

    result = await async_quercle_raw_fetch(url="https://example.com")
    print(result)

    result = await async_quercle_extract(
        url="https://en.wikipedia.org/wiki/TypeScript",
        query="TypeScript type system",
    )
    print(result)

asyncio.run(main())

Custom API Key

from google_adk_quercle import (
    create_quercle_search,
    create_quercle_fetch,
    create_quercle_raw_search,
    create_quercle_raw_fetch,
    create_quercle_extract,
)

search = create_quercle_search(api_key="qk_...")
fetch = create_quercle_fetch(api_key="qk_...")
raw_search = create_quercle_raw_search(api_key="qk_...")
raw_fetch = create_quercle_raw_fetch(api_key="qk_...")
extract = create_quercle_extract(api_key="qk_...")

Agentic Usage

With Google ADK Agent

from google.adk.agents import Agent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.genai import types
from google_adk_quercle import get_async_quercle_tools

agent = Agent(
    model="gemini-2.0-flash",
    name="research_agent",
    instruction="You are a research assistant. Search the web to find "
    "accurate, up-to-date information and analyze relevant pages.",
    tools=get_async_quercle_tools(),
)

session_service = InMemorySessionService()
runner = Runner(agent=agent, app_name="research_app", session_service=session_service)

session = await session_service.create_session(app_name="research_app", user_id="user1")

response = await runner.run_async(
    session_id=session.id,
    user_id="user1",
    new_message=types.Content(
        role="user",
        parts=[types.Part(text="Research the latest developments in WebAssembly")],
    ),
)

for event in response:
    if event.content and event.content.parts:
        print(event.content.parts[0].text)

Sync Agent (with sync tools)

from google_adk_quercle import get_quercle_tools

agent = Agent(
    model="gemini-2.0-flash",
    name="sync_agent",
    instruction="You are a helpful assistant.",
    tools=get_quercle_tools(),
)

Configuration

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

API Reference

Module-Level Tools (use QUERCLE_API_KEY env var)

Function Description
quercle_search(query, ...) AI-synthesized web search
quercle_fetch(url, prompt) Fetch URL + AI analysis
quercle_raw_search(query, ...) Raw web search results
quercle_raw_fetch(url, ...) Raw URL content
quercle_extract(url, query, ...) Extract relevant content from URL
async_quercle_search(query, ...) Async AI-synthesized web search
async_quercle_fetch(url, prompt) Async fetch URL + AI analysis
async_quercle_raw_search(query, ...) Async raw web search results
async_quercle_raw_fetch(url, ...) Async raw URL content
async_quercle_extract(url, query, ...) Async extract relevant content from URL

Factory Functions (custom API key / timeout)

Function Description
create_quercle_search(...) Create a sync search tool
create_quercle_fetch(...) Create a sync fetch tool
create_quercle_raw_search(...) Create a sync raw search tool
create_quercle_raw_fetch(...) Create a sync raw fetch tool
create_quercle_extract(...) Create a sync extract tool
create_async_quercle_search(...) Create an async search tool
create_async_quercle_fetch(...) Create an async fetch tool
create_async_quercle_raw_search(...) Create an async raw search tool
create_async_quercle_raw_fetch(...) Create an async raw fetch tool
create_async_quercle_extract(...) Create an async extract tool
get_quercle_tools(...) Get all 5 sync tools as a list
get_async_quercle_tools(...) Get all 5 async tools as a list

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

google_adk_quercle-1.0.0.tar.gz (142.8 kB view details)

Uploaded Source

Built Distribution

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

google_adk_quercle-1.0.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for google_adk_quercle-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4d5950b964867448a2ed6041e3e7f36333133e4c781ba1a559417f375daf2ec1
MD5 4a0273e6ff53f0aea0995f9a9996196c
BLAKE2b-256 2892b3a00053acc2f0aded14c40e7e5de03999f87f16c0094e281c2a2131922f

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on quercledev/google-adk-quercle

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

File details

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

File metadata

File hashes

Hashes for google_adk_quercle-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfbfa1471539603c1d3f63bfacb3234d8dc9791b0146d49a54204bc73b1cf8d8
MD5 5f4d049f854f59e4c324e1e1e2c99c11
BLAKE2b-256 4027bb031da2292cd9b5615f14485901f43e020177b7d3c1e3a8acb45402d962

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on quercledev/google-adk-quercle

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