IntegrationsAgent frameworks
Google ADK
Add a ready-made Artiwright agent to your Google ADK agents, or give your own agents Artiwright's tools.
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.
Prerequisites
Section titled “Prerequisites”- 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.
Install
Section titled “Install”pip install "artiwright[adk]"ADK reaches OpenAI models through LiteLLM:
pip install "artiwright[adk]" "litellm>=1.84"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.
Set your model
Section titled “Set your model”Put your key in a .env file next to your agent (ADK reads it):
GOOGLE_API_KEY=your-gemini-api-keyMODEL = "gemini-3.8-flash"Put your key in a .env file next to your agent:
OPENAI_API_KEY=your-openai-api-keyfrom google.adk.models.lite_llm import LiteLlm
MODEL = LiteLlm(model="openai/gpt-6-luna")Any model your ADK setup supports works; these are inexpensive defaults.
Minimal example
Section titled “Minimal example”-
Create an agent folder in the layout ADK’s tools expect:
decks/├── __init__.py├── agent.py└── .envdecks/__init__.py from . import agentdecks/agent.py from artiwright.adk import artiwright_agentMODEL = "gemini-3.8-flash" # or LiteLlm(model="openai/gpt-6-luna")root_agent = artiwright_agent(root="./artiwright-sessions", # Artiwright keeps each session's documents heremodel=MODEL,) -
Run it with ADK’s web UI, from the folder that contains
decks/:adk webOpen 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.
-
Find the file. The finished deck is saved as an ADK artifact (see the Artifacts tab), and under
./artiwright-sessions/<session>/outputs/.
Add it to your multi-agent setup
Section titled “Add it to your multi-agent setup”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 LlmAgentfrom google.adk.tools.agent_tool import AgentToolfrom 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.
What the Artiwright agent does
Section titled “What the Artiwright agent does”- 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.
Workbooks
Section titled “Workbooks”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")Files your users attach
Section titled “Files your users attach”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.
Options
Section titled “Options”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 |
Your own agent
Section titled “Your own agent”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)Troubleshooting
Section titled “Troubleshooting”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.