Production Deployment Guide
Architecture Overview
Deployment Options
- Docker Compose
- Kubernetes
- Cloud VMs
Production Checklist
Database
1
Enable Connection Pooling
Configure For high-traffic deployments, consider PgBouncer.
DB_POOL_SIZE and DB_MAX_OVERFLOW:2
Set Up Backups
Schedule regular pg_dump backups:
3
Configure Read Replicas (Optional)
For read-heavy workloads, add read replicas:
4
Monitor Query Performance
Enable slow query logging:
Security
1
Rotate API Keys
Generate strong API keys and rotate regularly:
2
Enable TLS
Always use HTTPS in production. Configure your reverse proxy (nginx, Traefik, etc.):
3
Network Isolation
- Place PostgreSQL in a private subnet
- Use VPC security groups to restrict access
- Never expose PostgreSQL to the internet
4
Secrets Management
Use a secrets manager instead of environment files:
- AWS Secrets Manager
- HashiCorp Vault
- GCP Secret Manager
You’ll need to write custom code to fetch secrets at startup.
Monitoring
1
Health Checks
Monitor the Set up alerts for non-200 responses.
/health endpoint:2
Prometheus Metrics
Scrape Available metrics:
/metrics endpoint:aegis_memory_add_totalaegis_memory_query_totalaegis_memory_query_latency_seconds
3
Log Aggregation
Ship logs to your log aggregation system:
4
Alerting
Set up alerts for:
- API error rate > 1%
- Query latency p99 > 500ms
- Database connections > 80% of pool
- Disk usage > 80%
Scaling
Horizontal Scaling (API)
Horizontal Scaling (API)
The Aegis API is stateless and can be horizontally scaled:Use a load balancer (nginx, HAProxy, cloud LB) in front.
Vertical Scaling (Database)
Vertical Scaling (Database)
PostgreSQL with pgvector benefits from:
- More RAM (for HNSW index caching)
- Faster SSDs
- More CPU cores for parallel queries
HNSW Index Tuning
HNSW Index Tuning
Disaster Recovery
Backup Strategy
Restore Procedure
Cost Estimation
Costs scale primarily with:
- Number of memories stored (database size)
- Query volume (compute + embeddings)
- Embedding calls (OpenAI API costs)
Need Help?
Production deployment requires careful planning. If you’re facing challenges:GitHub Issues
Report bugs or ask questions
Community Discord
Get help from the community
Coming Soon: We’re working on a managed platform that handles all of this for you. Join the waitlist to be notified when it launches.