Skip to content

docs: updates quickstart on crew flow - #1928

Merged
suhasdeshpande merged 6 commits into
mainfrom
suhas/crew-flow-ent-doc
Jun 6, 2025
Merged

suhasdeshpande merged 6 commits into
mainfrom
suhas/crew-flow-ent-doc

Conversation

@suhasdeshpande

@suhasdeshpande suhasdeshpande commented Jun 4, 2025 •

Copy link
Copy Markdown
Contributor
  • updates quick-start around Crew Flow (enterprise version, i.e flow deployed on CrewAI Enterprise
  • CLI shadcn registry template that allows conversation with Flow (basic example)

Summary by CodeRabbit

  • New Features

    • Introduced a quickstart chat UI example for integrating CopilotKit with CrewAI Flows on CrewAI Enterprise.
    • Added support for dynamic background changes in the chat interface, triggered by AI actions.
  • Documentation

    • Streamlined and simplified the quickstart guide for easier onboarding, focusing on Copilot Cloud integration and a comprehensive React example.

…Agents starter repo option to focus on CrewAI Enterprise flows - Eliminate Cloud vs Self-hosted choice, use Cloud only - Streamline code along path with simple component example - Add complete working CrewAI Flow component with background action - Move Copilot Cloud connection step to beginning for clarity - Update gif reference to crewai-flow-cpk-setup.gif
…wai-flows to registry.json - Add crewai flows page component with background action - Add public registry file for crewai flows - Add crewai-flow-cpk-setup.gif for documentation
@vercel

vercel Bot commented Jun 4, 2025 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ag2-feature-viewer 🛑 Canceled (Inspect) Jun 6, 2025 3:32pm
ag2-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 3:32pm
coagents-starter-crewai-flows 🛑 Canceled (Inspect) Jun 6, 2025 3:32pm
copilot-kit 🛑 Canceled (Inspect) Jun 6, 2025 3:32pm
copilot-kit-qd8p ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 3:32pm
copilot-kit-wq8x 🛑 Canceled (Inspect) Jun 6, 2025 3:32pm
copilot-mastra-starter 🛑 Canceled (Inspect) Jun 6, 2025 3:32pm
copilotkit-feature-viewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 3:32pm
copilotkit-mastra-feature-viewer 🛑 Canceled (Inspect) Jun 6, 2025 3:32pm
demo-viewer 🛑 Canceled (Inspect) Jun 6, 2025 3:32pm
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 3:32pm
examples-coagents-ai-travel-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2025 3:32pm
examples-coagents-research-canvas-ui 🛑 Canceled (Inspect) Jun 6, 2025 3:32pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
examples-coagents-ai-researcher-ui ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2025 3:32pm

@coderabbitai

coderabbitai Bot commented Jun 4, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The quickstart documentation for integrating CrewAI Flows with CopilotKit was rewritten to provide a more streamlined onboarding experience, focusing on Copilot Cloud integration and a complete React example. New registry files and a React component were added to serve as a functional quickstart chat UI with dynamic background changes triggered by AI actions.

Changes

Files/Groups Change Summary
docs/content/docs/crewai-flows/quickstart.mdx Rewrote and simplified the quickstart guide, focusing on Copilot Cloud integration, removing branching instructions, and providing a complete React example for CrewAI Flow chat with dynamic background changes.
registry/public/r/coagents-starter-crewai-flows.json,
registry/registry.json
Added a new registry page "coagents-starter-crewai-flows" with metadata, dependencies, and file mappings for the quickstart example. Updated the registry JSON to include the new page entry.
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx Introduced a new React component implementing a chat UI using CopilotKit, supporting dynamic background changes via Copilot actions. The component checks for required environment variables and throws an error if missing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ReactApp
    participant CopilotKitProvider
    participant CopilotChat
    participant CrewAI Flow (via Copilot Cloud)

    User->>ReactApp: Loads CrewAIFlow component
    ReactApp->>CopilotKitProvider: Initializes with publicApiKey and agent
    ReactApp->>CopilotChat: Renders chat UI
    User->>CopilotChat: Sends message
    CopilotChat->>CrewAI Flow (via Copilot Cloud): Forwards message
    CrewAI Flow (via Copilot Cloud)->>CopilotChat: Responds (may include action)
    CopilotChat->>ReactApp: Triggers Copilot action (e.g., change_background)
    ReactApp->>ReactApp: Updates UI (background color/gradient)
    CopilotChat->>User: Displays AI response
Loading

Suggested labels

preview

Suggested reviewers

  • mme
  • tylerslaton
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1)

21-34: Consider improving the action parameter validation.

The change_background action accepts any string but the description mentions it should accept CSS background values. Consider adding basic validation to prevent XSS or invalid CSS.

-    handler: ({ background }) => setBackground(background),
+    handler: ({ background }) => {
+      // Basic validation to ensure it's a reasonable CSS value
+      if (typeof background === 'string' && background.length < 500) {
+        setBackground(background);
+      }
+    },
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ab85379 and 0b3b284.

⛔ Files ignored due to path filters (1)
  • docs/public/images/copilot-cloud/crewai-flow-cpk-setup.gif is excluded by !**/*.gif
📒 Files selected for processing (4)
  • docs/content/docs/crewai-flows/quickstart.mdx (2 hunks)
  • registry/public/r/coagents-starter-crewai-flows.json (1 hunks)
  • registry/registry.json (1 hunks)
  • registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1)
CopilotKit/packages/react-core/src/components/copilot-provider/copilotkit.tsx (1)
  • CopilotKit (53-64)
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: Test (18.x)
  • GitHub Check: Build Images (coagents-qa-text, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-qa-native, ui)
  • GitHub Check: Build Images (coagents-qa-native, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-qa-text, ui)
  • GitHub Check: Build Images (coagents-qa-text, agent, js, local-deps)
  • GitHub Check: Build Images (coagents-research-canvas, ui)
  • GitHub Check: Build Images (coagents-research-canvas, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-routing, ui)
  • GitHub Check: Build Images (coagents-routing, agent, python, local-deps)
  • GitHub Check: Build Images (next-openai, next-openai)
  • GitHub Check: Test (20.x)
🔇 Additional comments (5)
registry/registry.json (1)

298-312: LGTM! Registry entry follows established patterns.

The new registry item is properly structured with appropriate dependencies and file mappings, consistent with other registry entries.

registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1)

57-61: LGTM! Clean component architecture.

The separation of Chat and CrewAIFlow components provides good modularity and the CopilotKit provider setup is correct.

registry/public/r/coagents-starter-crewai-flows.json (1)

1-19:

Details

✅ Verification successful

Verify consistency with source component.

The inline component content should match the source file. The structure and metadata look correct for a registry item.

Let me verify the inline content matches the source component:


🏁 Script executed:

#!/bin/bash
# Description: Compare the inline content with the source file

# Extract the content from the JSON file and compare with source
echo "Checking if registry JSON content matches source file..."

# Get the source file content
if [ -f "registry/quickstarts/coagents-starter-crewai-flows/page.tsx" ]; then
    echo "Source file exists"
    # Note: Full comparison would need JSON string unescaping, 
    # but basic structure check shows it should match
else
    echo "Source file missing"
fi

# Verify registry structure
jq '.files[0].path' registry/public/r/coagents-starter-crewai-flows.json

Length of output: 381


Let’s locate the actual source file and verify that its content matches the JSON inline content.


🏁 Script executed:

#!/bin/bash
echo "➡️ Searching for the CrewAIFlow component definition..."
rg -n "const CrewAIFlow" -t tsx || echo "⚠️ CrewAIFlow component not found"

echo
echo "➡️ Searching for the unique chat label snippet..."
rg -n "Hi, I'm an agent. Want to chat?" -t tsx || echo "⚠️ Snippet not found"

echo
echo "➡️ Listing all page.tsx files for inspection..."
fd page.tsx

Length of output: 6121


Let’s inspect the source file’s beginning to confirm it matches the JSON inline content:


🏁 Script executed:

#!/bin/bash
echo "➡️ Showing first 30 lines of the source component:"
sed -n '1,30p' registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx
echo
echo "➡️ Looking for the gradient default in useState:"
grep -n "useState(" -A2 registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx

Length of output: 1600


✅ Registry JSON content matches the source component.

The inline code in registry/public/r/coagents-starter-crewai-flows.json is identical to the source at registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx. No discrepancies were found.

docs/content/docs/crewai-flows/quickstart.mdx (2)

48-48: LGTM! Updated prerequisites are clear and specific.

The requirement for CrewAI Enterprise deployment provides clear direction for users and the example link is helpful.


113-121: Good addition of visual guidance.

The step-by-step Copilot Cloud setup with a GIF demonstration will significantly improve user onboarding experience.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
suhasdeshpande and others added 2 commits June 6, 2025 08:20
…ge.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@changesets-bot-copilotkit

Copy link
Copy Markdown

⏭️ Changeset Not Required

Latest commit: a311623

No changes in this PR affected the @copilitkit/* packages. Merging this PR will not cause a version bump for any packages.

Changeset is not required for this PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1)

7-7: Remove or update the file path comment.

The comment contains the file path which may become outdated if the file is moved.

Consider removing or making it more generic:

-// registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx
+// CrewAI Flow quickstart component
docs/content/docs/crewai-flows/quickstart.mdx (1)

158-164: Consider environment variable validation.

While the documentation shows default values for environment variables, consider mentioning that users should validate these are set in production environments to avoid issues.

Add a note about environment variable validation:

const publicApiKey = process.env.NEXT_PUBLIC_COPILOT_API_KEY || "";
/**
 * AgentName refers to the Crew Flow Agent you have saved via CLI during setup.
 * It is used to identify the agent you want to use for the chat.
+ * Note: Ensure these environment variables are properly set in your deployment.
 */
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b3b284 and a311623.

📒 Files selected for processing (2)
  • docs/content/docs/crewai-flows/quickstart.mdx (2 hunks)
  • registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx

[error] 87-87: Illegal duplicate default export declarations

multiple default exports are erroneous

the module's default export is first defined here

(parse)


[error] 36-36: This variable is used before its declaration.

The variable is declared here:

(lint/correctness/noInvalidUseBeforeDeclaration)


[error] 81-81: Shouldn't redeclare 'CrewAIFlow'. Consider to delete it or rename it.

'CrewAIFlow' is defined here:

(lint/suspicious/noRedeclare)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test (18.x)
  • GitHub Check: Test (20.x)
🔇 Additional comments (6)
registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx (2)

13-34: Environment variable validation looks good.

The component now properly handles missing environment variables with a user-friendly error message instead of throwing at module level, which addresses the previous concern about build/SSR crashes.


38-78: Well-structured Chat component with dynamic background feature.

The Chat component implementation is clean and well-documented. The useCopilotAction for dynamic background changes provides a nice interactive feature for the quickstart example.

docs/content/docs/crewai-flows/quickstart.mdx (4)

48-48: Clear prerequisite documentation.

The updated prerequisite clearly specifies the need for a deployed CrewAI Flow on CrewAI Enterprise and provides a helpful link to an example implementation.


113-121: Improved setup flow with visual guidance.

The new Copilot Cloud connection step is much clearer than previous complex setup instructions. The inclusion of the GIF provides valuable visual guidance for users.


132-141: Simplified provider setup.

The documentation now uses a cleaner approach with the CloudCopilotKitProvider snippet and includes helpful information about multi-agent flows.


148-215: Comprehensive and consistent code example.

The CrewAI Flow component example is well-documented and appears to match the registry component implementation. The code includes:

  • Proper environment variable usage with fallbacks
  • Clear component structure with comments
  • Dynamic background functionality
  • Consistent styling with the registry component

Comment on lines +81 to +87
const CrewAIFlow: React.FC = () => (
<CopilotKit publicApiKey={publicApiKey} agent={agentName}>
<Chat />
</CopilotKit>
);

export default CrewAIFlow;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove duplicate function definition and export.

The file contains duplicate definitions of the CrewAIFlow component and multiple default exports, which will cause compilation errors.

Apply this diff to remove the duplicate:

-// App Component: Main wrapper that provides CopilotKit context
-const CrewAIFlow: React.FC = () => (
-  <CopilotKit publicApiKey={publicApiKey} agent={agentName}>
-    <Chat />
-  </CopilotKit>
-);
-
-export default CrewAIFlow;

The first definition (lines 13-34) already includes proper error handling and should be kept.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const CrewAIFlow: React.FC = () => (
<CopilotKit publicApiKey={publicApiKey} agent={agentName}>
<Chat />
</CopilotKit>
);
export default CrewAIFlow;
// (Lines 81–87 have been removed – the duplicate component and export are gone)
🧰 Tools
🪛 Biome (1.9.4)

[error] 87-87: Illegal duplicate default export declarations

multiple default exports are erroneous

the module's default export is first defined here

(parse)


[error] 81-81: Shouldn't redeclare 'CrewAIFlow'. Consider to delete it or rename it.

'CrewAIFlow' is defined here:

(lint/suspicious/noRedeclare)

🤖 Prompt for AI Agents
In registry/registry/quickstarts/coagents-starter-crewai-flows/page.tsx between
lines 81 and 87, there is a duplicate definition and export of the CrewAIFlow
component. Remove this second definition and export entirely, keeping only the
first definition from lines 13 to 34 which includes proper error handling, to
avoid compilation errors caused by multiple default exports and duplicate
component declarations.

@github-actions

github-actions Bot commented Jun 6, 2025 •

Copy link
Copy Markdown
Contributor

Preview environments destroyed for this pull request.

@github-actions

github-actions Bot commented Jun 6, 2025 •

Copy link
Copy Markdown
Contributor

Test Results

Status: ✅ Passed (View Run)

Commit: 1953b09

Duration: 398.9s

Total Tests: 32

Pass Rate: 100.0%

Failed Tests: 0

🔍 Detailed Results

coagents-research-canvas

CoAgents Research Canvas (UI) - Local Depenencies

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
CrewAI chromium ✅ PASSED -
OpenAI (LGC Python in-memory) chromium ✅ PASSED -
Anthropic (LGC Python in-memory) chromium ✅ PASSED -
OpenAI (LGC JS in-memory) chromium ✅ PASSED -
Anthropic (LGC JS in-memory) chromium ✅ PASSED -

coagents-qa-native

CoAgents QA Native (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
OpenAI (LGC Python) chromium ✅ PASSED -
Anthropic (LGC Python) chromium ✅ PASSED -
OpenAI (LGC JS) chromium ✅ PASSED -
Anthropic (LGC JS) chromium ✅ PASSED -

coagents-qa-text

CoAgents QA Text (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
OpenAI (LGC Python) chromium ✅ PASSED -
Anthropic (LGC Python) chromium ✅ PASSED -
OpenAI (LGC JS) chromium ✅ PASSED -
Anthropic (LGC JS) chromium ✅ PASSED -

coagents-routing

CoAgents Routing (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
OpenAI (LGC Python) chromium ✅ PASSED -
Anthropic (LGC Python) chromium ✅ PASSED -
OpenAI (LGC JS) chromium ✅ PASSED -
Anthropic (LGC JS) chromium ✅ PASSED -

next-openai

Next OpenAI - Self Hosted

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
Google Generative AI chromium ✅ PASSED -
LangChain (OpenAI) chromium ✅ PASSED -
LangChain (Anthropic) chromium ✅ PASSED -
LangChain (Gemini) chromium ✅ PASSED -
Groq chromium ✅ PASSED -

@suhasdeshpande
suhasdeshpande merged commit 60a3bb0 into main Jun 6, 2025
@suhasdeshpande
suhasdeshpande deleted the suhas/crew-flow-ent-doc branch June 6, 2025 16:26
This was referenced Sep 25, 2025

This branch was successfully deployed

13 active deployments
Preview – docs — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – copilotkit-feature-viewer — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – ag2-starter — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – examples-coagents-ai-travel-app — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – examples-coagents-research-canvas-ui — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – copilot-mastra-starter — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – demo-viewer — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – coagents-starter-crewai-flows — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – copilot-kit-wq8x — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – copilot-kit — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – copilotkit-mastra-feature-viewer — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – ag2-feature-viewer — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Preview – copilot-kit-qd8p — a3116237 Deployed Jun 6, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant