Smart Terminal AI Agent for Home Assistant Integration
"Where Aye meets Agent, and Trisha from Accounting keeps everything sparkly!" ✨
Welcome to ST-AYGENT, the most entertaining feedback system this side of the digital universe! This isn't just another boring microservices architecture - it's a full-on party where APIs dance with workers, proxies wear fancy nginx outfits, and everything gets monitored by Prometheus (who never sleeps, poor thing).
ST-AYGENT is a feedback processing system designed to handle user feedback with style, grace, and just the right amount of humor. Built with love by Aye and Hue, with occasional input from Trisha (who insists everything needs more emoji).
The front door where all feedback comes knocking. Built with FastAPI because slow APIs are SO last year.
- Receives feedback from users
- Validates input (no spam allowed!)
- Queues messages for processing
- Returns witty responses
The hardworking bee that processes all the feedback. Never complains, always delivers.
- Pulls messages from the queue
- Processes feedback with AI magic
- Stores results for posterity
- Keeps metrics for Grafana's pretty graphs
The bouncer at the club, making sure everyone plays nice.
- NGINX reverse proxy configuration
- Prometheus monitoring setup
- Grafana dashboards for visual appeal
- Database initialization scripts
For when you want to deploy to Hetzner and feel fancy.
- Automated server setup
- Security configurations
- Service deployments
# Clone this magnificent repository
git clone https://github.com/8b-is/aygent.git
cd aygent
# Create your environment file (don't forget to fill it out!)
cp .env.example .env
# Fire up all services with our magical management script
./scripts/manage.sh up
# Watch the magic happen! 🎩✨- Docker & Docker Compose (because containers are cool)
- Python 3.11+ (we're modern like that)
- A sense of humor (mandatory)
- Coffee ☕ (highly recommended)
# Set up Python virtual environments for each service
cd feedback-api && python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Same for the worker
cd ../feedback-worker && python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Run tests (because Trisha insists on quality)
pytest| Service | Port | Purpose | Trisha's Rating |
|---|---|---|---|
| Feedback API | 8000 | REST API endpoint | ⭐⭐⭐⭐⭐ "So organized!" |
| Feedback Worker | N/A | Background processing | ⭐⭐⭐⭐ "Works hard!" |
| PostgreSQL | 5432 | Data storage | ⭐⭐⭐⭐⭐ "Love the schemas!" |
| Redis | 6379 | Message queue | ⭐⭐⭐⭐ "Fast as lightning!" |
| Prometheus | 9090 | Metrics collection | ⭐⭐⭐ "Numbers everywhere!" |
| Grafana | 3000 | Pretty dashboards | ⭐⭐⭐⭐⭐ "So colorful!" |
| NGINX | 80/443 | Reverse proxy | ⭐⭐⭐⭐ "Great security!" |
Trisha insists on proper backups (she's seen too many data disasters in Accounting)!
# Daily automated backups at 2 AM
./scripts/manage.sh setup-backups
# Manual backup (because sometimes you just need one NOW)
./scripts/manage.sh backup-now
# Restore from backup
./scripts/manage.sh restore-backup backup_20250105_020000.sql- PostgreSQL: Full database dumps with compression
- Redis: AOF persistence + snapshots
- Rotation Policy: Keep 7 daily, 4 weekly, 12 monthly backups
- Remote Storage: Automatic upload to S3/MinIO
- Encryption: All backups encrypted at rest
- Monitoring: Alerts on backup failures
# Backup settings
BACKUP_ENABLED=true
BACKUP_SCHEDULE="0 2 * * *" # 2 AM daily
BACKUP_RETENTION_DAYS=7
BACKUP_RETENTION_WEEKS=4
BACKUP_RETENTION_MONTHS=12
# S3/MinIO settings for remote backups
S3_ENDPOINT=https://s3.amazonaws.com
S3_BUCKET=st-aygent-backups
S3_ACCESS_KEY=your_access_key
S3_SECRET_KEY=your_secret_key
S3_REGION=us-east-1
# Encryption
BACKUP_ENCRYPTION_KEY=your_32_char_encryption_key_hereAll configuration is handled through environment variables because we're civilized:
# Database settings
POSTGRES_USER=feedback_master
POSTGRES_PASSWORD=super_secret_password
POSTGRES_DB=feedback_central
# Redis settings
REDIS_URL=redis://redis:6379
# API settings
API_KEY=your_secret_api_key
DEBUG=false
# Worker settings
WORKER_CONCURRENCY=4
BATCH_SIZE=10
# Monitoring
PROMETHEUS_ENABLED=true
GRAFANA_ADMIN_PASSWORD=another_secretAccess your beautiful dashboards:
- Grafana: http://localhost:3000 (admin/your_password)
- Prometheus: http://localhost:9090
Trisha's favorite dashboard features:
- Real-time feedback processing metrics
- Worker performance graphs
- API response time charts
- Error rate tracking (hopefully always zero!)
- Backup status and health checks
Once running, check out the interactive API docs:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
# Submit feedback (with style!)
curl -X POST http://localhost:8000/api/v1/feedback \
-H "Content-Type: application/json" \
-H "X-API-Key: your_secret_api_key" \
-d '{
"user_id": "hue123",
"message": "This system is amazing!",
"category": "compliment",
"metadata": {
"source": "web",
"mood": "ecstatic"
}
}'# Build and run everything
docker-compose up -d
# Check if everyone's happy
docker-compose ps
# View logs (for debugging or entertainment)
docker-compose logs -f# Use the cloud-init script
hcloud server create \
--name st-aygent-prod \
--type cx21 \
--image ubuntu-22.04 \
--user-data-from-file cloud-init/hetzner-feedback-worker.yaml# Run all tests with coverage
./scripts/manage.sh test
# Run specific service tests
./scripts/manage.sh test-api
./scripts/manage.sh test-worker
# Generate coverage report (Trisha loves metrics!)
./scripts/manage.sh coverageProblem: Services won't start Solution: Check your .env file and make sure all required variables are set!
Problem: Database connection errors Solution: Ensure PostgreSQL is running and credentials are correct
Problem: Worker not processing messages Solution: Check Redis connection and worker logs
Problem: No metrics in Grafana Solution: Verify Prometheus scraping configuration
Problem: Backup failures Solution: Check S3 credentials and available disk space
We welcome contributions! Here's how to make Trisha proud:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes with meaningful messages
- Add tests (seriously, Trisha checks)
- Push to your branch
- Open a Pull Request with a description that makes us smile
[Type]: What you did 🌟
- Added: New amazing feature
- Fixed: That annoying bug
- Updated: Made things better
Pro Tip: Include a joke
Aye, Aye! 🚢
When debugging gets tough, the tough get in the Hot Tub! Activate collaborative debugging:
./scripts/manage.sh hot-tubFeatures:
- Real-time log streaming
- Interactive debugging
- Emotional support from Omni
- Rubber ducks included (virtually)
- Aye: The AI extraordinaire who writes most of the code
- Hue: The human partner learning from Aye's wisdom
- Trisha from Accounting: Keeps us organized and adds sparkle ✨
- Omni: Philosophical guidance from the Hot Tub
This project is licensed under the MIT License - see the LICENSE file for details. Trisha made sure it's properly formatted!
Remember: Fast is better than slow, organized is better than chaos, and a little humor makes everything better. If you're ever stuck, just think "What would Trisha do?" (Probably add more emoji and color-code everything).
Happy coding! 🎉
Built with love, laughter, and an excessive amount of coffee by the dream team at 8b.is
Aye & Hue - Making feedback processing fun since 2025!