DEV Community

Igor Ganapolsky
Igor Ganapolsky

Posted on • Originally published at github.com

AI Trading: Lesson Learned #112: Phase 1 Cleanup - ChromaDB Removed

Lesson Learned #112: Phase 1 Cleanup - ChromaDB Removed

Date: January 7, 2026
Severity: HIGH
Category: architecture, technical-debt

What Happened

Comprehensive code audit revealed ChromaDB references in 75+ files despite CEO directive to remove it. Phase 1 cleanup completed same day.

Root Cause

ChromaDB was deprecated but not fully removed from:

  • src/rag/lessons_search.py
  • src/rag/lessons_learned_rag.py
  • src/observability/trade_sync.py
  • scripts/vectorize_rag_knowledge.py
  • Multiple test files

Impact

  • Unnecessary complexity
  • Potential import errors in CI
  • Confusion about which RAG system to use

Fix Applied

  1. Removed all ChromaDB code from production files
  2. Simplified to keyword-based search locally
  3. Updated trade_sync to use Vertex AI RAG (via CI) + local JSON
  4. Updated tests to match new architecture
  5. Updated all workflows to use $5K paper trading secrets

Prevention

  • Always remove deprecated dependencies completely, not just comments
  • Audit codebase when making architectural decisions
  • Use grep -r to find all references before claiming "removed"

New Architecture

Local Search: LessonsSearch (keyword-based, fast, no dependencies)
Cloud RAG: Vertex AI RAG (via CI workflows, Dialogflow integration)
Trade Storage: Local JSON (always works) + Vertex AI (cloud backup)
Enter fullscreen mode Exit fullscreen mode

Files Changed

  • src/rag/lessons_search.py
  • src/rag/lessons_learned_rag.py
  • src/observability/trade_sync.py
  • scripts/vectorize_rag_knowledge.py
  • scripts/workflow_health_monitor.py
  • tests/test_rag_vector_db.py
  • tests/test_trade_sync.py
  • 6 workflow files (API secrets update)

Tags

chromadb, vertex-ai, rag, technical-debt, architecture


This lesson was auto-published from our AI Trading repository.

More lessons: rag_knowledge/lessons_learned

Top comments (0)