Synaptic AI Consulting
Estimated time: ~30 minutes
Outcome: Deploy, monitor, and operate your recruitment assistant application
By the end of this module, you will be able to:
recruitment-assistant project with all Build phase artifactsThe Deliver phase ensures your application can run reliably, be monitored, and evolve over time. As an Agentic Architect, you’ll wear your Technical Hat to orchestrate the DevOps Engineer, ensuring:
Key Activities:
The DevOps Engineer will help you prepare your application for deployment.
git checkout -b feature/deployment
Start a NEW chat session:
@devops-engineer
I need you to help prepare the recruitment assistant for deployment. Please:
1. Review the PRD: project-context/1.define/prd.md
2. Review the SAD: project-context/2.build/sad.md
3. Review the Build phase artifacts in project-context/2.build/
4. Create a deployment plan document: project-context/3.deliver/deployment-plan.md
that outlines:
- Deployment approach (local, Docker, or cloud)
- Required dependencies and environment setup
- Configuration requirements
- Deployment steps
- Rollback procedures
- Status tracking
5. Create deployment configurations (Dockerfile, docker-compose.yml, or startup scripts)
6. Update deployment-plan.md with progress
Wearing your Technical Hat, review the deployment plan:
Iterate with DevOps Engineer if needed.
The DevOps Engineer will create:
Common Deployment Options for Mini-Project:
main.py or run.py entry pointpython main.pyDockerfiledocker-compose.yml (if needed)docker build -t recruitment-assistant . && docker run recruitment-assistantclick or argparse for CLIWearing your Technical Hat, verify:
git add project-context/3.deliver/deployment-plan.md Dockerfile docker-compose.yml requirements.txt main.py
git commit -m "feat: Add deployment configuration
- DevOps Engineer created deployment plan
- Deployment configurations added
- Ready for deployment simulation"
git checkout main
git merge feature/deployment
git branch -d feature/deployment
Add basic observability to your application.
git checkout -b feature/monitoring
Continue with DevOps Engineer:
@devops-engineer
I need you to add monitoring and logging to the recruitment assistant. Please:
1. Review the deployment plan: project-context/3.deliver/deployment-plan.md
2. Add basic logging to the application:
- Log application startup
- Log agent execution (when Application Crew runs)
- Log API requests/responses
- Log errors and exceptions
3. Enable CrewAI tracing for the Application Crew:
- Set up CrewAI AOP account authentication
- Enable tracing in the CrewAI Crew configuration
- Document how to view traces in the CrewAI dashboard
4. Create a monitoring plan document: project-context/3.deliver/monitoring-plan.md
that outlines:
- What to monitor (agent execution, API calls, errors)
- Log levels and formats
- Where logs are stored
- How to view logs
- CrewAI tracing setup and access
- Status tracking
5. Implement logging in the application code
6. Update monitoring-plan.md with implementation details
Review the monitoring plan:
Iterate with DevOps Engineer if needed.
The DevOps Engineer will:
Example Logging Setup:
import logging
from datetime import datetime
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('logs/app.log'),
logging.StreamHandler()
]
)
logger = logging.getLogger(__name__)
# Use in application
logger.info("Application started")
logger.info("Researcher agent executing...")
logger.error("Error occurred: %s", error_message)
CrewAI provides built-in tracing capabilities that give you comprehensive observability into your Application Crew’s execution. This is essential for monitoring agent decisions, task execution, and LLM calls.
pip install "crewai[tools]"
crewai login
This command will:
Update your CrewAI Crew configuration to enable tracing:
Option 1: Enable Tracing in Crew Configuration
from crewai import Agent, Crew, Process, Task
# Your existing agents
researcher = Agent(...)
evaluator = Agent(...)
recommender = Agent(...)
# Your existing tasks
research_task = Task(...)
evaluation_task = Task(...)
recommendation_task = Task(...)
# Enable tracing in your crew
crew = Crew(
agents=[researcher, evaluator, recommender],
tasks=[research_task, evaluation_task, recommendation_task],
process=Process.sequential,
tracing=True, # Enable built-in tracing
verbose=True
)
# Execute your crew - traces will be automatically sent to CrewAI AOP
result = crew.kickoff()
Option 2: Enable Tracing via Environment Variable
Add to your .env file:
CREWAI_TRACING_ENABLED=true
When this environment variable is set, all Crews will automatically have tracing enabled, even without explicitly setting tracing=True.
After running your Application Crew:
The DevOps Engineer should document the tracing setup in monitoring-plan.md:
## CrewAI Tracing
### Setup
- CrewAI AOP account: [Your account URL]
- Authentication: `crewai login` completed
- Tracing enabled: `tracing=True` in Crew configuration
### Accessing Traces
1. Visit app.crewai.com
2. Navigate to Traces tab
3. View execution details for each crew run
### What to Monitor
- Agent decision-making process
- Task execution timeline
- Tool usage and results
- LLM call performance
- Error occurrences
Reference: CrewAI Tracing Documentation
Wearing your Technical Hat, verify:
git add project-context/3.deliver/monitoring-plan.md src/ logs/
git commit -m "feat: Add monitoring and logging
- DevOps Engineer added logging infrastructure
- Application events are now logged
- Monitoring plan documented"
git checkout main
git merge feature/monitoring
git branch -d feature/monitoring
A runbook is an operational guide that enables others to run and maintain your application.
git checkout -b feature/runbook
Continue with DevOps Engineer:
@devops-engineer
I need you to create a comprehensive runbook for the recruitment assistant. Please:
1. Review all project artifacts:
- PRD: project-context/1.define/prd.md
- SAD: project-context/2.build/sad.md
- Deployment plan: project-context/3.deliver/deployment-plan.md
- Monitoring plan: project-context/3.deliver/monitoring-plan.md
2. Use the runbook template: .cursor/templates/runbook-template.md
3. Create a comprehensive runbook: project-context/3.deliver/runbook.md
that includes:
- Application overview
- Prerequisites and dependencies
- Installation instructions
- Configuration (environment variables)
- How to run the application
- How to monitor and view logs
- Common issues and troubleshooting
- How to stop/restart the application
- Health checks
4. Make it clear and actionable for someone who hasn't worked on the project
Wearing your Technical Hat, review the runbook:
Iterate with DevOps Engineer if needed.
git add project-context/3.deliver/runbook.md
git commit -m "feat: Add operational runbook
- DevOps Engineer created comprehensive runbook
- All operational procedures documented
- Application is now fully documented for operations"
git checkout main
git merge feature/runbook
git branch -d feature/runbook
Run your application end-to-end and capture the results.
# Install dependencies
pip install -r requirements.txt
# Verify .env file is configured
cat .env | grep OPENAI_API_KEY
cat project-context/3.deliver/runbook.md
Follow the runbook instructions to start your application:
Option 1: Local Python Script
python main.py
Option 2: Docker
docker build -t recruitment-assistant .
docker run --env-file .env recruitment-assistant
Option 3: CLI Entry Point
python -m src.cli --job-description "Python Developer" --requirements "5 years experience"
Create an execution log document:
git checkout -b feature/execution-results
Create project-context/3.deliver/execution-results.md:
# Execution Results
## Test Run: [Date]
### Input
- Job Description: [Your test job description]
- Requirements: [Key requirements]
### Execution
- Start Time: [timestamp]
- End Time: [timestamp]
- Duration: [duration]
### Application Crew Execution
- Researcher Agent: [Status and findings]
- Evaluator Agent: [Status and findings]
- Recommender Agent: [Status and recommendations]
### Output
[Capture the actual output/recommendations]
### Logs
[Key log entries or attach log file]
### Issues Encountered
[Any errors or unexpected behavior]
### Observations
[What worked well, what didn't]
git add project-context/3.deliver/execution-results.md
git commit -m "docs: Add execution results
- End-to-end test execution completed
- Application Crew executed successfully
- Results documented"
git checkout main
git merge feature/execution-results
git branch -d feature/execution-results
Reflect on the entire project and document insights.
Create LESSONS.md in your project root:
git checkout -b feature/lessons-learned
As an Agentic Architect, reflect on:
Create LESSONS.md:
# Lessons Learned
## Project: Recruitment Assistant
### What Went Well
- [List successes]
### Challenges Encountered
- [List challenges and how you overcame them]
### Key Insights
#### Define Phase
[Your insights]
#### Build Phase
[Your insights]
#### Deliver Phase
[Your insights]
### AAMAD Framework Observations
[What you learned about the framework]
### Agentic Architect Reflections
[What you learned about the role]
### Recommendations for Future Projects
[What you'd do differently next time]
### Skills Developed
[What skills did you develop or improve?]
git add LESSONS.md
git commit -m "docs: Add lessons learned
- Document insights from entire project
- Reflect on AAMAD framework experience
- Capture recommendations for future projects"
git checkout main
git merge feature/lessons-learned
git branch -d feature/lessons-learned
As an Agentic Architect, review all Deliver phase artifacts:
project-context/3.deliver/deployment-plan.md - Deployment approach documentedproject-context/3.deliver/monitoring-plan.md - Monitoring strategy documentedproject-context/3.deliver/runbook.md - Operational guide completeproject-context/3.deliver/execution-results.md - Test execution documentedLESSONS.md - Lessons learned capturedUpdate your project README with:
Create project-context/3.deliver/release-notes.md:
# Release Notes
## Version 1.0.0 - Initial Release
### Features
- [List key features from PRD]
### Deployment
- [Deployment method used]
- [How to deploy]
### Known Issues
- [Any known issues]
### Next Steps
- [Future improvements]
git add README.md project-context/3.deliver/release-notes.md
git commit -m "docs: Complete Deliver phase documentation
- All Deliver phase artifacts complete
- README updated with project status
- Release notes created
- Project ready for production use"
Complete the Deliver phase by:
Key Practices Applied:
By the end of this module, you should have:
project-context/3.deliver/deployment-plan.md - Deployment strategyproject-context/3.deliver/monitoring-plan.md - Monitoring strategy (includes CrewAI tracing)project-context/3.deliver/runbook.md - Operational guideproject-context/3.deliver/execution-results.md - Test execution resultsproject-context/3.deliver/release-notes.md - Release documentationLESSONS.md - Lessons learned documentIssue: Application won’t start
Issue: Docker build fails
Issue: Logs not appearing
Issue: CrewAI traces not appearing in dashboard
crewai logintracing=True is set in Crew configurationCREWAI_TRACING_ENABLED=true if using environment variableIssue: Application Crew agents not executing
Issue: Can’t follow runbook
Throughout this module, you’ve applied key operational best practices:
Once the Deliver phase is complete:
Continue to Module 08: Value and Next Steps