# profile_first_optimize_second ## v1 **Why this iteration:** Lifted from `docs/reports/2026-05-11/ai_decoupling_revert_report.md` ยง"Lessons Learned". The agent decoupled the AI client SDK imports from the main GUI under the assumption that the heavy SDKs caused startup latency; profiling later showed RAG initialization was the actual 5+ second bottleneck. The decoupling work was reverted; the lazy RAG import fix landed instead. The principle generalizes: do not reach for an architectural change until profiling has named the specific bottleneck. **Source:** `docs/reports/2026-05-11/ai_decoupling_revert_report.md:116-121` --- **Lifted:** 2026-07-03 (scavenge sweep batch 2/5: docs/reports/2026-05-11 + 2026-06-01)