feat(examples): add crewai-agent — multi-agent research crew#567
feat(examples): add crewai-agent — multi-agent research crew#567sachinn854 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new CrewAI multi-agent example at ChangesCrewAI Agent Example
Sequence Diagram(s)sequenceDiagram
participant Handler
participant QueryExtraction
participant Crew
participant ResearcherAgent as Researcher
participant WriterAgent as Writer
participant SharedLLM as LLM
Handler->>QueryExtraction: extract latest message content
QueryExtraction->>Crew: create research and writing Tasks and kickoff()
Crew->>Researcher: dispatch research Task
Crew->>Writer: dispatch writing Task
Researcher->>SharedLLM: invoke shared LLM for research
Writer->>SharedLLM: invoke shared LLM for summary
Crew->>Handler: return kickoff result (final output)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new CrewAI example agent demonstrating a two-agent (Researcher + Writer) crew wrapped with Bindu, along with required dependency and documentation updates.
Changes:
- Adds
crewai>=0.130.0to theagentsoptional dependency group. - Introduces a new
examples/crewai-agent/directory containingmain.py, skill manifest, README, and.env.example. - Updates the examples index README to list the new CrewAI example.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Adds crewai dependency to the agents extra. |
| examples/crewai-agent/skills/crewai-research/skill.yaml | Declares the new skill metadata. |
| examples/crewai-agent/main.py | Implements the two-agent CrewAI handler and Bindu config. |
| examples/crewai-agent/README.md | Documents setup, run, and example request. |
| examples/crewai-agent/.env.example | Template env file for the OpenRouter API key. |
| examples/README.md | Adds the CrewAI example to the index table. |
| id: crewai-research | ||
| name: CrewAI Research Skill | ||
| version: 1.0.0 | ||
| author: your.email@example.com |
|
|
||
|
|
||
| config = { | ||
| "author": "your.email@example.com", |
| def handler(messages): | ||
| last = messages[-1] | ||
| query = last.get("content", "") if isinstance(last, dict) else str(last) |
| from bindu.penguin.bindufy import bindufy | ||
| from crewai import Agent, Task, Crew, LLM | ||
| from dotenv import load_dotenv | ||
| import os | ||
|
|
| llm = LLM( | ||
| model="openrouter/openai/gpt-4o-mini", | ||
| api_key=os.getenv("OPENROUTER_API_KEY"), |
| ```bash | ||
| cp .env.example .env | ||
| # fill in your OPENROUTER_API_KEY | ||
| uv sync --extra agents |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
examples/crewai-agent/main.py (1)
8-11: ⚡ Quick winUse
app_settingsinstead ofos.getenv()for configuration access.The coding guidelines require using
app_settingsfrombindu/settings.pyfor configuration access instead of directly reading environment variables withos.getenv(). As per coding guidelines: "Useapp_settingsfrombindu/settings.pyfor configuration instead of accessing environment variables directly."♻️ Suggested refactor
from bindu.penguin.bindufy import bindufy +from bindu.settings import app_settings from crewai import Agent, Task, Crew, LLM -from dotenv import load_dotenv -import os - -load_dotenv() llm = LLM( model="openrouter/openai/gpt-4o-mini", - api_key=os.getenv("OPENROUTER_API_KEY"), + api_key=app_settings.openrouter_api_key, )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/crewai-agent/main.py` around lines 8 - 11, Replace the direct environment lookup in the LLM instantiation with the project settings: import app_settings from bindu.settings and pass app_settings.OPENROUTER_API_KEY (or the appropriate attribute name) to the api_key parameter of the LLM(...) call (the LLM initialization in main.py currently uses os.getenv). Ensure the import for app_settings is added at the top of the file and the api_key argument uses that settings attribute instead of os.getenv.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@examples/crewai-agent/main.py`:
- Around line 8-11: Replace the direct environment lookup in the LLM
instantiation with the project settings: import app_settings from bindu.settings
and pass app_settings.OPENROUTER_API_KEY (or the appropriate attribute name) to
the api_key parameter of the LLM(...) call (the LLM initialization in main.py
currently uses os.getenv). Ensure the import for app_settings is added at the
top of the file and the api_key argument uses that settings attribute instead of
os.getenv.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ff6968a8-4958-45ef-929f-02b7e62ce5c8
📒 Files selected for processing (6)
examples/README.mdexamples/crewai-agent/.env.exampleexamples/crewai-agent/README.mdexamples/crewai-agent/main.pyexamples/crewai-agent/skills/crewai-research/skill.yamlpyproject.toml
|
Actionable comments posted: 0 |
Summary
examples/examples/crewai-agent/with a two-agent research crew (Researcher + Writer) wrapped withbindufy(), addedcrewai>=0.130.0to agents extras inpyproject.toml, added row toexamples/README.mdChange Type
Scope
Linked Issue/PR
User-Visible / Behavior Changes
New example at
examples/crewai-agent/— runnable withuv run examples/crewai-agent/main.py.Security Impact
NoNoNoNoNoVerification
Environment
Steps to Test
uv sync --extra agentscp examples/crewai-agent/.env.example examples/crewai-agent/.envand setOPENROUTER_API_KEYuv run examples/crewai-agent/main.pyhttp://localhost:3773/Expected Behavior
Actual Behavior
OPENROUTER_API_KEYavailable) but syntax and structure verifiedEvidence
1093 passed, 3 failed(3 failures are pre-existing Windows-specific bugs unrelated to this PR: file permissionchmod 600not supported on Windows, andREADME.mdencoding issue withcp1252)Human Verification
langgraph_blog_writing_agent,pdf_research_agent)messagesparameterCompatibility / Migration
YesNoNoFailure Recovery
examples/crewai-agent/folder and revertpyproject.toml+examples/README.mdRisks and Mitigations
NoneChecklist
uv run pytest) — 1093 passed, 3 pre-existing Windows failuresuv run pre-commit run --all-files)examples/README.md)Summary by CodeRabbit
New Features
Documentation
Chores