Skip to content

crewai subagents + knowledge - #110

Open
Shahid-Musabbar wants to merge 1 commit into
open-gitagent:mainfrom
Shahid-Musabbar:crewai_correction
Open

Shahid-Musabbar wants to merge 1 commit into
open-gitagent:mainfrom
Shahid-Musabbar:crewai_correction

Conversation

@Shahid-Musabbar

Copy link
Copy Markdown

What

Makes the CrewAI runner actually work and fixes how the CrewAI adapter handles sub-agents and knowledge.

  • Runner: opengap run -a crewai now generates a standalone Python script (exportToCrewAIScript) and runs it with python3, using the CrewAI Python API directly. It no longer shells out to crewai kickoff --config <file>.
  • Prompt: -p/--prompt is now passed through to the CrewAI runner and added to the task description as User request: .... It also prints a hint if neither OPENAI_API_KEY nor ANTHROPIC_API_KEY is set.
  • Sub-agents run hierarchically:
    • With sub-agents, the main agent becomes the crew's manager_agent (allow_delegation=True).
    • Each entry under agents: becomes a worker Agent, and the crew uses Process.hierarchical.
    • The Task has no agent=, so the manager assigns work at runtime.
    • Without sub-agents, the script calls main_agent.kickoff(<description>) directly, with no Task or Crew.
    • A full sub-agent (agents/<name>/agent.yaml) keeps its own role, goal, backstory and model. A lightweight one uses its description and inherits the default LLM.
  • Knowledge:
    • Every .md file under knowledge/ (recursively) is fed to CrewAI through TextFileKnowledgeSource.
    • Because that source only takes .txt and resolves paths from ./knowledge, the script writes each doc as a temporary .txt file into ./knowledge/_gitagent_<random>/ and deletes it on exit.
    • Knowledge is attached to the Crew when there are sub-agents, and to the main Agent when there are none.
  • Docs: the CrewAI Runner section of docs.md is updated.

Why

opengap run -a crewai didn't work. The crewai CLI has no kickoff subcommand, so the run failed with "No such command 'kickoff'" (#102). On top of that, the adapter exported sub-agents as flat, unconnected agents with no manager or hierarchy, never loaded knowledge/ at all, and dropped --prompt (#109).

Closes #102
Closes #109

How Tested

  • npm run build passes
  • gitagent validate passes on example agents
  • Manual testing (describe below)

Checklist

  • My code follows the existing style of this project
  • I have updated documentation (if applicable)
  • I have read the CONTRIBUTING.md

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

Labels

None yet

Projects

None yet

1 participant