import omium
from crewai import Crew, Agent, Task, Process
omium.init(api_key="om_xxx")
omium.instrument_crewai()
# Define agents
researcher = Agent(
role="Research Analyst",
goal="Conduct thorough research on topics",
backstory="Expert at finding and analyzing information"
)
writer = Agent(
role="Content Writer",
goal="Write clear, engaging content",
backstory="Skilled writer who creates compelling narratives"
)
editor = Agent(
role="Editor",
goal="Ensure quality and accuracy",
backstory="Meticulous editor with an eye for detail"
)
# Define tasks
research_task = Task(
description="Research the topic: {topic}",
agent=researcher,
expected_output="Comprehensive research notes"
)
writing_task = Task(
description="Write an article based on the research",
agent=writer,
expected_output="Draft article",
context=[research_task]
)
editing_task = Task(
description="Edit and polish the article",
agent=editor,
expected_output="Final polished article",
context=[writing_task]
)
# Create crew
crew = Crew(
agents=[researcher, writer, editor],
tasks=[research_task, writing_task, editing_task],
process=Process.sequential,
verbose=True
)
# All agent interactions and task completions are traced
result = crew.kickoff(inputs={"topic": "AI Agents in Production"})