CrewAI Job Posting Generator with AgentOps
This example shows you how to build a complete job posting generator using CrewAI’s official project structure with comprehensive tracking via AgentOps.What We’re Building
A 3-agent system that collaborates to create job postings:- 🔍 Research Agent: Analyzes company culture and industry trends
- ✍️ Writer Agent: Drafts compelling job descriptions
- 📝 Editor Agent: Reviews and polishes the final posting
Step-by-Step Implementation
Step 1: Install Dependencies
Install CrewAI with tools support and AgentOps for tracking:- 🔍 Automatic tracking of all LLM calls and agent interactions
- 💰 Cost monitoring with token usage breakdown
- 🛠️ Tool usage analytics for web searches and file operations
- 📊 Performance metrics and execution timelines
- 🐛 Session replay for debugging and optimization
Step 2: Create CrewAI Project
Use CrewAI’s CLI to create the proper project structure:- Choose 1. openai
- Choose 1. gpt-4 (or your preferred model)
- Enter your OpenAI API key when prompted
Step 3: Add Additional API Keys
Edit the generated.env
file to add AgentOps and Serper keys:
- AgentOps: Get one here
- Serper: Serper Dev (for web search)
Step 4: Configure Agents
Editsrc/job_posting_agent/config/agents.yaml
to define your 3 agents:
Step 5: Configure Tasks
Editsrc/job_posting_agent/config/tasks.yaml
to define the workflow:
Step 6: Update the Crew Definition
Editsrc/job_posting_agent/crew.py
to add tools and AgentOps:
Step 7: Update the Main Execution File
Editsrc/job_posting_agent/main.py
to add AgentOps session management:
Step 8: Run Your Job Posting Generator
Navigate to your project and run:- AgentOps session starts automatically
- Research agent analyzes the company and industry trends
- Writer agent drafts the job posting using research insights
- Editor agent reviews and polishes the final version
- A
job_posting.md
file is created with the result - AgentOps captures all agent interactions, tool usage, and costs
- Session ends with success/failure status
View Results in AgentOps Dashboard
After running your job posting generator, visit your AgentOps Dashboard to see:- Session Overview: Complete timeline of the 3-agent workflow
- Agent Conversations: Every LLM call with prompts and responses
- Tool Execution: Web searches and their results
- Cost Breakdown: Token usage and costs per agent and task
- Performance Analytics: Execution times and success rates
- Session Replay: Step-by-step playback for debugging
Key Files Modified
Configuration files you edited:config/agents.yaml
- Agent definitions with roles and backstoriesconfig/tasks.yaml
- Task workflow with context dependenciescrew.py
- Added tools and AgentOps initializationmain.py
- Added session management.env
- Added AgentOps and Serper API keys
job_posting.md
- Final job posting created by the crew
agentops.init()
increw.py
- Enables automatic instrumentationagentops.start_session()
inmain.py
- Begins trackingagentops.end_session()
inmain.py
- Completes the session
Next Steps
- Customize the input parameters in
main.py
- Modify agent configurations in
agents.yaml
- Add more tasks or change the workflow in
tasks.yaml
- Add custom tools in the
tools/
directory - Use AgentOps analytics to optimize agent performance