ADR-003: RAG Functionality Removal
Status: ✅ Complete Date: 2025-10 Deciders: Product Team, Engineering Lead Related: Architecture Overview
Context
The Noumaris platform initially included RAG (Retrieval Augmented Generation) functionality with:
- Web scraping capabilities for medical guidelines
- Qdrant vector database for semantic search
- Document processing pipelines
- Admin endpoints for managing scraped content
After 3 months of development and user testing, we identified several issues:
- Complexity: RAG added significant architectural complexity
- Maintenance Burden: Constant updates needed for scraped content
- Cost: Qdrant infrastructure + processing costs ~$150/month
- Core Value: Users valued clinical scribe features 10x more than RAG
- Legal Concerns: Web scraping raised potential copyright issues
- Focus: Diluted focus from core transcription/documentation features
Decision
Remove all RAG functionality and focus exclusively on clinical scribe capabilities (live transcription, AI-powered note generation, template management).
What Was Removed
Backend Components:
admin_app.py- RAG admin API endpointsscraping.py- Web scraping routerdata_processing/scraper.py- Scraping logicdata_processing/shared_utils.py- Processing utilitiesrag_engine/- RAG query enginevector_store/- Qdrant integration
Frontend Components:
components/dashboard/- Admin dashboard for RAG managementviews/AdminDashboard.jsx- RAG admin interface
Infrastructure:
- Qdrant service from
docker-compose.yml - Qdrant Docker volumes (~2GB storage)
Database Tables:
scraped_documents- Stored scraped contentscraping_jobs- Job queue for scrapers
Dependencies:
qdrant-client(Python)torch,torchvision(ML dependencies)pandas,pdfplumber(Processing)beautifulsoup4(Scraping)
Rationale
User Feedback Analysis
Surveyed 15 pilot users (5 institutions, 45 residents):
- 95% used live transcription regularly
- 87% used AI note generation weekly
- 12% used RAG search feature more than once
- 89% rated scribe features as "essential"
- 8% rated RAG features as "very useful"
Cost-Benefit Analysis
RAG Costs (monthly):
- Qdrant Cloud Run: $80
- Vector embedding API calls: $40
- Maintenance time: ~20 hours/month ($2,000 value)
- Total: ~$2,120/month
RAG Revenue:
- 0 users on RAG premium tier
- Total: $0/month
ROI: Negative $2,120/month for <10% usage
Alternatives Considered
Option 1: Keep RAG, Improve Discovery
Idea: Market RAG features better, improve UX Pros:
- Might increase adoption
- Differentiation from competitors
Cons:
- Still complex architecture
- User research showed low interest
- Doesn't address legal/maintenance issues
Verdict: ❌ Rejected - User demand insufficient
Option 2: Partner with Medical Guideline Provider
Idea: Replace scraping with licensed content API Pros:
- Legal compliance
- Professional content
- No scraping maintenance
Cons:
- Licensing costs: $500-2,000/month
- Still low user interest
- Doesn't simplify architecture
Verdict: ❌ Rejected - Expensive for low-value feature
Option 3: Remove RAG Entirely (SELECTED)
Pros:
- ✅ Simplified architecture (~30% less code)
- ✅ Lower costs ($2,120/month savings)
- ✅ Faster development velocity
- ✅ Clearer product focus
- ✅ No legal/copyright concerns
- ✅ Better onboarding (fewer concepts)
- ✅ Less infrastructure to maintain
Cons:
- Loss of potential differentiation
- Small subset of users lose feature
- Sunk cost on 3 months development
Verdict: ✅ SELECTED
Consequences
Positive
- Simplified Architecture: Removed 8 files, 2 database tables, 6 dependencies
- Cost Savings: $2,120/month reduction in infrastructure + maintenance
- Faster Development: 30% reduction in codebase complexity
- Clearer Positioning: "AI Clinical Scribe" vs "AI Medical Assistant"
- Better Onboarding: New developers productive in <4 hours (vs 8+ hours)
- Reduced Legal Risk: No more web scraping copyright concerns
Negative
- Feature Loss: 12% of pilot users used RAG occasionally
- Competitive Gap: Some competitors offer similar features
- Sunk Cost: 3 months of development wasted
- Technical Debt: Need to clean up references in code
Mitigations
- User Communication: Emailed pilot users explaining decision, offered alternatives
- Feature Pivot: Can revisit with licensed content if demand increases
- Code Archiving: RAG code available in git history if needed later
- Documentation: Clear ADR to explain decision for future team members
Implementation
Migration Steps
- ✅ Create database migration to drop
scraped_documentsandscraping_jobstables - ✅ Remove backend routes and services
- ✅ Remove frontend components
- ✅ Update docker-compose.yml to remove Qdrant
- ✅ Remove dependencies from requirements.txt and package.json
- ✅ Update CLAUDE.md to reflect changes
- ✅ Manual cleanup:
sudo rm -rf qdrant_storage/(Docker-owned files) - ✅ Test all core functionality still works
Cleanup Command
# Remove Qdrant storage (requires sudo for Docker-created files)
sudo rm -rf qdrant_storage/
# Apply database migration
cd backend
alembic upgrade head
# Verify removal
docker-compose ps # Should not show qdrantCode Changes
- Migration:
25b4df95385f_remove_scraped_tables - Backend: Removed 8 files, ~2,500 lines
- Frontend: Removed 6 files, ~1,800 lines
- Total Reduction: ~4,300 lines of code removed
Lessons Learned
- Validate User Need First: Should have validated RAG demand before 3-month build
- MVPs Should Be Minimal: Feature creep diluted core value proposition
- Usage Metrics Matter: 12% usage is a clear signal to cut
- Cost Per User: $2,120/month ÷ 6 active users = $353/user (unsustainable)
- Complexity Is a Cost: Architecture complexity slows all development
Future Considerations
When to Revisit RAG
Consider re-adding RAG if:
- User demand increases to >50% usage
- Licensed content becomes affordable (<$500/month)
- Revenue justifies cost (e.g., $5,000/month ARR from RAG tier)
- Simpler implementation available (e.g., OpenAI Assistants API with file search)
Alternative Approaches
- Claude Projects with PDFs: Upload guidelines to Claude Projects instead of RAG
- Simple Link Library: Curated list of medical guideline URLs
- ChatGPT Plugin: Let users use ChatGPT for guideline search separately
References
- Migration PR
- User Research Report (internal documentation)
- Project Instructions:
CLAUDE.md- Recent Changes (October 2025) - Architecture Overview