Multi-agent BOM processing service built with CrewAI and FastAPI.
Production URL: https://api.precisionbom.com
This service automates the review of electronic component sourcing through specialized AI agents:
- Engineering Agent - Evaluates technical specifications and compliance
- Sourcing Agent - Analyzes supply chain risk and availability
- Finance Agent - Reviews pricing and budget constraints
- Framework: FastAPI + Uvicorn
- AI: CrewAI with Anthropic Claude
- CLI: Click + Rich
- Data: SQLite stores + CrewAI memory
- Python 3.11+
- uv package manager
uv syncCopy .env.example to .env and configure:
# LLM API Key (at least one required)
OPENAI_API_KEY=sk-... # Required for gpt-5-nano (default)
ANTHROPIC_API_KEY=sk-ant-... # Required for Claude models
# Optional
CREWAI_MODEL=gpt-5-nano # Model for agents
PORT=8000 # API server portuv run uvicorn bom_agent_service.main:app --reloadServer runs at http://localhost:8000.
uv run sourcing process sample_bom.csv --intake project_intake.yamluv run sourcing statusuv run sourcing trace <project_id>uv run sourcing kb suppliers listpython-agent/
├── src/bom_agent_service/
│ ├── main.py # FastAPI entry point
│ ├── cli.py # Click CLI
│ ├── agents/ # CrewAI agent definitions
│ ├── flows/ # CrewAI Flow orchestration
│ ├── stores/ # SQLite data stores
│ ├── api/ # FastAPI routers
│ └── models/ # Pydantic models
├── tests/ # pytest tests
├── data/ # Sample data files
├── demo/ # Demo scripts
└── docs/ # Documentation
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/projects |
GET | List all projects |
/projects |
POST | Create new project |
/projects/{id} |
GET | Get project details |
/knowledge/suppliers |
GET | List suppliers |
/process |
POST | Process BOM file |
Orchestration uses @start() and @listen() decorators for sequential agent execution:
@start()
def ingest_bom(self):
# Parse BOM file
pass
@listen(ingest_bom)
def engineering_review(self):
# Technical evaluation
pass
@listen(engineering_review)
def sourcing_review(self):
# Supply chain analysis
passCLI → HTTP → FastAPI → CrewAI Flow → Agents → Stores
# Run all tests
uv run pytest
# Verify imports
uv run python -c "from bom_agent_service.main import app; print('OK')"
# Test endpoints
curl http://localhost:8000/health