skills/copilotkit-integrations/references/integrations/agno.md
Agno is a Python agent framework with built-in AG-UI support via AgentOS. The integration is straightforward -- Agno's AGUI interface handles the AG-UI protocol natively.
[project]
dependencies = [
"agno>=1.7.8",
"openai>=1.88.0",
"yfinance>=0.2.63",
"fastapi>=0.115.13",
"uvicorn>=0.34.3",
"ag-ui-protocol>=0.1.8",
"python-dotenv>=1.0.0",
]
from agno.agent.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.yfinance import YFinanceTools
from .tools.backend import get_weather
from .tools.frontend import add_proverb, set_theme_color
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[
# Backend tools -- executed on the server
YFinanceTools(),
get_weather,
# Frontend tools -- executed on the client
add_proverb,
set_theme_color,
],
description="You are a demonstrative agent for Agno and CopilotKit's integration.",
instructions="Format your response using markdown and use tables to display data where possible.",
)
Key patterns:
YFinanceTools() for financial datatools list -- the distinction is handled by the AG-UI adapterimport dotenv
from agno.os import AgentOS
from agno.os.interfaces.agui import AGUI
from src.agent import agent
dotenv.load_dotenv()
# Build AgentOS with the AGUI interface
agent_os = AgentOS(agents=[agent], interfaces=[AGUI(agent=agent)])
app = agent_os.get_app()
if __name__ == "__main__":
agent_os.serve(app="main:app", port=8000, reload=True)
Key patterns:
AgentOS is Agno's application container -- it manages agents and interfacesAGUI(agent=agent) registers the AG-UI interface for the agentagent_os.get_app() returns a FastAPI/ASGI app/agui by defaultimport {
CopilotRuntime,
createCopilotHonoHandler,
InMemoryAgentRunner,
} from "@copilotkit/runtime/v2";
import { HttpAgent } from "@ag-ui/client";
import { handle } from "hono/vercel";
const runtime = new CopilotRuntime({
agents: {
default: new HttpAgent({
url:
(process.env.AGENT_URL || "http://localhost:8000").replace(/\/$/, "") +
"/agui",
}),
},
runner: new InMemoryAgentRunner(),
});
const app = createCopilotHonoHandler({
runtime,
basePath: "/api/copilotkit",
});
export const GET = handle(app);
export const POST = handle(app);
export const PATCH = handle(app);
export const DELETE = handle(app);
Note the URL path is /agui -- this is where Agno's AGUI interface mounts.
export OPENAI_API_KEY="your-openai-api-key-here"
# Or create agent/.env with the key