Agent Development Kit (ADK) Integration

AgentQL integrates with Google's Agent Development Kit (ADK), allowing you to build powerful agents to navigate the web and extract data from any website.

Agent Development Kit (ADK) is an open-source framework from Google for building and deploying AI agents that can interact with the web, tools, and other APIs using the Model Context Protocol (MCP).

Set up AgentQL with ADK

Before you start, get your Google API key and your AgentQL API key.

  1. Install the Agent Development Kit:
terminal
pip install google-adk
  1. Create a new agent project:
terminal
adk create agentql_agent
cd agentql_agent
note

This generates a project structure with an agent.py file, a .env file for API keys, and other necessary files.

  1. Configure the environment variables by adding your API keys to the .env file in your project:
terminal
GOOGLE_API_KEY=<YOUR_GOOGLE_API_KEY>
AGENTQL_API_KEY=<YOUR_AGENTQL_API_KEY>
  1. Set up your agent with AgentQL in your agent.py file:
agent.py
python
import os
from google.adk.agents import Agent
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
from mcp import StdioServerParameters

AGENTQL_API_KEY = os.getenv("AGENTQL_API_KEY")

root_agent = Agent(
    model="gemini-2.5-pro",
    name="agentql_agent",
    instruction="Help users get information from AgentQL",
    tools=[
        MCPToolset(
            connection_params=StdioConnectionParams(
                server_params = StdioServerParameters(
                    command="npx",
                    args=[
                        "-y",
                        "agentql-mcp",
                    ],
                    env={
                        "AGENTQL_API_KEY": AGENTQL_API_KEY,
                    }
                ),
                timeout=300,
            ),
        )
    ],
)
note

Learn more here on how to use the AgentQL MCP server.

Usage

Running your agent

You can run your agent using either of the following commands:

Command-line interface:

terminal
adk run agentql_agent

Web interface:

terminal
adk web --port 8000

Example prompts

Once your agent is running, use this prompt to test it out:

Return the top 20 news articles from https://news.ycombinator.com/

Here are some other examples:

Available tools

  • extract-web-data - Extract structured data from a given 'url', using 'prompt' as a description of actual data and its fields to extract

Your agent will automatically have access to these tools and can use them as needed to complete tasks.

Support

If you have any questions about using AgentQL with ADK:

Examples

Here are some example use cases for AgentQL with ADK:

  • Market Research Agent - Extract product listings, prices, and reviews from e-commerce sites
  • News Aggregator - Collect and summarize articles from multiple news sources
  • Job Search Assistant - Scrape job postings and match them to user preferences
  • Recipe Collector - Extract recipe details including ingredients and instructions from cooking websites