Kernel

august

AI ArticlesKernel Team

AI Agent Frameworks: The Top 8 to Use in 2026

The 8 AI agent frameworks worth building on in 2026 — Mastra, LangGraph, CrewAI, Microsoft Agent Framework, OpenAI Agents SDK, Google ADK, Pydantic AI, and Vercel AI SDK — each with a runnable Kernel cloud-browser integration.

An AI agent framework solves the reasoning problem. It gives an LLM a loop, a set of tools, and a way to decide what to do next.

In 2026, most frameworks ship a browser abstraction alongside that loop: a typed interface for navigating pages, clicking elements, and reading content. The browser has become a core tool in an agent's toolset, not an afterthought bolted on later.

An abstraction still needs a real browser behind it. Left to the default, most frameworks either launch a local Chromium process or connect to a Chrome DevTools Protocol endpoint you stand up yourself. Local Chromium works for a quick prototype, but it breaks down once an agent needs to run longer than your laptop stays open, or once more than a handful of sessions run at once.

Kernel is infrastructure built for that specific gap. It runs Chromium in the cloud behind the same interfaces these frameworks already expect, a tool call, a CDP connection, or a computer-use loop, so an agent gets a browser that scales without a rewrite. That includes stealth handling, managed auth, live view, session replay, and observability out of the box.

The eight frameworks below cover the range of approaches teams are building on in 2026, from lightweight tool-calling loops to full computer-use agents. Each one runs on Kernel, so the choice below comes down to how a team wants to structure agent logic, not which browser layer is available to it.

1. Mastra

Language: TypeScript · Best for: JS/TS teams shipping production agents

Mastra is the closest thing to a full-stack agent framework in the TypeScript ecosystem: Agents reason open-endedly about which tools to call, Workflows handle predetermined multi-step pipelines, and the two compose. Around that sit a persistent Memory system, built-in Evals, and a model router that resolves plain strings like openai/gpt-5.1 to the right provider automatically. It's built by the team behind Gatsby.js (Sam Bhagwat, Abhi Aiyer, Shane Thomas), and graduated from Y Combinator's Winter 2025 batch.

The part that matters most here: Mastra ships a first-class Browser capability, not just a generic tool slot — four providers, including a Playwright-based AgentBrowser, all of which accept a cdpUrl. Assign a browser instance directly to an Agent's browser property and it auto-registers the full toolset (navigate, click, type, extract) with zero custom tool code.

With Kernel: point AgentBrowser's cdpUrl at a Kernel session's cdp_ws_url and the agent gets a live cloud browser with zero custom tool code.

import { Agent } from '@mastra/core/agent';
import { AgentBrowser } from '@mastra/agent-browser';
import { Kernel } from '@onkernel/sdk';

const kernel = new Kernel();
const kernelBrowser = await kernel.browsers.create({});
const browser = new AgentBrowser({
  cdpUrl: kernelBrowser.cdp_ws_url,
});

const webAgent = new Agent({
  id: 'web-agent',
  name: 'Web Agent',
  instructions: 'You are a web automation assistant. Use browser tools to navigate websites and complete tasks.',
  model: 'openai/gpt-5.1',
  browser,
});

const result = await webAgent.generate('Go to news.ycombinator.com and return the top story title.');
console.log(result.text);

await kernel.browsers.deleteByID(kernelBrowser.session_id);

2. LangGraph

Language: Python, TypeScript · Best for: complex, stateful, multi-step workflows

LangGraph represents an agent as a StateGraph — nodes and edges over a shared state object — which is what enables its core claims: durable execution that resumes through failures, human-in-the-loop interrupts that pause a run mid-flight, and the ability to mix deterministic, hand-coded steps with LLM-driven ones in the same graph. create_react_agent (used below) is its prebuilt ReAct loop for teams that want those guarantees without hand-building the graph. It's the highest-adoption framework on this list by a wide margin — roughly 71.6 million PyPI downloads in the 30 days before verification — and shipped its stable v1.0 API in October 2025.

With Kernel: wrap Kernel's Playwright execution call in a @tool-decorated function and hand it to a prebuilt ReAct agent.

from langchain_core.tools import tool
from langgraph.prebuilt import create_react_agent
from kernel import Kernel

kernel = Kernel()
browser = kernel.browsers.create()

@tool
def kernel_browser(code: str) -> str:
    """Execute Playwright code in a live Kernel cloud browser. `page`, `context`, and `browser` are in scope."""
    response = kernel.browsers.playwright.execute(id=browser.session_id, code=code)
    return str(response.result)

agent = create_react_agent(
    model="anthropic:claude-sonnet-5",
    tools=[kernel_browser],
)

result = agent.invoke({
    "messages": [{"role": "user", "content": "Go to news.ycombinator.com and return the top story title."}]
})
print(result["messages"][-1].content)

3. CrewAI

Language: Python · Best for: role-based multi-agent teams

CrewAI runs on two complementary primitives: Crews, a cast of agents with roles, goals, and backstories executing tasks via a sequential or hierarchical process, and Flows, event-driven orchestration (@start/@listen/@router decorators over a shared state object) for when you need more precise control. Flows can embed and chain whole Crews, which is what lets CrewAI cover both "team of specialists" and "state machine" without switching frameworks. It's still pulling serious volume for a framework this opinionated — about 13.8 million PyPI downloads in the 30 days before verification.

With Kernel: the @tool decorator turns any function into something a CrewAI agent can call — including one that opens a Kernel browser.

from crewai import Agent, Task, Crew
from crewai.tools import tool
from kernel import Kernel

kernel = Kernel()
browser = kernel.browsers.create()

@tool("Kernel Browser")
def kernel_browser(code: str) -> str:
    """Execute Playwright code in a live Kernel cloud browser to navigate sites and extract data."""
    response = kernel.browsers.playwright.execute(id=browser.session_id, code=code)
    return str(response.result)

researcher = Agent(
    role="Web Researcher",
    goal="Extract accurate information from live websites",
    backstory="An analyst who verifies everything by checking the source directly.",
    tools=[kernel_browser],
)

task = Task(
    description="Go to news.ycombinator.com and report the top story title.",
    expected_output="The title of the top Hacker News story.",
    agent=researcher,
)

Crew(agents=[researcher], tasks=[task]).kickoff()

4. Microsoft Agent Framework

Language: Python, .NET · Best for: enterprise teams already on Azure/Microsoft stack

Microsoft Agent Framework 1.0 shipped in April 2026 as the unification of AutoGen (multi-agent conversation patterns) and Semantic Kernel (enterprise state management, type safety, telemetry) into one production SDK — both predecessors are now in maintenance mode. It organizes around three tiers: Agents (LLM plus tools/MCP servers, with a model-client abstraction spanning Foundry, Anthropic, Azure OpenAI, OpenAI, and more), Harness (a batteries-included agent with planning and context compaction built in), and Workflows (graph-based multi-agent orchestration with checkpointing). Worth a note that "Semantic Kernel" shares half its name with us — no relation, we just liked the word first. Adoption of the new package is still ramping: about 974,000 PyPI downloads in the 30 days before verification, well behind the legacy packages it's replacing.

With Kernel: the @ai_function decorator wraps a typed Python function; point it at Kernel's Playwright execution API the same way.

from typing import Annotated
from agent_framework import ChatAgent, ai_function
from agent_framework.openai import OpenAIChatClient
from kernel import Kernel

kernel = Kernel()
browser = kernel.browsers.create()

@ai_function
def kernel_browser(
    code: Annotated[str, "Playwright code to run; `page`, `context`, `browser` are in scope"]
) -> str:
    """Execute Playwright code in a live Kernel cloud browser."""
    response = kernel.browsers.playwright.execute(id=browser.session_id, code=code)
    return str(response.result)

agent = ChatAgent(
    chat_client=OpenAIChatClient(model_id="gpt-5.1"),
    name="web-agent",
    instructions="You browse the web using the kernel_browser tool.",
    tools=[kernel_browser],
)

result = await agent.run("Go to news.ycombinator.com and return the top story title.")
print(result.text)

5. OpenAI Agents SDK

Language: Python, TypeScript · Best for: lightweight, model-driven agents without heavy orchestration

OpenAI's SDK deliberately ships a small primitive set rather than a full orchestration framework: Agents (an LLM with instructions and tools), Handoffs (one agent delegating to a more specialized agent), and Guardrails (input/output validation that runs in parallel and fails fast). Function tools get automatic schema generation straight from type hints and a docstring — no schema to hand-write. That simplicity is the selling point for teams that don't want to learn a new orchestration paradigm — it pulled around 35.5 million PyPI downloads in the 30 days before verification.

With Kernel: @function_tool turns a typed function into something the agent can call.

from agents import Agent, Runner, function_tool
from kernel import Kernel

kernel = Kernel()
browser = kernel.browsers.create()

@function_tool
def kernel_browser(code: str) -> str:
    """Execute Playwright code in a live Kernel cloud browser to navigate sites and extract data."""
    response = kernel.browsers.playwright.execute(id=browser.session_id, code=code)
    return str(response.result)

agent = Agent(
    name="Web Agent",
    instructions="You browse the web using the kernel_browser tool.",
    tools=[kernel_browser],
)

result = Runner.run_sync(agent, "Go to news.ycombinator.com and return the top story title.")
print(result.final_output)

6. Google ADK

Language: Python, Go, Java, Kotlin, TypeScript · Best for: teams building on Gemini / Vertex AI

LlmAgent is ADK's base building block, composing into template workflow agents (Sequential, Loop, Parallel) or, new in ADK 2.0, full Graph Workflows that mix deterministic code with agentic reasoning nodes along explicit paths. It also spends unusual effort on context management — auto-filtering irrelevant events and summarizing older turns rather than just concatenating strings until the window overflows. It ships in five languages (Python, TypeScript, Go, Java, Kotlin) and deploys unchanged to Cloud Run, GKE, or Google's managed Agent Runtime. It pulled about 18.7 million PyPI downloads in the 30 days before verification.

With Kernel: ADK auto-wraps a plain, docstring-annotated Python function as a tool — no explicit decorator required.

from google.adk.agents import Agent
from kernel import Kernel

kernel = Kernel()
browser = kernel.browsers.create()

def kernel_browser(code: str) -> dict:
    """Execute Playwright code in a live Kernel cloud browser to navigate sites and extract data.

    Args:
        code: Playwright code to run; `page`, `context`, and `browser` are in scope.
    """
    response = kernel.browsers.playwright.execute(id=browser.session_id, code=code)
    return {"result": str(response.result)}

root_agent = Agent(
    name="web_agent",
    model="gemini-2.5-flash",
    instruction="You browse the web using the kernel_browser tool.",
    tools=[kernel_browser],
)

7. Pydantic AI

Language: Python · Best for: type-safe agents with real dependency injection

Pydantic AI's agent loop is built around a composable capabilities system — bundles of tools, hooks, and settings that snap onto an agent, with built-ins for thinking, web search, and MCP. Structured output is enforced through Pydantic validation with an automatic retry loop, and the dependency-injection pattern shown below (RunContext, deps_type) is the same DI discipline FastAPI popularized, applied to tool functions. It's model-agnostic across virtually every major provider. It pulled about 20.5 million PyPI downloads in the 30 days before verification.

With Kernel: pass the Kernel client through as a typed dependency, then reach it from ctx.deps inside the tool.

from pydantic_ai import Agent, RunContext
from kernel import Kernel

kernel = Kernel()
browser = kernel.browsers.create()

agent = Agent('openai:gpt-5.1', deps_type=Kernel)

@agent.tool
def kernel_browser(ctx: RunContext[Kernel], code: str) -> str:
    """Execute Playwright code in a live Kernel cloud browser to navigate sites and extract data."""
    response = ctx.deps.browsers.playwright.execute(id=browser.session_id, code=code)
    return str(response.result)

result = agent.run_sync(
    'Go to news.ycombinator.com and return the top story title.',
    deps=kernel,
)
print(result.output)

8. Vercel AI SDK

Language: TypeScript · Best for: teams that want a primitive, not a framework

The AI SDK is the layer underneath a lot of this list — Mastra's own model routing is built on it. It splits into three surfaces: AI SDK Core (generateText, streamText, unified tool calling across 20+ providers behind one interface), AI SDK UI (framework-agnostic hooks for chat and streaming), and AI SDK Harnesses, a newer piece that gives agent harnesses like Claude Code a uniform API. Reporting from mid-2026 put it over 16 million weekly npm downloads on the core ai package alone.

With Kernel: this one doesn't need a hand-rolled tool — Kernel publishes @onkernel/ai-sdk, a ready-made Playwright execution tool for the AI SDK.

import { openai } from '@ai-sdk/openai';
import { playwrightExecuteTool } from '@onkernel/ai-sdk';
import { Kernel } from '@onkernel/sdk';
import { generateText } from 'ai';

const kernel = new Kernel();
const browser = await kernel.browsers.create({});

const result = await generateText({
  model: openai('gpt-5.1'),
  prompt: 'Go to news.ycombinator.com and return the top story title.',
  tools: {
    playwright_execute: playwrightExecuteTool({ client: kernel, sessionId: browser.session_id }),
  },
});
console.log(result.text);

await kernel.browsers.deleteByID(browser.session_id);

At a glance

FrameworkLanguage(s)ArchitectureAdoption signal (verified Aug 5, 2026)Kernel integration
MastraTypeScriptAgents + Workflows, memory, evals, native Browser capabilityBuilt by ex-Gatsby founders, YC W25AgentBrowser({ cdpUrl }) — native
LangGraphPython, TSStateGraph: nodes/edges over shared state, durable execution~71.6M PyPI downloads/month@toolcreate_react_agent
CrewAIPythonCrews (role-based) + Flows (event-driven state machine)~13.8M PyPI downloads/month@tool decorator
Microsoft Agent FrameworkPython, .NETAgents + Harness + graph Workflows; successor to AutoGen + Semantic Kernel~974K PyPI downloads/month (new pkg, shipped Apr 2026)@ai_function decorator
OpenAI Agents SDKPython, TSAgents + Handoffs + Guardrails; minimal primitives~35.5M PyPI downloads/month@function_tool decorator
Google ADKPython, Go, Java, Kotlin, TSLlmAgent + workflow/graph orchestration; managed context~18.7M PyPI downloads/monthPlain function, auto-wrapped
Pydantic AIPythonComposable capabilities + typed dependency injection~20.5M PyPI downloads/month@agent.tool + RunContext
Vercel AI SDKTypeScriptCore / UI / Harnesses; provider-agnostic primitives16M+ weekly npm downloads (core package)@onkernel/ai-sdk (official)

PyPI figures are 30-day download counts pulled from pypistats.org on August 5, 2026. npm figures for Mastra and the Vercel AI SDK are less directly comparable — package-splitting across scoped packages makes a single canonical number hard to pin down — so we've used qualitative signals for Mastra and a range from public reporting for the AI SDK instead of forcing a false apples-to-apples comparison.

LangGraph vs CrewAI

LangGraph and CrewAI get compared constantly, and the overlap is real — both coordinate multiple steps toward a goal — but they start from opposite ends of the abstraction stack. CrewAI starts high: you describe a team of agents by role, goal, and backstory, hand them tasks, and let a Crew run them sequentially or hierarchically. LangGraph starts low: you wire an explicit graph of nodes and edges over a shared state object and decide exactly how control moves between them.

That difference in altitude drives the rest of the trade-offs:

  • Control vs. speed to first run. LangGraph gives deterministic control over every transition — the right tool for branching logic, retries, and mixing hand-coded steps with LLM-driven ones. CrewAI stands up a working multi-agent team with far less scaffolding, and only exposes that lower-level control when you drop into Flows (@start/@listen/@router).
  • Durability. LangGraph's headline features — durable execution that resumes through failures, human-in-the-loop interrupts that pause a run mid-flight, and checkpointing — are built for long-running, resumable, reviewable workflows. CrewAI's strength is orchestrating role-based collaboration, not surviving a crash three hours into a run.
  • Language reach. LangGraph ships in Python and TypeScript; CrewAI is Python-only.
  • Adoption. LangGraph pulls roughly 71.6M PyPI downloads a month to CrewAI's ~13.8M — a gap that mostly reflects LangGraph's head start and breadth rather than fitness for any single job.

Rule of thumb: reach for CrewAI when the problem is naturally a team of specialists and you want it running today; reach for LangGraph when the problem is a stateful, multi-step workflow that needs explicit control, resumability, or human review — or when you're working in a TypeScript codebase.

For the browser layer, the pick is a wash: both hand the agent a @tool that calls kernel.browsers.playwright.execute(), so either framework drives the same live Kernel browser — the decision comes down to how you want to structure agent logic, not the browser underneath.

Why the browser layer works the same way for all eight

Seven of the eight snippets above do the same thing under the hood: hand the agent a tool, and the tool calls kernel.browsers.playwright.execute() against a live Kernel browser. Mastra's does something slightly cleaner — it hands its native AgentBrowser a cdpUrl and skips the custom tool entirely — but it's landing on the same underlying mechanism. That's one of four ways to drive a Kernel session: Playwright execution (used above), a direct CDP connection (chromium.connectOverCDP(browser.cdp_ws_url), or Mastra's cdpUrl, works with Playwright, Puppeteer, or any CDP client), WebDriver BiDi, and OS-level computer use (screenshot/click/type primitives, the right fit for computer-use models specifically).

Which one you reach for depends on the agent, not the framework. If a framework's tool or native browser abstraction already knows how to run Playwright or Puppeteer code, point it at Kernel's cdp_ws_url and nothing else changes. If it's emitting computer-use actions, Kernel's computer controls API speaks that language natively. The framework decides how your agent thinks; Kernel is where the browser lives.

more articles

view all