CopilotKit v1.50
Brand new interfaces, streamlined internals, and no breaking changes
CopilotKit v1.50 is now available. This page gives an overview of what is new, what is coming, and what just stays the same.
Getting Started
Set your CopilotKit version to:
npm install @copilotkit/react-core@latest @copilotkit/react-ui@latest @copilotkit/runtime@latestOverview
CopilotKit v1.50 is a major update. It includes many highly sought after new features, under the hood improvements and simplifications, and extensive improvements to existing core elements:
| Feature | Description |
|---|---|
| useAgent | Superset of useCoAgent with more control, including: Shared State, Time Travel, Multi-Agent Execution and Agent Mutual Awareness |
| Threads and Persistence | Multiple, long running and resumable, agent conversations |
| New Design System | Deeper UX customization |
| Direct to LLM Improvements | Shared state & Additional supported LLMs |
| Zod schema support | Type safe compilation and runtime |
| Simplified Infrastructure | Removal of GraphQL |
| Backwards Compatibility | All CopilotKit v 1.10 compatible apps can be updated to v 1.50 with no required coding changes |
Backwards Compatibility
Everything you’re already using continues to work. v1.50 is fully backwards compatible with client code using v1.10. In fact, as a first step in this pre-release period, we would love for you to start with just rebuilding, and let us know if you run into any problems.
V2 interfaces
As we said above, all of the v1 (or unversioned) hooks continue to work with v1.50. To take advantage of new hooks you’ll use those marked as /v2 (shown below).
You can opt into any of the new developer interfaces or keep using the old ones. Mixing is allowed in the following configurations:
-
New Chat component + old hooks
-
Old components + new hooks
-
New v2 APIs are exposed under a subpath:
import { CopilotChat, useAgent } from "@copilotkit/react-core/v2";
useAgent
The v2 hook useAgent is a proper superset of useCoAgent which gives more control over the agent connection, including:
Shared state
import { useAgent } from "@copilotkit/react-core/v2";
const { agent } = useAgent({ agentId: "my-agent" });
agent.state
agent.setStateTime travel
import { useAgent } from "@copilotkit/react-core/v2";
const { agent } = useAgent({ agentId: "my-agent" });
agent.setMessages()Multi-agent execution
import { useAgent } from "@copilotkit/react-core/v2";
const { agent: langgraph } = useAgent({ agentId: "langgraph" });
const { agent: pydantic } = useAgent({ agentId: "pydantic" });
[langgraph, pydantic].forEach((agent) => {
agent.addMessage({ id: crypto.randomUUID(), role: "user", content: message });
agent.runAgent();
});Agent Mutual Awareness
You can even make agents aware of each other!
import { useAgent } from "@copilotkit/react-core/v2";
const { agent: langgraph } = useAgent({ agentId: "langgraph" });
const { agent: pydantic } = useAgent({ agentId: "pydantic" });
langgraph.setMessages(pydantic.messages)
pydantic.setMessages(langgraph.messages)Coming Soon
v1.50 is available now, with useAgent fully ready. The other features (listed below) will be added as they come out in the near future.
Threads & Persistence
v1.50 delivers support for threaded conversations, with built in thread storage and connection components. Support for development with InMemory or SQLite is provided out of the box.
Thread storage
-
For development:
InMemoryorSQLiteout of the boximport { CopilotRuntime } from "@copilotkit/runtime"; const runtime = new CopilotRuntime({ agents: { default: agent, }, runner: new InMemoryAgentRunner(), // new abstraction for persistence }); -
For production
- Coming soon! - Use Copilot Cloud (managed) or Copilot Enterprise (self hosted) to persist threads to your own databases, get automatic stream reconnection, in-built product analytics.
- 👉 Join the Enterprise Early Access waitlist!
- Coming soon! - Use Copilot Cloud (managed) or Copilot Enterprise (self hosted) to persist threads to your own databases, get automatic stream reconnection, in-built product analytics.
Thread connection
-
Loading a thread
import { CopilotChat } from "@copilotkit/react-core/v2" <CopilotChat threadId="xyz" /> // connects to runtime's runner -
Stream reconnection
import { CopilotChat } from "@copilotkit/react-core/v2" <CopilotChat threadId="xyz" /> // will reconnect if page is reloaded
New Design System
You can continue to use the design system in the v1 interfaces, but v2 provides A full UI overhaul with deeper customization:
- New
CopilotChat,CopilotSidebar,CopilotPopup- Just an import away at
@copilotkit/react-core/v2 - New slot system for flexible overrides
- Much better out-of-the-box markdown rendering
- Just an import away at
- Suggestions API that works cleanly with agents
Zod Schema Support
Many CopilotKit hooks now take Zod schemas, enforcing type safety at both compile and run time.
useHumanInTheLoop- now takes Zod schemasuseFrontendTool- now takes Zod schemasuseRenderToolCall- new dev-experience principles
Simplified Infrastructure
Earlier versions of CopilotKit required GraphQL installation. That is completely removed by the new architecture.
Direct to LLM Improvements
Our direct to LLM integration now supports more models and implements shared state.
BasicAgent - Now with broader model support
import { BasicAgent } from "@copilotkit/runtime"
const runtime = new CopilotRuntime({
agents: {
myBasicAgent: new BasicAgent({
model: "openai/gpt-4o", // much broader model support
prompt: "You are a helpful AI assistant.",
temperature: 0.7,
});
},
});Shared state support
import { useAgent } from "@copilotkit/react-core/v2";
const { agent } = useAgent({agentId: "myBasicAgent"});
const { state, setState } = agent;Sharing Feedback and Getting Help
Find an issue? We'd Love Your Feedback
If you run into anything unexpected:
→ Please raise an issue in the CopilotKit Discord support channel
Your feedback is incredibly valuable at this stage.
Does Your Team Need Help?
If you’re using CopilotKit in a production product or business, we’d love to help.
You can schedule time with the team here:
