Skip to content

Commit e75d381

Browse files
authored
docs: landing page and nav populated
1 parent 71a19a9 commit e75d381

50 files changed

Lines changed: 1627 additions & 270 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/components/react/integrations.tsx

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,72 @@ const IntegrationCard: React.FC<IntegrationCardProps> = ({
110110
);
111111
};
112112

113-
const IntegrationsGrid: React.FC = () => {
113+
interface IntegrationsGridProps {
114+
targetPage?: string;
115+
suppressDirectToLLM?: boolean;
116+
}
117+
118+
const IntegrationsGrid: React.FC<IntegrationsGridProps> = ({ targetPage, suppressDirectToLLM = false }) => {
119+
const hasTargetPage = (integration: Integration, targetPage: string): boolean => {
120+
// Direct to LLM special cases
121+
if (integration.title === "Direct to LLM") {
122+
return targetPage === "generative-ui" || targetPage === "frontend-actions";
123+
}
124+
125+
// AutoGen2 missing pages
126+
if (integration.title === "AutoGen2") {
127+
return targetPage !== "generative-ui" && targetPage !== "shared-state";
128+
}
129+
130+
// Frameworks that don't have shared-state pages
131+
if (targetPage === "shared-state") {
132+
return !["LlamaIndex", "Mastra", "AutoGen2", "Agno"].includes(integration.title);
133+
}
134+
135+
// All other frameworks have the standard pages
136+
return true;
137+
};
138+
139+
const getHref = (integration: Integration) => {
140+
if (!targetPage) {
141+
return integration.href;
142+
}
143+
144+
// Special cases where certain frameworks have pages in different locations
145+
if (integration.title === "Direct to LLM") {
146+
if (targetPage === "generative-ui") {
147+
return "/direct-to-llm/guides/generative-ui";
148+
}
149+
if (targetPage === "frontend-actions") {
150+
return "/direct-to-llm/guides/frontend-actions";
151+
}
152+
}
153+
154+
// For other frameworks, append the target page
155+
return `${integration.href}/${targetPage}`;
156+
};
157+
158+
let filteredIntegrations = integrations;
159+
160+
// Filter out Direct to LLM if suppressed
161+
if (suppressDirectToLLM) {
162+
filteredIntegrations = filteredIntegrations.filter(integration => integration.title !== "Direct to LLM");
163+
}
164+
165+
// Filter out integrations that don't have the target page
166+
if (targetPage) {
167+
filteredIntegrations = filteredIntegrations.filter(integration => hasTargetPage(integration, targetPage));
168+
}
169+
114170
return (
115171
<div className="flex flex-row flex-wrap justify-center items-center gap-x-6 gap-y-6 my-8">
116-
{integrations.map((integration, index) => (
172+
{filteredIntegrations.map((integration, index) => (
117173
<a
118174
key={index}
119-
href={integration.href}
175+
href={getHref(integration)}
120176
className="flex flex-col items-center gap-3 text-center no-underline group"
121177
>
122-
<div className={`w-16 h-16 flex items-center justify-center rounded-2xl transition-all duration-200 group-hover:scale-105 ${integration.bgGradient}`}>
178+
<div className={`w-12 h-12 flex items-center justify-center rounded-2xl transition-all duration-200 group-hover:scale-105 ${integration.bgGradient}`}>
123179
{integration.logo}
124180
</div>
125181
<span className="text-sm font-medium text-zinc-700 dark:text-zinc-300 group-hover:text-black dark:group-hover:text-white transition-colors duration-200">
@@ -132,3 +188,4 @@ const IntegrationsGrid: React.FC = () => {
132188
};
133189

134190
export { IntegrationCard, IntegrationsGrid, integrations };
191+
export type { IntegrationsGridProps };

docs/components/react/quickstart-dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ export function QuickstartDropdown() {
77
const router = useRouter();
88

99
const options = [
10+
{ label: "Direct to LLM", url: "/direct-to-llm/guides/quickstart", },
1011
{ label: "LangGraph", url: "/coagents/quickstart/langgraph" },
1112
{ label: "Mastra", url: "/mastra/quickstart" },
1213
{ label: "LlamaIndex", url: "/llamaindex/quickstart" },
1314
{ label: "Agno", url: "/agno/quickstart" },
1415
{ label: "CrewAI Flows", url: "/crewai-flows/quickstart/crewai" },
1516
{ label: "CrewAI Crews", url: "/crewai-crews/quickstart/crewai" },
1617
{ label: "AG2", url: "/ag2/quickstart" },
17-
{ label: "Direct to LLM", url: "/direct-to-llm/guides/quickstart", },
1818
];
1919

2020
const handleSelectChange = (event: ChangeEvent<HTMLSelectElement>) => {

docs/components/react/subdocs-menu.tsx

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,30 @@ export function isActive(
4949
nested = true,
5050
root = false
5151
): boolean {
52-
const isActive =
53-
url === pathname || (nested && pathname.startsWith(root ? url : `${url}/`));
54-
return isActive;
52+
// Exact match
53+
if (url === pathname) return true;
54+
55+
// For nested matching
56+
if (nested) {
57+
// Special handling for root URL
58+
if (root && url === "/") {
59+
return pathname === "/";
60+
}
61+
62+
// For non-root URLs, check if pathname starts with the URL followed by a slash
63+
// This ensures /direct-to-llm/guides/quickstart matches /direct-to-llm/guides/frontend-actions
64+
if (url !== "/" && pathname.startsWith(`${url}/`)) {
65+
return true;
66+
}
67+
68+
// Special case for direct-to-llm: if the option URL is /direct-to-llm/guides/quickstart
69+
// and the current path is anywhere under /direct-to-llm/, consider it active
70+
if (url.includes('/direct-to-llm/') && pathname.startsWith('/direct-to-llm/')) {
71+
return true;
72+
}
73+
}
74+
75+
return false;
5576
}
5677

5778
export interface Option {
@@ -324,7 +345,7 @@ function SubdocsMenuItemDropdown({
324345
);
325346

326347
// Check if we're on a page that should reset the dropdown
327-
const topLevelPages = ["/", "/reference", "/quickstart"];
348+
const topLevelPages = ["/", "/reference"];
328349
const shouldResetDropdown = topLevelPages.some(page =>
329350
page === "/" ? pathname === "/" : pathname.startsWith(page)
330351
);
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: Agentic Chat UI
3+
icon: "lucide/MessageSquare"
4+
description: Create intelligent chat interfaces powered by AI agents that can take actions and maintain context.
5+
---
6+
import { IntegrationsGrid } from "@/components/react/integrations";
7+
8+
## What is Agentic Chat UI?
9+
10+
Agentic Chat UI is an intelligent chat interface that goes beyond simple text exchange. It's powered by AI agents that can take actions, maintain context, access application state, and provide interactive experiences within the chat interface itself.
11+
12+
<video src="/images/coagents/agentic-chat-ui.mp4" className="rounded-lg shadow-xl" loop playsInline controls autoPlay muted />
13+
14+
Unlike traditional chatbots that only respond with text, agentic chat interfaces can execute functions, display rich content, and create collaborative experiences between users and AI agents.
15+
16+
<Callout title="Ready to Implement Agentic Chat UI?">
17+
Agentic Chat UI can be implemented with any Agent Framework, with each framework providing different approaches for creating intelligent, action-oriented chat experiences.
18+
19+
**Choose your integration to see framework-specific implementation guides and examples.**
20+
<IntegrationsGrid targetPage="agentic-chat-ui" suppressDirectToLLM />
21+
</Callout>
22+
23+
<div className="grid grid-cols-1 md:grid-cols-2 gap-8">
24+
25+
<div>
26+
27+
28+
## Key Features
29+
30+
### **Agent-Powered Responses**
31+
Messages are generated by intelligent agents that understand context and can take appropriate actions.
32+
33+
### **Interactive Message Components**
34+
Chat messages can contain buttons, forms, visualizations, and other interactive elements.
35+
36+
### **Real-time State Updates**
37+
Chat interface updates in real-time as agents process information and modify application state.
38+
39+
### **Action Execution**
40+
Agents can execute both frontend and backend actions directly from chat interactions.
41+
42+
### **Context Persistence**
43+
Conversation context and agent state persist across sessions and interactions.
44+
45+
### **Multi-modal Communication**
46+
Support for text, images, files, and custom interactive components within the chat.
47+
48+
</div>
49+
50+
<div>
51+
52+
## When to Use Agentic Chat UI
53+
54+
Consider Agentic Chat UI when you want to:
55+
56+
- **Provide natural language interfaces** for complex applications
57+
- **Enable task completion** through conversational interactions
58+
- **Create collaborative experiences** between users and AI
59+
- **Simplify complex workflows** with guided conversations
60+
- **Offer contextual help** that understands current application state
61+
- **Build engaging user experiences** that go beyond traditional forms and menus
62+
- **Provide accessible interfaces** that work well for users of all technical levels
63+
64+
</div>
65+
66+
</div>
67+
68+
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: Backend Actions
3+
icon: "lucide/Server"
4+
description: Enable AI agents to execute server-side operations, access databases, and integrate with external services.
5+
---
6+
import { RocketIcon } from "lucide-react";
7+
8+
## What are Backend Actions?
9+
10+
Backend Actions are server-side functions that AI agents can call to perform operations that require backend resources, such as database queries, API calls, file operations, or complex computations. They extend agent capabilities beyond the frontend to access the full power of your server infrastructure.
11+
12+
Unlike frontend actions that modify UI state, backend actions handle data processing, external integrations, and operations that require server-side security or resources.
13+
14+
<Callout>
15+
**Ready to get started with Backend Actions?**
16+
17+
<div className="flex items-center gap-6">
18+
<div className="flex-shrink-0">
19+
<a
20+
href="/direct-to-llm/guides/backend-actions"
21+
className="flex flex-col items-center gap-1 text-center no-underline group"
22+
>
23+
<div className="w-12 h-12 flex items-center justify-center rounded-2xl transition-all duration-200 group-hover:scale-105 bg-gradient-to-b from-green-700 to-green-400 text-green-100">
24+
<RocketIcon className="w-8 h-8" />
25+
</div>
26+
<span className="text-sm font-medium text-zinc-700 dark:text-zinc-300 group-hover:text-black dark:group-hover:text-white transition-colors duration-200">
27+
Direct to LLM
28+
</span>
29+
</a>
30+
</div>
31+
<div className="flex-1">
32+
<p className="text-base leading-relaxed mb-4">
33+
Backend Actions are primarily designed for Direct to LLM applications, where you need explicit server-side functions that the LLM can call. CopilotKit provides multiple implementation approaches.
34+
</p>
35+
</div>
36+
</div>
37+
</Callout>
38+
39+
<div className="grid grid-cols-1 md:grid-cols-2 gap-8">
40+
41+
<div>
42+
43+
## Common Backend Action Patterns
44+
45+
### **Database Operations**
46+
Actions that create, read, update, or delete data from databases, often with complex queries and relationships.
47+
48+
### **API Integrations**
49+
Actions that call external APIs, process responses, and integrate data from third-party services.
50+
51+
### **File Operations**
52+
Actions that handle file uploads, downloads, processing, or storage operations on the server.
53+
54+
### **Authentication and Authorization**
55+
Actions that manage user authentication, permissions, and access control for sensitive operations.
56+
57+
### **Data Processing**
58+
Actions that perform data transformation, analysis, aggregation, or complex computations.
59+
60+
### **Workflow Orchestration**
61+
Actions that coordinate multiple backend services or trigger complex business processes.
62+
63+
</div>
64+
65+
<div>
66+
67+
## Types of Backend Actions
68+
69+
### **Synchronous Actions**
70+
Actions that execute and return results immediately, suitable for quick database queries or simple API calls.
71+
72+
### **Asynchronous Actions**
73+
Actions that handle long-running operations, often with progress tracking and completion notifications.
74+
75+
### **Streaming Actions**
76+
Actions that return data progressively, useful for real-time updates or large data sets.
77+
78+
### **Batch Actions**
79+
Actions that process multiple items or operations together for efficiency.
80+
81+
### **Transactional Actions**
82+
Actions that ensure data consistency across multiple operations, with rollback capabilities on failure.
83+
84+
</div>
85+
86+
</div>
87+
88+
## When to Use Backend Actions
89+
90+
Consider Backend Actions when agents need to:
91+
92+
- **Access sensitive data** that shouldn't be exposed to the frontend
93+
- **Perform complex queries** across multiple data sources
94+
- **Integrate with external services** requiring server-side authentication
95+
- **Execute business logic** that involves multiple systems
96+
- **Process large amounts of data** efficiently
97+
- **Maintain data consistency** across operations
98+
- **Handle file operations** or media processing
99+
- **Implement security controls** and access management
100+
101+
### **Agent Framework Applications**
102+
103+
Agent frameworks (LangGraph, CrewAI, LlamaIndex, etc.) typically handle backend operations through their native agent architectures rather than explicit backend actions. These frameworks provide their own mechanisms for:
104+
105+
- Tool calling and external service integration
106+
- Database access and data manipulation
107+
- Complex workflow orchestration
108+
- Multi-step reasoning and planning
109+
110+
For agent-based applications, backend functionality is usually implemented as **agent tools** or **framework-specific integrations** rather than CopilotKit backend actions.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Frontend Actions
3+
icon: "lucide/Wrench"
4+
description: Create frontend actions and use them within your agent.
5+
---
6+
import { IntegrationsGrid } from "@/components/react/integrations";
7+
8+
<video src="/images/frontend-actions-demo.mp4" className="rounded-lg shadow-xl" loop playsInline controls autoPlay muted />
9+
<Callout>
10+
This video shows the [coagents starter](https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter) repo with the [implementation](#implementation) section applied to it!
11+
</Callout>
12+
13+
## What is this?
14+
15+
Frontend actions are powerful tools that allow your AI agents to directly interact with and update your application's user interface. Think of them as bridges that connect your agent's decision-making capabilities with your frontend's interactive elements.
16+
17+
## When should I use this?
18+
19+
Frontend actions are essential when you want to create truly interactive AI applications where your agent needs to:
20+
21+
- Dynamically update UI elements
22+
- Trigger frontend animations or transitions
23+
- Show alerts or notifications
24+
- Modify application state
25+
- Handle user interactions programmatically
26+
27+
Without frontend actions, agents are limited to just processing and returning data. By implementing frontend actions, you can create rich, interactive experiences where your agent actively drives the user interface.
28+
29+
<Callout title="Ready to Implement Frontend Actions?">
30+
Frontend actions can be implemented with any Agent Framework, with each framework providing different approaches for connecting agents to your UI.
31+
32+
**Choose your integration to see framework-specific implementation guides and examples.**
33+
<IntegrationsGrid targetPage="frontend-actions" />
34+
</Callout>

0 commit comments

Comments
 (0)