from crewai import Agent, Crew, Task
from stackone_ai import StackOneToolSet
# Initialize tools and create agents
toolset = StackOneToolSet()
tools = toolset.get_tools("hris_*", account_id="your-account-id")
langchain_tools = tools.to_langchain()
# Create specialized agents
hr_manager = Agent(
role="HR Manager",
goal="Manage employee data and handle HR requests",
backstory="Expert in human resources with experience in employee management",
tools=langchain_tools,
verbose=True
)
recruiter = Agent(
role="Recruiter",
goal="Find and evaluate candidates for open positions",
backstory="Experienced recruiter with talent acquisition expertise",
tools=toolset.get_tools("ats_*", account_id="your-account-id").to_langchain(),
verbose=True
)
# Create collaborative tasks
employee_analysis_task = Task(
description="Analyze current employee distribution by department",
agent=hr_manager,
expected_output="Employee distribution report with staffing recommendations"
)
# Execute multi-agent crew
crew = Crew(
agents=[hr_manager, recruiter],
tasks=[employee_analysis_task],
verbose=True
)
result = crew.kickoff()
print(result)