Skip to main content

Integrations

Agent Runtimes provides a flexible agent architecture built on top of Pydantic AI.

Why Pydantic AI?

We chose Pydantic AI as our foundation because it provides:

  • Type Safety — Full type checking with Pydantic models for inputs and outputs
  • Structured Outputs — Reliable JSON responses from LLMs with validation
  • Tool Calling — First-class support for function tools and MCP toolsets
  • Multi-Model Support — Works with Anthropic, OpenAI, Google, Azure, and more
  • Production Ready — Well-tested and actively maintained

Creating an Agent

from pydantic_ai import Agent
from agent_runtimes.mcp import get_mcp_toolsets

# Get pre-loaded MCP toolsets
mcp_toolsets = get_mcp_toolsets()

# Create an agent with MCP tools
agent = Agent(
"anthropic:claude-sonnet-4-20250514",
system_prompt="You are a helpful assistant with access to web search.",
mcp_servers=mcp_toolsets,
)

UI Integration Examples

Notebook AI Assistant

import { NotebookAgentsRuntime } from '@datalayer/agent-runtimes';

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

Document Editor AI

import { DocumentAgentRuntime } from '@datalayer/agent-runtimes';

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

Custom Agent Deployment

from agent_runtimes import AgentRuntimesApp
from pydantic_ai import Agent

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

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

Runtime Lifecycle Management

Use runtime hooks to launch or attach compute resources and auto-create 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.',
},
});

await launchRuntime({
environmentName: 'python-simple',
creditsLimit: 100,
type: 'notebook',
});

Model Providers

Agents can use models from multiple providers:

ProviderModel Format
Anthropicanthropic:claude-sonnet-4-20250514
OpenAIopenai:gpt-4o
Azure OpenAIazure:gpt-4o
AWS Bedrockbedrock:us.anthropic.claude-3-sonnet
Googlegoogle:gemini-1.5-pro

Per-Request Model Selection

Switch models dynamically without restarting:

# Use Claude for complex reasoning
result = await agent.run("Analyze this data...", model="anthropic:claude-sonnet-4-20250514")

# Use GPT-4 for creative tasks
result = await agent.run("Write a poem...", model="openai:gpt-4o")

Future Framework Support

Community-Driven

We're open to expanding support for other agent frameworks based on community feedback:

  • Google ADK — Google's Agent Development Kit
  • LangChain — Popular Python agent framework
  • CrewAI — Multi-agent orchestration
  • AutoGen — Microsoft's agent framework

Share your feedback on which frameworks you'd like to see supported!