An AI-powered document processing application that generates actionable checklists from uploaded PDF tender documents. The system uses Anthropic's Claude API for document analysis, question answering, and condition evaluation.
- Frontend: Next.js 15 (TypeScript) -
apps/web/ - API: FastAPI (Python) -
services/api/ - Worker: Dramatiq + Redis (Python) -
services/worker/ - Storage: AWS S3 compatible
- Database: PostgreSQL
- AI: Anthropic Claude (File API + structured outputs)
- Upload multiple PDF tender documents
- Define custom questions and conditions for evaluation
- Automatic document processing using Anthropic's File API
- Structured checklist generation with requirements extraction
- Question answering and boolean condition evaluation
- Real-time processing status updates
- Modern, responsive web interface
- Python 3.11.x (required for PyMuPDF compatibility)
- Node.js 20+ with npm/pnpm
- uv package manager (
curl -LsSf https://astral.sh/uv/install.sh | sh) - Redis server (for job queue)
- PostgreSQL database
- Anthropic API key
- AWS S3 bucket (or compatible storage)
git clone <repository-url>
cd forgent-checklistCreate .env files for each service (these are gitignored):
# Database
DATABASE_URL=postgresql+psycopg://postgres:postgres@localhost:5432/forgent
# Redis Queue
REDIS_URL=redis://localhost:6379/0
# Anthropic AI
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
# AWS S3 Storage
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
S3_BUCKET=your-bucket-name
# Worker Integration
WORKER_INGEST_TOKEN=your-shared-secret-token# Redis Queue
REDIS_URL=redis://localhost:6379/0
# Anthropic AI
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
ANTHROPIC_MODEL=claude-3-5-sonnet-20241022
ANTHROPIC_REPAIR_MODEL=claude-3-haiku-20240307
# API Integration
API_BASE=http://localhost:8000
WORKER_INGEST_TOKEN=your-shared-secret-token
# AWS S3 Storage
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
S3_BUCKET=your-bucket-name# API Proxy
NEXT_PUBLIC_API_BASE=http://localhost:8000docker run --rm -p 6379:6379 redis:7docker run --rm -p 5432:5432 \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=forgent \
postgres:16cd services/api
uv synccd services/worker
uv synccd apps/web
npm installcd services/api
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadcd services/worker
uv run dramatiq worker.main --processes 1 --threads 1cd apps/web
npm run dev- Web Interface: http://localhost:3000
- API Documentation: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
- Create a Checklist: Navigate to the web interface and create a new checklist
- Upload Documents: Add PDF tender documents to your checklist
- Configure Questions: Define questions you want answered from the documents
- Set Conditions: Create boolean conditions for evaluation (e.g., "Is the deadline before 2025?")
- Process Documents: Trigger processing - the worker will:
- Upload PDFs to Anthropic's File API
- Extract structured requirements
- Answer your questions
- Evaluate conditions as true/false
- Generate a comprehensive checklist
- Review Results: View the generated checklist with answers, evaluations, and evidence
Based on the TASK.md requirements:
- "In welcher Form sind die Angebote/Teilnahmeanträge einzureichen?" (In what form should offers/applications be submitted?)
- "Wann ist die Frist für die Einreichung von Bieterfragen?" (When is the deadline for submitting bidder questions?)
- "Ist die Abgabefrist vor dem 31.12.2025?" (Is the application deadline before 31.12.2025?)
forgent-checklist/
├── apps/web/ # Next.js frontend
│ ├── app/ # App router pages
│ ├── components/ # React components
│ └── public/ # Static assets
├── services/api/ # FastAPI backend
│ ├── app/ # Application code
│ ├── pyproject.toml # Dependencies
│ └── uv.lock # Lockfile
├── services/worker/ # Dramatiq worker
│ ├── worker/ # Worker modules
│ ├── pyproject.toml # Dependencies
│ └── uv.lock # Lockfile
└── README.md # This file
- Document Processing: Anthropic File API integration for PDF analysis
- Question Answering: Structured prompts for extracting specific information
- Condition Evaluation: Boolean logic evaluation with confidence scoring
- Checklist Generation: Automated requirement extraction and categorization
- Real-time Updates: WebSocket-like status updates via polling
POST /api/checklists- Create new checklistGET /api/checklists/{id}- Get checklist detailsPOST /api/checklists/{id}/documents- Upload documentsPOST /api/checklists/{id}/process- Trigger processingGET /api/checklists/{id}/prompts- Get questions/conditionsPOST /api/prompt-templates- Manage reusable prompts
-
PyMuPDF Installation Fails
- Ensure you're using Python 3.11.x (PyMuPDF doesn't support 3.13 yet)
- Use
pyenvto manage Python versions if needed
-
API Requests Return 404
- Check that
NEXT_PUBLIC_API_BASEis set inapps/web/.env.local - Restart the Next.js dev server after changing environment variables
- Verify the API server is running on port 8000
- Check that
-
Worker Not Processing Jobs
- Ensure Redis is running and accessible
- Check that
REDIS_URLmatches in both API and worker environments - Verify
WORKER_INGEST_TOKENis identical in both services
-
Anthropic API Errors
- Verify your API key is valid and has sufficient credits
- Check rate limits if you're seeing 429 errors
- Ensure file uploads are within Anthropic's size limits
- API logs: Check the uvicorn console output
- Worker logs: Monitor the dramatiq worker console
- Frontend: Use browser developer tools for client-side issues
- Database: Check PostgreSQL logs for connection issues
For production deployment, consider:
- Use environment-specific configuration
- Set up proper logging and monitoring
- Configure SSL/TLS certificates
- Use a production WSGI server (gunicorn)
- Set up database migrations
- Configure Redis persistence
- Use a CDN for static assets
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
[Add your license information here]