Transform your business operations with intelligent AI agents powered by LangGraph workflows
A production-ready ERP system that leverages AI agents to automate critical business processes: revenue intelligence, task prioritization, client health monitoring, and growth opportunity detection.
- Automated Invoice Tracking: Real-time overdue detection and payment predictions
- Cash Flow Forecasting: 30-day predictive analytics with confidence scoring
- Smart Follow-ups: Automated 7/14/30-day escalation workflows
- Payment Risk Analysis: Client health-based payment delay predictions
- AI Task Prioritization: Dynamic scoring based on urgency, client value, and health
- Daily Planning: Generates top 3 priorities with time estimates
- Smart Time Blocking: Optimized 2-4 hour focus sessions
- Context-Aware Scheduling: Integrates deadlines and client importance
- Health Score Calculation: Multi-factor analysis (contact recency, sentiment, payments)
- At-Risk Detection: Proactive identification of clients below 70% health
- Sentiment Analysis: Email communication pattern analysis
- Outreach Recommendations: Automated relationship management suggestions
- Upsell Opportunity Detection: Pattern-based revenue expansion identification
- Confidence Scoring: AI-powered opportunity ranking and timing
- Revenue Trend Analysis: Historical pattern recognition for growth signals
- Expansion Signal Tracking: Client engagement and usage pattern monitoring
┌─ Streamlit Dashboard ─┐ ┌─ LangGraph Orchestrator ─┐
│ • Real-time Monitoring │ │ • Revenue Intelligence │
│ • Workflow Controls │ ↔ │ • Focus Assistant │
│ • Business Analytics │ │ • Client Health Monitor │
│ • Performance Metrics │ │ • Growth Spotter │
└────────────────────────┘ └──────────────────────────┘
↕ ↕
┌─ Production Database ──┐ ┌─ AI Integration Layer ───┐
│ • SQLAlchemy ORM │ │ • OpenRouter API │
│ • Repository Pattern │ │ • Local Ollama Fallback │
│ • Migration System │ │ • Error Handling │
│ • Performance Indexes │ │ • Rate Limiting │
└────────────────────────┘ └──────────────────────────┘
- Orchestration: LangGraph for AI workflow management
- Backend: FastAPI with async/await support
- Database: SQLAlchemy ORM with SQLite/PostgreSQL
- Frontend: Streamlit with real-time updates
- AI: OpenRouter API with local model fallback
- Deployment: Docker containerization
- Monitoring: Comprehensive logging and metrics
# Clone repository
git clone <repository-url>
cd ERP-AAA
# Start with Docker Compose
docker-compose up -d
# Access dashboard
open http://localhost:8501# Install dependencies
pip install -r requirements.txt
# Initialize database
python scripts/setup_production_data.py
# Start dashboard
python ai_erp/main.py dashboard# Set environment variables
export OPENROUTER_API_KEY="your-api-key"
export DATABASE_URL="postgresql://user:pass@localhost/erp"
# Initialize system
python ai_erp/main.py info
# Run dashboard
python ai_erp/main.py dashboard- Executive Overview: Key metrics and AI-generated daily briefings
- Revenue Analytics: Cash flow forecasting and overdue tracking
- Client Management: Health monitoring and relationship insights
- Growth Opportunities: Upsell detection and expansion planning
- One-Click Execution: Run AI workflows with single button press
- Real-Time Status: Live monitoring of agent execution
- Performance Analytics: Execution time and success rate tracking
- Error Handling: Graceful degradation and recovery
# AI Integration
OPENROUTER_API_KEY=your-openrouter-key
# Database
DATABASE_URL=sqlite:///data/erp.db
# or PostgreSQL: postgresql://user:pass@localhost/erp
# Logging
LOG_LEVEL=INFO
# Dashboard
STREAMLIT_SERVER_PORT=8501- Daily Briefing: Complete business overview (all agents)
- Revenue Analysis: Cash flow and payment intelligence
- Client Analysis: Health monitoring and growth opportunities
- Growth Analysis: Focused opportunity detection
# Unit tests
pytest tests/ -v
# Integration tests
pytest tests/test_*_integration.py -v
# Coverage report
pytest --cov=ai_erp --cov-report=html# Format code
black ai_erp/
isort ai_erp/
# Lint code
flake8 ai_erp/
mypy ai_erp/# Create migration
alembic revision --autogenerate -m "description"
# Apply migrations
alembic upgrade head
# Reset database
python scripts/setup_production_data.py- Workflow Execution Time: Target <30 seconds for daily briefing
- Database Response Time: Target <100ms for queries
- AI Agent Success Rate: Target >95% completion rate
- Dashboard Load Time: Target <3 seconds initial load
- Real-time Status: Live workflow execution monitoring
- Performance Analytics: Historical execution time tracking
- Error Tracking: Comprehensive error logging and alerting
- Resource Usage: Memory and CPU utilization monitoring
- Local-First Architecture: Business data stored locally
- Encrypted Sensitive Fields: PII and financial data encryption
- API Key Management: Secure credential handling
- Access Control: Role-based permissions (future)
- Minimal External Dependencies: Only essential API calls
- Data Retention Policies: Configurable data lifecycle
- Audit Logging: Complete action tracking
- GDPR Ready: Data export and deletion capabilities
- Set production environment variables
- Configure PostgreSQL database
- Set up SSL/TLS certificates
- Configure backup strategy
- Set up monitoring and alerting
- Test disaster recovery procedures
- Horizontal Scaling: Multiple dashboard instances
- Database Optimization: Connection pooling and indexing
- Caching Layer: Redis for workflow results
- Load Balancing: Nginx for traffic distribution
# Execute workflow
POST /api/workflows/{workflow_type}/execute
# Get workflow status
GET /api/workflows/{workflow_id}/status
# List available workflows
GET /api/workflows/# Clients
GET /api/clients/
POST /api/clients/
# Invoices
GET /api/invoices/
POST /api/invoices/
# Tasks
GET /api/tasks/
POST /api/tasks/- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
MIT License - see LICENSE file for details.
- Documentation: Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with ❤️ for small businesses and startups
Transform your business operations with AI-powered automation