Files
magnus919_agent-skills/crewai/references/crew-patterns.md
T
Magnus Hedemark 48a67bb0a1 feat: add crewai — expert skill for role-based multi-agent teams
Greenfield SkillOpt: 3 epochs for CrewAI skill.
Role/Goal/Backstory agent model, sequential/hierarchical processes.

11 files: SKILL.md, 6 references, 3 templates, 1 script.
2026-07-09 14:55:42 -04:00

1.7 KiB

CrewAI Crew Patterns

Sequential Process

Tasks run in order. Each task receives the output of the previous task as context.

from crewai import Crew, Process

crew = Crew(
    agents=[researcher, writer, reviewer],
    tasks=[research_task, write_task, review_task],
    process=Process.sequential,
    verbose=True,
)
result = crew.kickoff()

Hierarchical Process

A manager agent assigns tasks and validates results. Requires manager_llm.

from crewai import Crew, Process
from langchain_openai import ChatOpenAI

crew = Crew(
    agents=[researcher, writer, reviewer],
    tasks=[research_task, write_task, review_task],
    process=Process.hierarchical,
    manager_llm=ChatOpenAI(model="gpt-4"),  # Required!
    verbose=True,
)

Crew Parameters

Parameter Description
agents List of agents in the crew
tasks List of tasks to execute
process Process.sequential or Process.hierarchical
manager_llm Required for hierarchical. LLM for the manager agent
verbose Print detailed execution logs
memory Enable cross-agent memory
cache Enable tool result caching
planning Enable planning step before execution
max_rpm Rate limit across the crew

Key Gotchas

  • Hierarchical without manager_llm fails silently. The crew appears to run but produces no output.
  • Sequential with more than 4-5 agents can produce very long completion times (each agent waits for the previous).
  • Crew-level `memory=True enables agents to remember context across tasks.
  • Tool caching (cache=True) prevents repeated API calls for the same input.
  • crew.kickoff() is synchronous by default. For async, check the async API.