Nine Bugs That Taught Me Reliability: Post-Mortem of a Zero-Cost Hybrid AI System
Description and use
A zero‑budget AI agent on free VMs faced nine critical bugs that highlighted the need for separating config from code, version parity, correct SQLite indexes, stable record identity in bi‑directional sync, and async handling of heavy work.
Problem
A zero‑budget hybrid local+cloud AI agent must never regress production while operating under free tier constraints.
Outcome
Implemented a robust, zero‑cost hybrid AI agent that reliably runs daily tasks without regressions, by separating configuration from code, aligning runtimes, correcting database constraints, stabilizing sync identity, and decoupling heavy work from request paths.
Workflow
- Deploy code without overwriting real credentials by using .env files
- Source .env in cron commands
- Ensure Python runtime parity across local and cloud nodes
- Replace partial SQLite index with a full unique index
- Preserve original origin IDs and skip re‑exporting local records
- Move re‑embedding to a background task and return immediately from the sync endpoint
Evidence
Credentials were living in source. "Deploy the latest code" therefore also meant "overwrite the real keys with placeholders."
The cron entry invoked python directly without sourcing .env first.
An f-string containing a backslash. Python 3.12 relaxed the f-string grammar and accepts it; 3.11 does not.
SQLite will not use a partial index as an upsert conflict arbiter.
On each export, records were re‑namespaced… identity changed every round‑trip.
Re‑embedding a few hundred chunks on a CPU‑only, memory‑starved box takes real wall‑clock time…
- Record date: 2026-10-07T04:56:04.827Z