npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@datalayer/agent-runtimes

v0.0.7

Published

<!-- ~ Copyright (c) 2025-2026 Datalayer, Inc. ~ ~ BSD 3-Clause License -->

Readme

Datalayer

Become a Sponsor

🤖 Agent Runtimes

Github Actions Status PyPI - Version

Agent Runtimes is a unified platform for deploying, managing, and interacting with AI agents across multiple protocols and frameworks. It provides both a Python server for hosting agents and React components for seamless integration into web and desktop applications.

🎯 What is Agent Runtimes?

Agent Runtimes solves the complexity of deploying AI agents by providing:

  1. Protocol Abstraction: One agent, multiple protocols - deploy your agent once and access it through ACP, Vercel AI SDK, AG-UI, MCP-UI, or A2A without changing your code.

  2. Framework Flexibility: Write agents using your preferred framework (Pydantic AI, LangChain, Jupyter AI) while maintaining a consistent API.

  3. Cloud Runtime Management: Built-in integration with Datalayer Cloud Runtimes for launching and managing compute resources with Zustand-based state management.

  4. UI Components: Pre-built React components (ChatBase, ChatSidebar, ChatFloating) that connect to agents and execute tools directly in the browser.

  5. Tool Ecosystem: Seamless integration with MCP (Model Context Protocol) tools, custom tools, and built-in utilities for Jupyter notebooks and Lexical documents.

Agent Runtimes

🌟 Features

Multi-Protocol Support

  • ACP (Agent Client Protocol): WebSocket-based standard protocol
  • Vercel AI SDK: Compatible with Vercel's AI SDK for React/Next.js
  • AG-UI: Lightweight web interface (Pydantic AI native)
  • MCP-UI: Interactive UI resources protocol with React/Web Components
  • A2A: Agent-to-agent communication

Multi-Agent Support

  • Pydantic AI: Type-safe agents (fully implemented)
  • LangChain: Complex workflows (adapter ready)
  • Jupyter AI: Notebook integration (adapter ready)

Built-in Features

  • 🔌 Flexible Architecture: Easy to add new agents and protocols
  • 🛠️ Tool Support: MCP, custom tools, built-in utilities
  • 📊 Observability: OpenTelemetry integration
  • 💾 Persistence: DBOS support for durable execution
  • 🔒 Context Optimization: LLM context management

🏗️ Architecture

Agent Runtimes consists of three main components:

1. Python Server (agent_runtimes/)

The backend server that hosts AI agents and handles protocol routing:

  • Agent Adapters: Unified interface for Pydantic AI, LangChain, and Jupyter AI
  • Protocol Adapters: Convert between different agent protocols (ACP, AG-UI, Vercel AI, etc.)
  • FastAPI Server: High-performance async server with automatic API documentation
  • Tool Registry: Manages and executes tools from various sources (MCP, custom, built-in)

2. React Components (src/components/)

Pre-built UI components for interacting with agents:

  • ChatBase: Core chat interface with customizable styling
  • ChatSidebar: Collapsible sidebar for agent interactions
  • ChatFloating: Floating chat widget for non-intrusive agent access
  • All components support: Frontend tool execution, markdown rendering, code highlighting, and real-time streaming

3. Runtime Management (src/runtime/)

Cloud runtime lifecycle management with Zustand store:

  • Launch & Connect: Create new cloud runtimes or connect to existing ones
  • Agent Creation: Automatically create and configure agents on runtimes
  • State Management: Track runtime status, agent connections, and errors
  • Hooks: React hooks for easy integration (useAgentRuntime, useRuntimeStore)

🚀 Use Cases

Notebook AI Assistant

Add an AI agent to Jupyter notebooks that can:

  • Execute cells, insert code, and modify notebook content
  • Explain code and data analysis
  • Debug errors and suggest improvements
import { NotebookAgentsRuntime } from '@datalayer/agent-runtimes';

<NotebookAgentsRuntime
  notebookId={notebookId}
  environmentName="python-simple"
  runtimeName={runtimeName}
  serviceManager={serviceManager}
/>

Document Editor AI

Integrate AI into Lexical-based document editors:

  • Insert headings, lists, code blocks, and formatted text
  • Summarize content and proofread text
  • Generate ideas and help with writing
import { DocumentAgentRuntime } from '@datalayer/agent-runtimes';

<DocumentAgentRuntime
  documentId={documentId}
  environmentName="python-simple"
  runtimeName={runtimeName}
  serviceManager={serviceManager}
/>

Custom Agent Deployment

Deploy your own Pydantic AI agent with custom tools:

from agent_runtimes import AgentRuntimesApp
from pydantic_ai import Agent

# Create your agent
agent = Agent(
    model='anthropic:claude-sonnet-4-5',
    system_prompt='You are a helpful assistant.',
)

# Launch the server
app = AgentRuntimesApp()
app.add_agent(agent, name='my-agent', transport='ag-ui')
app.run(port=8000)

🔧 Key Concepts

Protocols

Agent Runtimes supports multiple protocols for agent communication:

  • AG-UI: Lightweight protocol for web UIs (POST-based, Pydantic AI native)
  • ACP: WebSocket-based Agent Client Protocol for real-time interaction
  • Vercel AI SDK: Compatible with Vercel's AI SDK streaming
  • MCP-UI: Model Context Protocol with UI resources
  • A2A: Agent-to-agent communication protocol

Tools

Tools extend agent capabilities by allowing them to perform actions:

  • Frontend Tools: Execute in the browser (notebook editing, document manipulation)
  • MCP Tools: Tools from Model Context Protocol servers
  • Custom Tools: Your own Python functions decorated with tool metadata
  • Built-in Tools: File operations, web search, code execution
  • Code Mode: Tool discovery includes output_schema and input_examples for reliable calls; code execution returns stdout/stderr and a summarized result.

Runtime Management

Cloud runtimes provide compute resources for agents:

import { useAgentRuntime } from '@datalayer/agent-runtimes/lib/runtime';

const { isReady, endpoint, tools, launchRuntime } = useAgentRuntime({
  autoCreateAgent: true,
  agentConfig: {
    model: 'anthropic:claude-sonnet-4-5',
    systemPrompt: 'You are a helpful AI assistant.',
  },
});

// Launch a new runtime
await launchRuntime({
  environmentName: 'python-simple',
  creditsLimit: 100,
  type: 'notebook',
});