Skip to content

Conversation

@gojkoc54
Copy link

@gojkoc54 gojkoc54 commented Dec 5, 2025

This PR adds AgentSpecAgentAdapter that lets CrewAI import agents defined using Oracle's AgentSpec specification language. (https://github.com/oracle/agent-spec.git)

Supported features:

  • ReAct-style agents
  • Tools
  • Flows (non-branching, without inputs)

Not currently supported (in the works):

  • Flows (with branching)
  • Multi-agent patterns

Please refer to this PR in the crewai-examples repo for a detailed demo on how the AgentSpec adapter could be used to bring a LangGraph agent into CrewAI.


Note

Introduce AgentSpecAgentAdapter and update docs/examples to integrate AgentSpec agents into CrewAI.

  • Agents/Adapters:
    • New AgentSpecAgentAdapter in crewai/agents/agent_adapters/agentspec/agentspec_adapter.py to load AgentSpec-defined agents/flows via pyagentspec loader and delegate execution/tooling to the converted CrewAI component.
    • Adds package init at agentspec/__init__.py.
  • Docs:
    • Updates bring-your-own-agent guide to include AgentSpec in supported adapters and provides a usage example.
    • Example demonstrates creating an AgentSpec-backed reviewer, updates imports, and splits tasks into task_write_code, task_review_code, task_find_links, and task_generate_report used in Crew.

Written by Cursor Bugbot for commit 4c48e91. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 28

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

from src.crewai import Agent, Crew, Task
from crewai import Agent, Crew, Task
from langchain_openai import ChatOpenAI
from pyagentspec.agent import Agent
Copy link

Choose a reason for hiding this comment

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

Bug: Import shadowing causes wrong Agent class usage

The import from pyagentspec.agent import Agent on line 338 shadows the earlier import from crewai import Agent on line 336. When code_helper_agent = Agent(...) is created on line 348 with role, goal, and backstory parameters, it will incorrectly use pyagentspec.agent.Agent instead of crewai.Agent. The pyagentspec Agent class likely doesn't accept these parameters, causing a runtime error. The pyagentspec Agent import needs an alias like AgentSpecAgent.

Additional Locations (1)

Fix in Cursor Fix in Web

@rhpatra
Copy link

rhpatra commented Dec 20, 2025

@greysonlalonde @lorenzejay , would you be able to review this pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants