· Early access

Get early access
Copilot Kit Logo

Everything You Need To Build Agent-Native Applications (with LangGraph and CoAgents)

By Atai Barkai
October 22, 2024
Everything You Need To Build Agent-Native Applications (with LangGraph and CoAgents)

Introducing CoAgents: Everything You Need To Build Agent-Native Applications Powered by LangGraph

The building blocks for the next generation of AI-native apps.

Get Started

Introduction

Over the past few months, we’ve seen the emergence of a new type of Agent-Native application, featuring unique UX and AI agents that actually work.

Apps like Replit’s AI Agent and OpenAI’s Canvas combine specialized AI agents, tailored to their specific workflows, with agent-optimized UX to produce the next generation of AI-powered apps.

With LangGraph + CoAgents, any developer can quickly build these types of applications for any vertical. Simply build a LangGraph agent attuned to your workflow, then use CoAgents to deploy it into your application.

Check out our quick tutorial video that demonstrates how to build an agent-native app in just five minutes. This step-by-step guide is perfect for those looking to dive into the world of agent-native applications quickly and effectively.

More details below.

Overview of CopilotKit & CoAgents

CopilotKit is a framework that enables developers to build best-in-class AI copilots into their products. The framework provides React components for AI chat, generative UI, and AI autocomplete, along with a powerful runtime that surfaces context, tools, and skills to an AI agent based on the user’s behavior in the application. It also connects the agent’s output back to the application layer.

Today, we are releasing CoAgents in public beta, containing everything you need to embed specialized AI agents (powered by LangGraph) into your applications, including:

  • Shared State (Agent Application) with support for intermediate state streaming
  • Agentic Generative UI
  • Human-in-the-Loop
  • Realtime frontend actions
  • Agent Steering (LangGraph checkpoints)

Leveraging the LangGraph SDK within CopilotKit, developers can build an agent tailored to a specific use case and then use CoAgents to integrate custom actions and generative UI experiences—all within a clean framework to manage agents inside your application. Let’s walk through each feature set and how it drives action in your AI Agent.

Let’s walk through each feature set below and how it drives action in your AI Agent.

Everything You Need for Agent-Native Apps

The AI Agent

CoAgents is powered by CopilotKit and LangGraph. Use LangGraph to build an agent tailored to your use case, then use CoAgents to integrate it into your application.

For example, a research agent can search for sources, download them, and then use an LLM to determine how to incorporate them into a draft.

LangGraph allows us to easily build an agent with steps and capabilities customized to our use case while providing a clean framework for managing agents inside the application.

__wf_reserved_inherit

Shared State (agent app)

With just a single line of code, your application can see everything the agent is doing, and the agent can observe everything happening inside the application.

This shared state automatically supports intermediate agent state streaming, meaning you can display the agent’s current state to the user, even while it’s in the middle of its process. This is crucial for agent performance and for UX that matches user expectations.

const { state, setState } = useCoAgent("the agent name - you can have several!")

Agent State to the App

With a few lines of code, CoAgents braids together both the state shared between LangGraph nodes and the continuous data streamed from inside those nodes. This data stream is braided into a single continuously updating state object, shared efficiently over the wire. The state object is made available to React applications through a custom hook (useCoAgent).

App State to the Agent

State sharing works in the other direction as well, streaming application state changes back to the agent using a custom setState hook variable.

Interested in how this works under the hood? Read more in the CoAgents documentation.

__wf_reserved_inherit

Agentic Generative UI

Render the agent’s real-time state in the chat UI so the user can see what the agent is doing.

Unlike traditional generative UI, agentic generative UI is based on the agent’s state, rather than on a tool-calling abstraction. This is critical for in-app agents as it provides users with visibility into what the agent is doing which not only prevents them from staring at a blank loading screen while the agent is executing — but also builds trust that the agent is on the right track. (with agent steering, users can bring the agent back on track if they see it’s veered off).

useCoAgentStateRender({
  name: "research_agent",
  node: "download_progress",
  render: ({ state, nodeName, status }) => {
    return <Progress logs={state.logs} />;
  },
});

Human-in-the-Loop

Human-in-the-Loop allows you to specify breakpoints in the agent process at which Human input/approval is required.  This allows for greater safety as well as better agent performance.

Ensure risky actions get cannot be executed without explicit human approval, and allow the human to assist the agent with its planning and execution steps.

useCopilotAction({
  name: "ApprovePlan",
  parameters: [{ name: "planSteps", type: "string[]" }],
  renderAndWait: ({ args, handler }) => (
    <ConfirmPlan 
      planSteps={args.planSteps} 
      onApprove={(approvedSteps) => handler({ approved_steps: approvedSteps })} 
      onDeny={() => handler({ approved_steps: [] })}
    />
  ),
});
__wf_reserved_inherit

Realtime Frontend Actions

CoAgents will provide your agent with the frontend & backend actions available currently, based on user context and what the user is currently doing in the application.

These tool calls are automatically propagated to the frontend/backend as needed, with support for generative UI. The action results are then propagated back to the agent.

Agent Steering (Coming Soon)

Agent steering will allow developers to use LangGraph’s breakpoints, to specify points in the agents process where agent state is saved. CoAgent’s agent steering will allow users to rewind and correct an agent mid-process.

Get Started:

  • Run the demo built here and check out our documentation to build your own agent application with LangGraph.
  • Looking to deploy a CoAgent in production? Contact us here.

Star our GitHub repo to support CopilotKit and stay updated with upcoming CoAgents features!

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.