A web based AI application that creates comprehensive reports on any topic using AI agents.
- 🤖 Multi-Agent AI System: Research, analysis, writing, and review agents working together
- 📊 Comprehensive Reports: Generate detailed reports on any topic
- 🌐 Multiple Interfaces: Web UI (Streamlit), REST API (FastAPI), and CLI
- ☁️ Cloud-Ready: Docker containerization with GCP deployment support
- 🔧 Configurable: Customizable agents, tasks, and report formats
- 🔍 Advanced Research: Integration with search tools and OpenAI for comprehensive research
Ensure you have Python >=3.10 <3.14 installed on your system. This project uses UV for dependency management and package handling, offering a seamless setup and execution experience.
First, if you haven't already, install uv:
pip install uvNext, navigate to your project directory and install the dependencies:
# Install using pip
pip install -r requirements.txt
# Or using crewai CLI (optional)
crewai installCreate a .env file in the root directory with the following variables:
# Required API Keys
OPENAI_API_KEY=your_openai_api_key_here
GROQ_API_KEY=your_groq_api_key_here
SERPER_API_KEY=your_serper_api_key_here
# Optional Configuration
PYTHONDONTWRITEBYTECODE=1
PYTHONUNBUFFERED=1Required API Keys:
OPENAI_API_KEY: For AI content generation and analysisGROQ_API_KEY: For enhanced AI processing capabilitiesSERPER_API_KEY: For web search functionality
Run the interactive web application:
streamlit run app.pyAccess the application at http://localhost:8501
Start the API server:
# Development
uvicorn api:app --reload --host 0.0.0.0 --port 8000
# Production
gunicorn -w 1 --threads 2 -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8080 api:appAPI Endpoints:
GET /: Health checkPOST /research: Generate reports
Example API Usage:
curl -X POST "http://localhost:8000/research" \
-H "Content-Type: application/json" \
-d '{
"topic": "How to improve infrastructure in Bangalore?",
"user_personalization": "Focus on transportation and urban planning"
}'Run directly from the command line:
crewai runThis will generate a report.md file with research on LLMs (default example).
The project includes a production-ready Dockerfile optimized for deployment:
# Build the image
docker build -t createreport-crew .
# Run locally
docker run -p 8080:8080 \
-e OPENAI_API_KEY=your_key_here \
-e GROQ_API_KEY=your_key_here \
-e SERPER_API_KEY=your_key_here \
createreport-crewThe Dockerfile is configured with:
- Base Image: Python 3.11 slim (Debian Bullseye)
- Port: 8080 (Cloud Run compatible)
- Server: Gunicorn with Uvicorn workers
- Optimization: Multi-threaded, production-ready configuration
- Install Google Cloud SDK:
# macOS
brew install google-cloud-sdk
# Ubuntu/Debian
sudo apt-get install google-cloud-sdk
# Or download from: https://cloud.google.com/sdk/docs/install- Authenticate with GCP:
gcloud auth login# List available projects
gcloud projects list
# Set your project ID
gcloud config set project YOUR_PROJECT_ID
# Enable required services
gcloud services enable cloudbuild.googleapis.com artifactregistry.googleapis.com run.googleapis.com# PowerShell (Windows)
$REPO_NAME = "createreport-crew"
$REGION = "us-central1" # or your preferred region
$SERVICE_NAME = "createreport-api"# Bash (Linux/macOS)
REPO_NAME="createreport-crew"
REGION="us-central1" # or your preferred region
SERVICE_NAME="createreport-api"# PowerShell
gcloud artifacts repositories create $REPO_NAME `
--repository-format=docker `
--location=$REGION `
--description="CreateReport Crew Docker Repository"# Bash
gcloud artifacts repositories create $REPO_NAME \
--repository-format=docker \
--location=$REGION \
--description="CreateReport Crew Docker Repository"# PowerShell
$PROJECT_ID = $(gcloud config get-value project)
$IMAGE_TAG = "$($REGION)-docker.pkg.dev/$($PROJECT_ID)/$($REPO_NAME)/createreport-api:latest"
# Build and push image
gcloud builds submit --tag $IMAGE_TAG# Bash
PROJECT_ID=$(gcloud config get-value project)
IMAGE_TAG="$REGION-docker.pkg.dev/$PROJECT_ID/$REPO_NAME/createreport-api:latest"
# Build and push image
gcloud builds submit --tag $IMAGE_TAG# PowerShell
gcloud run deploy $SERVICE_NAME `
--image=$IMAGE_TAG `
--platform=managed `
--region=$REGION `
--allow-unauthenticated `
--port=8080 `
--memory=2Gi `
--cpu=1 `
--timeout=900 `
--set-env-vars="PYTHONDONTWRITEBYTECODE=1,PYTHONUNBUFFERED=1"# Bash
gcloud run deploy $SERVICE_NAME \
--image=$IMAGE_TAG \
--platform=managed \
--region=$REGION \
--allow-unauthenticated \
--port=8080 \
--memory=2Gi \
--cpu=1 \
--timeout=900 \
--set-env-vars="PYTHONDONTWRITEBYTECODE=1,PYTHONUNBUFFERED=1"For production deployment, set your API keys as environment variables:
# Set environment variables with secrets
gcloud run services update $SERVICE_NAME \
--region=$REGION \
--set-env-vars="OPENAI_API_KEY=your_openai_key_here,GROQ_API_KEY=your_groq_key_here,SERPER_API_KEY=your_serper_key_here"Better approach using Secret Manager:
# Create secrets
echo "your_openai_key_here" | gcloud secrets create openai-api-key --data-file=-
echo "your_groq_key_here" | gcloud secrets create groq-api-key --data-file=-
echo "your_serper_key_here" | gcloud secrets create serper-api-key --data-file=-
# Deploy with secrets
gcloud run deploy $SERVICE_NAME \
--image=$IMAGE_TAG \
--region=$REGION \
--set-secrets="OPENAI_API_KEY=openai-api-key:latest,GROQ_API_KEY=groq-api-key:latest,SERPER_API_KEY=serper-api-key:latest"After successful deployment, you'll receive a service URL. You can:
- Test the API:
curl -X GET "https://your-service-url.run.app/"- View logs:
gcloud run services logs tail $SERVICE_NAME --region=$REGION- Monitor the service:
gcloud run services describe $SERVICE_NAME --region=$REGIONModify src/create_report/config/agents.yaml to define your agents:
researcher:
role: "Senior Research Analyst"
goal: "Conduct comprehensive research..."
backstory: "You are a senior research analyst..."Modify src/create_report/config/tasks.yaml to define your tasks:
research_task:
description: "Conduct comprehensive research on..."
expected_output: "A comprehensive research summary..."
agent: researcher- Modify
src/create_report/crew.py: Add custom logic, tools, and specific arguments - Modify
src/create_report/main.py: Add custom inputs and orchestration logic - Modify
api.py: Customize API endpoints and request handling - Modify
app.py: Customize the Streamlit interface
create_report/
├── .dockerignore # Docker ignore patterns
├── .gitignore # Git ignore patterns
├── Dockerfile # Production Docker configuration
├── README.md # This file
├── api.py # FastAPI REST API
├── app.py # Streamlit web interface
├── requirements.txt # Python dependencies
├── pyproject.toml # Project configuration
├── knowledge/ # Knowledge base files
│ └── user_preference.txt
├── src/create_report/ # Main package
│ ├── __init__.py
│ ├── main.py # Main orchestration logic
│ ├── crew.py # Crew management
│ ├── config/ # Configuration files
│ │ ├── agents.yaml # Agent definitions
│ │ └── tasks.yaml # Task definitions
│ └── tools/ # Custom tools
│ ├── __init__.py
│ └── custom_tool.py
The create-report Crew is composed of multiple AI agents, each with unique roles, goals, and tools:
- 🔍 Researcher: Conducts comprehensive research and gathers information
- 📊 Analyst: Analyzes data and identifies trends and insights
- ✍️ Writer: Creates well-structured, engaging reports
- 🔍 Reviewer: Reviews and improves report quality and accuracy
- 📋 Strategist: Develops strategic recommendations and implementation plans
These agents collaborate on a series of tasks, leveraging their collective skills to achieve complex objectives.
- API Key Errors: Ensure all required API keys are set in your environment
- Docker Build Failures: Check that all dependencies are properly listed in
requirements.txt - GCP Deployment Issues: Verify that all required GCP services are enabled
- Memory Issues: Increase Cloud Run memory allocation if processing large reports
# Build and run locally for debugging
docker build -t createreport-crew-debug .
docker run -it --entrypoint /bin/bash createreport-crew-debug
# Check logs
docker logs <container_id># View detailed logs
gcloud run services logs tail $SERVICE_NAME --region=$REGION --format="value(textPayload)"
# Check service status
gcloud run services list --region=$REGION
# Describe service configuration
gcloud run services describe $SERVICE_NAME --region=$REGIONFor better performance in production:
- Increase Resources: Adjust CPU and memory in Cloud Run deployment
- Enable Caching: Implement caching for frequently requested reports
- Database Integration: Add database support for storing reports and user data
- Load Balancing: Use multiple Cloud Run instances for high traffic
For support, questions, or feedback regarding the CreateReport Crew or crewAI:
- Visit our documentation
- Reach out to us through our GitHub repository
- Join our Discord
- Chat with our docs