I built a pipeline to automate competitive intel using BabyAGI. It works, but the AWS bill was a shock. The default setup is wasteful for a persistent service.
Initial cost: ~$280/month for light usage.
Optimized cost: ~$47/month.
**Problem:** The tutorial stack runs everything on-demand. An always-on BabyAGI with GPT-4 and a vector DB is a money pit.
**My optimized architecture:**
* **LLM:** Switched to `gpt-3.5-turbo` for the agent logic. GPT-4 is only called if 3.5's confidence is low.
* **Compute:** Moved from always-on EC2 to serverless containers.
```yaml
# Fargate task for the agent, scaled to 0 when idle
agent:
cpu: 0.25 vCPU
memory: 512MB
scale: 0-1 tasks
```
* **Vector DB:** Switched from Pinecone (expensive) to `chromadb` running locally in the Fargate task. No separate service cost.
* **Orchestration:** EventBridge triggers the pipeline daily, not a perpetual loop.
**Key savings:**
* Reserved/Spot instances aren't viable here. Serverless is key.
* GPT-4 calls reduced by 85%.
* Eliminated separate vector DB subscription.
* Compute only runs during execution window.
The pipeline works. It scrapes, summarizes, and updates a competitive matrix. But running these tools naively will burn capital.
cost per transaction is the only metric