· Early access

Get early access
Copilot Kit Logo
Introducing the LlamaIndex Integration with AG-UI & CopilotKit
By Laurie Voss
June 18, 2025

It’s been a big month for CopilotKit’s AG-UI project, which launched just over a month ago!

Since then, both CopilotKit and AG-UI have seen strong adoption, and today we’re celebrating with a wave of new features and updates. We’re also excited to announce that  LlamaIndex integration is joining the celebration with the launch of their official AG-UI integration!

If you’re just tuning in, AG-UI is a protocol that makes it easy to bring agents out of the backend and into direct interaction with users. The protocol can work with any end-user facing UI – a web app, a desktop application, or any existing chat application. CopilotKit is a first-class client to the protocol, focusing on bringing agents into interaction with users through modern web frontends in React.

Getting started is easy, just pip install the integration:

pip install llama-index-protocols-ag-ui

Then you can create an AG-UI compatible FastAPI router in one line of code! This creates an agent, and provides it with tools that it can use on the frontend or the backend to complete user tasks.

(See the full documentation for deeper explanations when defining these tools.)

agentic_chat_router = get_ag_ui_workflow_router(
	llm=OpenAI(model="gpt-4.1"),
	frontend_tools=[change_background],
	backend_tools=[],
	system_prompt="You are a helpful assistant that can change the background color of the chat.",
	initial_state=None,  # Unused in this example
)

On the frontend, this will allow you to include the CopilotChat React component

import { CopilotChat } from "@copilotkit/react-ui";

Which can then be instantiated to give you simple access to your agent:

return (
    <div className="flex justify-center items-center h-full w-full" style={{ background }}>
      <div className="w-8/10 h-8/10 rounded-lg">
        <CopilotChat
          className="h-full rounded-2xl"
          labels={{ initial: "Hi, I'm an agent. Want to chat?" }}
        />
      </div>
    </div>
  );

CopilotKit works seamlessly with the AG-UI protocol to route user requests to frontend or backend tools to achieve their goals. A lot of messy boilerplate is abstracted away, letting you focus on your business logic and user experience.

Get started today!

We’re delighted to add to AG-UI’s already impressive momentum. If you want to build your own agentic frontend using LlamaIndex and CopilotKit, check out these resources:

Top posts

See All
Switching to Fable 5: The Tuesday That Cost $22,000
Jordan Ritter June 12, 2026
Switching to Fable 5: The Tuesday That Cost $22,000CopilotKit swapped their coding agents to a new model (fable-5) on a Tuesday, and by Wednesday had run up a ~$22,000 Anthropic bill. No bug or runaway script caused it — five engineers doing normal work triggered it, because the new model interpreted their English-prose behavioral rules ("keep sub-agents small," "converge to zero") far more loosely than older models did. The result was four simultaneous drift modes: bloated sub-agents, runaway review loops, exploding fanout, and oversized single turns. What kept it from being far worse was their "skills" system — small, named instruction packs that agents auto-load to encode team conventions. Their instrumentation caught the runaway in 12 hours instead of 12 days, isolated worktrees contained the blast radius, and the fix lived at the rules layer (swapping vague adjectives for hard numeric budgets and machine-checkable gates) rather than in application code. The takeaway: if you let AI agents do real work, you need a guardrails layer that encodes desired behavior separately from the agents — small, composable, and faster to change than a model. Because models will change, and the team with a rules layer pays $22K and writes a blog post; the team without one pays more and writes a press release.
Build AI Agents That Live Inside Your App — CopilotKit Explained
Nathan Tarbert June 12, 2026
Build AI Agents That Live Inside Your App — CopilotKit ExplainedCopilotKit is a complete set of building blocks for developers and teams who want to add agents to their app and assemble, debug, and ship the interface layer between their agents and users. It's also framework-agnostic and supports any LLM and every popular agent framework. There are two options for chat. Pre-built components, if you want something already built or Headless UI, which allows anyone to build custom agent interfaces.
CopilotKit - The Complete Frontend Stack for AI Agents
Anmol Baranwal and Nathan TarbertMay 20, 2026
CopilotKit - The Complete Frontend Stack for AI AgentsCopilotkit is the open source frontend stack for AI agents. Learn about architecture, chat components, hooks, generative UI, persistent memory, debugging tools, and 13+ agent framework integrations for building Agentic UIs.
Are you ready?

Stay in the know

Subscribe to our blog and get updates on CopilotKit in your inbox.