Overview
The@onkernel/ai-sdk package provides Vercel AI SDK-compatible tools for browser automation powered by Kernel. This package exposes a Playwright execution tool that allows LLMs to browse the web, interact with websites, and perform automation tasks through natural language instructions.
With this tool, AI agents can execute Playwright code on Kernel’s remote browsers, enabling powerful browser automation capabilities in your AI-powered applications.
Installation
Install the package along with its peer dependencies:Prerequisites
Before using the AI SDK tool, you’ll need:- Kernel API Key - Obtain from the Kernel Dashboard or the Vercel Marketplace integration
- AI Model Provider - An API key for your chosen LLM provider (OpenAI, Anthropic, etc.)
- Kernel Browser Session - A running browser session created via the Kernel SDK
How It Works
TheplaywrightExecuteTool creates a Vercel AI SDK tool that:
- Accepts natural language instructions from an LLM
- Converts those instructions into Playwright code
- Executes the code on a Kernel remote browser
- Returns the results back to the LLM
Usage with generateText()
The simplest way to use the AI SDK tool is with Vercel’s generateText() function:
Usage with Agent()
For more complex, multi-step automation tasks, use the Vercel AI SDK’s Agent() class. Agents can autonomously plan and execute a series of actions to accomplish a goal:
Tool Parameters
TheplaywrightExecuteTool function accepts the following parameters:
Tool Input Schema
The generated tool accepts the following input from the LLM:Additional Resources
Vercel AI SDK Docs
Official Vercel AI SDK documentation
Kernel SDK Reference
Complete Kernel SDK API reference
Playwright Execution API
Learn more about Kernel’s Playwright execution

