Skip to content

IntegrationsAgent frameworks

Google ADK

Add a ready-made Artiwright agent to your Google ADK agents, or give your own agents Artiwright's tools.

Google ADK.md

The artiwright Python package gives Google ADK a Artiwright agent: an LlmAgent that builds decks or workbooks with Artiwright, checks them, and saves the finished files as ADK artifacts. Add it to your multi-agent setup next to your other agents, or give Artiwright’s tools to an agent you configure yourself.

  • Python 3.10 or newer (prerequisites). Node.js isn’t needed: the package brings its own.
  • A model API key: a Gemini API key from Google AI Studio, or an OpenAI API key.
pip install "artiwright[adk]"

On first use the package downloads its JavaScript dependencies into ~/.cache/artiwright. To do it ahead of time (for example in a container build), run artiwright-setup.

Put your key in a .env file next to your agent (ADK reads it):

GOOGLE_API_KEY=your-gemini-api-key
MODEL = "gemini-3.8-flash"

Any model your ADK setup supports works; these are inexpensive defaults.

  1. Create an agent folder in the layout ADK’s tools expect:

    decks/
    ├── __init__.py
    ├── agent.py
    └── .env
    decks/__init__.py
    from . import agent
    decks/agent.py
    from artiwright.adk import artiwright_agent
    MODEL = "gemini-3.8-flash" # or LiteLlm(model="openai/gpt-6-luna")
    root_agent = artiwright_agent(
    root="./artiwright-sessions", # Artiwright keeps each session's documents here
    model=MODEL,
    )
  2. Run it with ADK’s web UI, from the folder that contains decks/:

    adk web

    Open the URL it prints, choose decks, and ask:

    Make a three-slide summary of Q3: revenue up 18% to $4.2M, churn down to 2.1%, and a plan for Q4.

  3. Find the file. The finished deck is saved as an ADK artifact (see the Artifacts tab), and under ./artiwright-sessions/<session>/outputs/.

The Artiwright agent works best next to agents that know your facts. Give it a tool that answers questions, such as your retrieval agent wrapped in AgentTool, and let a router hand it the requests for files:

from google.adk.agents import LlmAgent
from google.adk.tools.agent_tool import AgentTool
from artiwright.adk import artiwright_agent
knowledge = LlmAgent(
name="knowledge",
model=MODEL,
instruction="Answer questions from the company knowledge base. Quote numbers exactly.",
tools=[search_knowledge_base], # your own retrieval tool
)
documents = artiwright_agent(
root="/srv/artiwright-sessions",
model=MODEL,
tools=[AgentTool(agent=knowledge)], # the Artiwright agent can ask for facts
instruction="Audience: our leadership team. Keep decks under 12 slides.",
theme="ledger", # or a template path, or {"brand": "#0B5FFF"}
)
root_agent = LlmAgent(
name="router",
model=MODEL,
instruction="Answer questions with the knowledge agent. Hand requests for decks or workbooks to artiwright_agent.",
sub_agents=[knowledge, documents],
)

The full app tutorial builds this into a working web app with a knowledge base of text files.

  • Tools: Artiwright’s MCP tools, started over stdio, with sessions under root.
  • Instructions: the full working loop (plan, build with layouts, render, lint, fix, finalize), plus anything you add in instruction. Add the audience and house style there, not rules that shorten the loop: see instructions that help, and ones that hurt.
  • Sessions: each ADK session gets its own Artiwright session, so follow-up turns (“make the chart a bar chart”) edit the same deck.
  • Artifacts: a successful finalize saves the file as an ADK artifact, which your app serves like any other.
  • Images: rendered slides reach the model as images once, then leave the history, and older tool calls are sent in short form, a few at a time so the model provider’s prompt cache keeps working. That keeps a long deck’s input cost down.

For an agent that builds Excel workbooks, use the spreadsheets skill:

sheets = artiwright_agent(root="/srv/artiwright-sessions", model=MODEL, name="workbook_agent", skill="spreadsheets")

To let users attach a deck, workbook or template (“edit this”, “use our template”), add ADK’s SaveFilesAsArtifactsPlugin to your runner so uploads become artifacts. The Artiwright agent then opens an attachment by its file name; Artiwright edits a copy and keeps everything it doesn’t change.

artiwright_agent(...) takes:

Option Default What it does
root required Folder for sessions and finished files
model required The model, as an ADK model string or object
name "artiwright_agent" The agent’s name
description builds decks (or workbooks, with the spreadsheets skill) What the router reads to decide when to hand over
instruction "" Extra guidance, added to the working guide: audience, house style, length. See what helps and what hurts
tools None Your own tools, for example an AgentTool for facts
theme None Theme for new files: preset name, template path, or {"brand": "#…"}
skill "presentations" "spreadsheets" for workbooks
full_skill True The full working guide as instructions; False for a short one
sandbox True Run the agent’s code in Artiwright’s sandbox

To configure an agent yourself, use the pieces artiwright_agent is made of:

from artiwright.adk import toolset, before_tool, save_outputs, prepare_request, INSTRUCTION
agent = LlmAgent(
name="my_agent",
model=MODEL,
instruction=INSTRUCTION,
tools=[toolset("/srv/artiwright-sessions", theme="spruce")],
before_tool_callback=before_tool, # sessions and attachments
after_tool_callback=save_outputs, # finished files as artifacts
before_model_callback=prepare_request, # images and a shorter history
)
pip says it can’t find a version of mcp

Your Python is older than 3.10, often macOS’s built-in 3.9. Create the virtual environment with a newer Python (prerequisites).

The first request is slow or times out

The first use downloads Artiwright’s JavaScript dependencies. Run artiwright-setup once beforehand. You can also give the tools longer: toolset(root, timeout=300).

Windows: a UnicodeDecodeError with OpenAI models

Set PYTHONUTF8=1 in your environment, as LiteLLM’s documentation advises.