| Metadata |
Value |
| Status |
Archived |
| Version |
1.0.0 |
| Last Updated |
2026-09-10 |
| Author |
Sangeetha Grantha Team |
| Document Type |
Archive |
Krithi Data Import and Orchestration - Comprehensive Analysis
[!NOTE]
Historical evidence: results, counts, commands, and observations below belong to the original work described here. The editorial update date is not a new test or corpus verification. For present behavior, use current ingestion guide.
Document Version: 1.0
Date: January 19, 2026
Author: Analysis for Sangeetha Grantha Application
Executive Summary
This document provides a comprehensive analysis of building an import capability for Carnatic music Krithis from multiple web sources, with associated metadata including Raga, Deity, and Temple/Kshetra information. The analysis covers data source characteristics, technical challenges, architecture options, and recommendations for orchestration approaches.
1. Data Source Analysis
1.1 Primary Krithi Sources
Source 1: Karnatik.com
- Type: Dedicated Carnatic music resource
- Expected Structure: Organized lyrics database
- Typical Metadata: Krithi name, Composer, Raga, Tala, Language
- Format Challenges:
- HTML-based content requiring web scraping
- Potentially inconsistent formatting across entries
- May include transliteration variations (Tamil, Telugu, Sanskrit, IAST)
- Data Quality: Generally high, but may have spelling variations
- Estimated Volume: Medium to High (hundreds to thousands of entries)
Source 2: Guru-Guha Blogspot
- Type: Blog-based content (focus on Murugan/Subramanya compositions)
- Expected Structure: Blog posts with individual krithi entries
- Typical Metadata: Krithi, Composer, Raga, Deity (primarily Murugan)
- Format Challenges:
- Unstructured blog post format
- Varies by post author and date
- May include commentary mixed with lyrics
- Requires NLP to extract structured data
- Data Quality: Medium - needs human verification
- Estimated Volume: Medium (focused on specific deity)
Source 3: Syama Krishna Vaibhavam
- Type: Alphabetical list of Krishna-focused Krithis
- Expected Structure: Alphabetically organized list
- Typical Metadata: Krithi name, Raga, Composer
- Format Challenges:
- List-based format on blog platform
- May lack detailed metadata
- Deity information implicit (Krishna-focused)
- Data Quality: Medium
- Estimated Volume: Medium (deity-specific collection)
Source 4: Thyagaraja Vaibhavam
- Type: Alphabetical list of Thyagaraja compositions
- Expected Structure: Alphabetically organized list
- Typical Metadata: Krithi name, Raga, possibly Tala
- Format Challenges:
- Composer is implicit (all Thyagaraja)
- Deity information may need to be extracted from krithi meaning
- List format on blog platform
- Data Quality: Medium to High (focused collection)
- Estimated Volume: High (Thyagaraja composed ~24,000 krithis, though not all online)
Source 5: TempleNet.com
- Type: Temple database and information portal
- Expected Structure: Temple directory with deity associations
- Typical Metadata: Temple name, Location, Deity, Kshetra classification, History
- Format Challenges:
- Requires mapping temple/deity to krithi associations
- Many-to-many relationships (one krithi may reference multiple temples/deities)
- Geographic and traditional name variations
- Data Quality: High for temple data, complex for krithi mapping
- Estimated Volume: Large (thousands of temples)
1.2 Data Source Comparison Matrix
| Source |
Structure |
Metadata Richness |
Extract Difficulty |
Data Quality |
Update Frequency |
| Karnatik.com |
Semi-structured |
High |
Medium |
High |
Low |
| Guru-Guha |
Unstructured |
Medium |
High |
Medium |
Low |
| Syama Krishna |
List-based |
Low-Medium |
Medium |
Medium |
Very Low |
| Thyagaraja |
List-based |
Low-Medium |
Medium |
Medium-High |
Very Low |
| TempleNet |
Semi-structured |
High |
Medium |
High |
Low |
2. Data Model Requirements
2.1 Core Entities
Krithi
├── id (UUID)
├── name (primary, with transliteration variants)
├── name_variants (array of transliterations: IAST, Tamil, Telugu, Devanagari)
├── composer_id (FK)
├── raga_id (FK)
├── tala_id (FK)
├── language_id (FK)
├── lyrics (full text with lines/sections)
├── meaning (optional)
├── pallavi, anupallavi, charanam (structured lyrics)
├── created_at
├── updated_at
├── source_urls (array)
├── verification_status (enum: unverified, verified, expert_verified)
Raga
├── id
├── name (primary)
├── name_variants
├── melakarta_number (if applicable)
├── arohanam
├── avarohanam
├── janya_of (FK to parent raga)
Composer
├── id
├── name
├── name_variants
├── period (time period)
├── language_primary
├── bio
Deity
├── id
├── name
├── name_variants (Vishnu/Perumal/Narayana)
├── pantheon
├── iconography
Temple/Kshetra
├── id
├── name
├── name_variants
├── location
├── primary_deity_id (FK)
├── secondary_deities (array of FK)
├── kshetra_type (Divya Desam, Jyotirlinga, Shakti Peetha, etc.)
├── region
Krithi_Deity (many-to-many)
├── krithi_id
├── deity_id
├── is_primary (boolean)
Krithi_Temple (many-to-many)
├── krithi_id
├── temple_id
├── reference_type (composed_at, about, dedicated_to)
2.2 Data Relationships
- One Krithi → One Raga (primary, though some rare krithis use raga malika)
- One Krithi → One Composer
- One Krithi → Multiple Deities (many-to-many)
- One Krithi → Multiple Temples (many-to-many)
- One Temple → Multiple Deities
- One Deity → Multiple Temples
3. Data Challenges and Cleansing Requirements
3.1 Data Quality Issues
Name Variations and Transliteration
Challenge: Same krithi appears with different spellings
- Example: “Endaro Mahanubhavulu” vs “Entaro Mahanubhavulu”
- Example: “Raghuvamsa” vs “Raghuvamsha”
- Tamil vs Telugu vs IAST vs ISO-15919 vs simplified English
Solution Approach:
- Phonetic matching algorithms (Soundex, Metaphone, custom for Indian languages)
- Fuzzy string matching (Levenshtein distance)
- Master canonical name with variants table
- Manual verification for high-confidence thresholds
Raga Name Variations
Challenge: Different schools use different names
- Example: “Mayamalavagowla” vs “Mayamalavagoula” vs “Mayamalavagaula”
- Regional variations (Karnataka vs Tamil traditions)
Solution Approach:
- Raga normalization dictionary
- Master raga database with aliases
- Community verification
Composer Attribution
Challenge: Multiple composers with similar names
- Example: Muthuswami Dikshitar vs other Dikshitar family members
- Traditional vs modern composers
Solution Approach:
- Composer disambiguation using time period, language, style
- Cross-reference with authoritative sources
Deity Identification
Challenge: Multiple names for same deity
- Example: Rama/Raghuvira/Raghunatha/Dasharathi
- Regional naming conventions
Solution Approach:
- Deity synonym database
- Hierarchical deity taxonomy
- NLP extraction from krithi lyrics and meaning
Temple Association
Challenge: Linking krithis to temples
- Many krithis don’t explicitly mention temples
- Temple names change over time
- Geographic variations in temple names
Solution Approach:
- Deity-based inference (Krithi about Venkateshwara → Tirupati)
- Lyrics analysis for geographic references
- Composer biography cross-reference
- Expert curation required
3.2 De-duplication Strategy
Level 1: Exact Match
- Hash-based comparison (normalized krithi name + composer)
- Fastest, catches obvious duplicates
Level 2: Fuzzy Matching
- Edit distance < threshold (e.g., 3 characters)
- Phonetic similarity
- Catches transliteration variants
Level 3: Semantic Matching
- Compare first line (pallavi) using NLP
- Raga + Composer + Language combination
- Higher confidence but slower
Level 4: Manual Review
- Present near-duplicates to human moderators
- Confidence score-based queue
- Expert verification for edge cases
Proposed De-duplication Pipeline
Raw Import →
Exact Match (automated merge) →
Fuzzy Match (high confidence: auto-merge, medium: flag) →
Semantic Match (all flagged) →
Manual Review Queue →
Final Database
3.3 Data Moderation Requirements
Verification Levels
- Unverified: Auto-imported, not reviewed
- System-Verified: Passed all automated checks
- Human-Verified: Reviewed by contributor
- Expert-Verified: Verified by recognized authority
Moderation Workflow
- Flagging system for disputed entries
- Edit history tracking
- Contributor reputation system
- Expert review queue
- Community voting (optional)
4. Technical Architecture Options
4.1 Option A: Custom Python-based Pipeline
Architecture
Web Scrapers (BeautifulSoup/Scrapy) →
Raw Data Storage (JSON/CSV) →
ETL Pipeline (Python/Pandas) →
Cleansing Engine (Custom Scripts) →
De-duplication Engine (FuzzyWuzzy/Dedupe) →
Staging Database (PostgreSQL) →
Manual Review Interface (Web App) →
Production Database
Pros
- Full control over logic
- Flexible and customizable
- Lower cost (open-source tools)
- Can integrate with existing Python ecosystem
Cons
- Significant development effort
- Requires maintaining custom code
- Need to build orchestration from scratch
- Scaling requires manual optimization
Technology Stack
- Scraping: Scrapy, BeautifulSoup4, Selenium (for JS-heavy sites)
- Data Processing: Pandas, NumPy
- NLP: spaCy, NLTK, IndicNLP
- Fuzzy Matching: FuzzyWuzzy, Python-Levenshtein, Dedupe.io
- Orchestration: Apache Airflow or Prefect
- Database: PostgreSQL with full-text search
- Caching: Redis
- API: FastAPI or Django REST
Estimated Effort
- Initial Development: 3-4 months (1-2 developers)
- Per-source scraper: 1-2 weeks
- De-duplication engine: 3-4 weeks
- Review interface: 4-6 weeks
- Testing and refinement: 4-6 weeks
Cost
- Development: High upfront (developer time)
- Infrastructure: Low-Medium (~$50-200/month)
- Maintenance: Medium (ongoing developer time)
4.2 Option B: Koog.ai-based Orchestration
Koog Connectors/Scrapers →
Koog Data Pipeline →
Koog Transformation Rules →
Koog Quality Checks →
Koog De-duplication →
Review Interface →
Target Database
- Visual workflow builder
- Pre-built connectors (may need custom for these sources)
- Data transformation rules engine
- Quality check framework
- Automated de-duplication (rule-based)
- Monitoring and alerting
- Incremental updates
Pros
- Faster time to market (if connectors exist)
- Built-in orchestration
- Managed infrastructure
- UI for non-technical users
- Built-in monitoring
Cons
- Platform lock-in
- Cost per volume/features
- May lack flexibility for edge cases
- Custom logic might be limited
- Dependent on platform roadmap
Considerations for Koog.ai
Need to Verify:
- Does Koog support web scraping or only API-based sources?
- Can it handle unstructured blog content?
- What NLP capabilities exist for Indian languages?
- De-duplication sophistication level
- Pricing model (per row, per pipeline, subscription?)
- Custom code integration (Python/JavaScript)
Estimated Effort
- Initial Setup: 2-4 weeks
- Per-source configuration: 3-5 days
- Custom logic development: 2-4 weeks (if supported)
- Testing: 2-3 weeks
Cost
- Platform Subscription: Unknown (typically $500-5000/month for enterprise)
- Development: Medium (configuration time)
- Infrastructure: Included in subscription
4.3 Option C: Hybrid Approach
Architecture
Custom Scrapers (Python) →
Data Lake (S3/MinIO) →
Koog.ai or Airflow for Orchestration →
Custom Cleansing Scripts →
Koog De-duplication or Custom →
Staging DB →
Custom Review Interface →
Production DB
Pros
- Best of both worlds
- Use Koog for orchestration only
- Custom code where needed
- Flexibility with some automation
Cons
- More complex architecture
- Multiple systems to maintain
- Integration overhead
4.4 Option D: Cloud-Native ETL (AWS Glue/Azure Data Factory/Google Dataflow)
Architecture
Lambda/Cloud Functions (Scrapers) →
S3/Blob Storage (Raw Data) →
AWS Glue/Azure Data Factory (ETL) →
Custom Processing (Containers) →
RDS/Cloud SQL (Staging) →
Application Review Interface →
Production Database
Pros
- Scalable
- Managed infrastructure
- Pay-per-use pricing
- Integration with cloud ecosystem
Cons
- Cloud vendor lock-in
- Requires cloud expertise
- Costs can escalate
- Complex for simple use cases
Estimated Cost
- Development: Medium-High
- Infrastructure: Medium ($100-500/month depending on volume)
- Scalability: Excellent
5. Orchestration Requirements
5.1 Workflow Stages
- Frequency: Weekly or monthly (sources update infrequently)
- Tasks:
- Scrape each source URL
- Extract structured data
- Store raw HTML/JSON
- Error handling and retry logic
- Monitoring: Success rate, new entries found, errors
- Duration: 30 minutes - 2 hours per run
- Tasks:
- Parse HTML to structured format
- Extract metadata fields
- Normalize text (Unicode, whitespace)
- Transliteration standardization
- Language detection
- Validation: Schema compliance, required fields present
- Duration: 1-3 hours
Stage 3: Data Enrichment
- Tasks:
- Raga lookup and normalization
- Composer identification
- Deity extraction (NLP from lyrics)
- Temple association (where explicit)
- External APIs: May call TempleNet API if available
- Duration: 2-4 hours
Stage 4: De-duplication
- Tasks:
- Exact match detection
- Fuzzy matching
- Semantic similarity
- Merge duplicate records
- Human-in-loop: Flag uncertain cases
- Duration: 1-2 hours
Stage 5: Quality Checks
- Tasks:
- Completeness checks (required fields)
- Consistency checks (valid raga, known composer)
- Cross-reference validation
- Outlier detection
- Alerts: Send notifications for anomalies
- Duration: 30 minutes
Stage 6: Staging and Review
- Tasks:
- Load to staging database
- Generate review reports
- Queue items for manual moderation
- Track review status
- Interface: Web-based review tool
- Duration: Depends on manual review capacity
Stage 7: Production Deployment
- Tasks:
- Incremental load to production
- Update search indices
- Clear caches
- Backup before deployment
- Rollback: Maintain ability to revert
- Duration: 15-30 minutes
5.2 Orchestration Features Needed
Essential Features
- Scheduling: Cron-based or event-driven triggers
- Dependency Management: Stage 2 waits for Stage 1, etc.
- Error Handling: Retry logic, failure notifications
- Monitoring: Dashboard showing pipeline status
- Logging: Detailed logs for debugging
- Alerting: Email/Slack notifications on failures
- Idempotency: Re-running stages doesn’t create duplicates
Advanced Features
- Incremental Processing: Only process new/changed data
- Parallel Execution: Process multiple sources simultaneously
- Version Control: Track data lineage and transformations
- A/B Testing: Test new cleansing rules on subset
- Rollback: Revert to previous data version
- API Integration: Expose pipeline triggers via API
6. Detailed Comparison: Custom vs Koog.ai
6.1 Development Complexity
| Aspect |
Custom Python |
Koog.ai |
Hybrid |
| Web Scraping |
High (build scrapers) |
Medium (if supported) |
Medium (custom) |
| Orchestration |
High (Airflow setup) |
Low (built-in) |
Low |
| Data Transformation |
High (custom code) |
Medium (visual rules) |
Medium |
| De-duplication |
High (algorithm dev) |
Low (if built-in) |
Medium |
| NLP Integration |
High (custom) |
Unknown |
High |
| Review Interface |
High (build from scratch) |
Medium (if included) |
High |
| Maintenance |
High |
Low-Medium |
Medium |
6.2 Feature Comparison
| Feature |
Custom |
Koog.ai |
Hybrid |
| Web Scraping |
✅ Full control |
❓ Unknown |
✅ Full control |
| Indian Language NLP |
✅ IndicNLP |
❓ Unknown |
✅ Custom |
| Complex De-dup Logic |
✅ Custom algorithms |
⚠️ May be limited |
✅ Custom |
| Visual Workflow |
❌ Code-based |
✅ Likely |
⚠️ Partial |
| Scalability |
⚠️ Manual optimization |
✅ Built-in |
✅ Good |
| Cost |
Low infra, high dev |
High subscription |
Medium |
| Flexibility |
✅ Unlimited |
⚠️ Platform limits |
✅ High |
| Time to Market |
Slow (3-4 months) |
Fast (1-2 months) |
Medium (2-3 months) |
6.3 Cost Analysis (Annual Estimates)
Custom Python Solution
- Development: $30,000 - $50,000 (developer time)
- Infrastructure: $600 - $2,400/year (hosting, DB)
- Maintenance: $10,000 - $15,000/year
- Total Year 1: $40,600 - $67,400
- Total Year 2+: $10,600 - $17,400/year
Koog.ai Solution (Estimated)
- Platform Subscription: $6,000 - $60,000/year (wide range, depends on tier)
- Initial Setup: $5,000 - $15,000 (configuration)
- Custom Development: $5,000 - $20,000 (if needed)
- Maintenance: $5,000 - $10,000/year
- Total Year 1: $21,000 - $105,000
- Total Year 2+: $11,000 - $70,000/year
Hybrid Solution
- Development: $20,000 - $35,000
- Platform/Orchestration: $3,000 - $12,000/year (Airflow managed or light Koog)
- Infrastructure: $1,200 - $3,600/year
- Maintenance: $8,000 - $12,000/year
- Total Year 1: $32,200 - $62,600
- Total Year 2+: $12,200 - $27,600/year
7. Recommended Approach
7.1 Phase 1: Proof of Concept (Recommended Start)
Approach: Custom Python Pipeline (Minimal)
Rationale:
- Data sources are relatively static (low update frequency)
- Need to understand data quality issues firsthand
- Custom NLP required for Indian languages
- Complex de-duplication logic needs experimentation
- Avoid platform commitment until requirements are clear
Scope:
- Build scraper for ONE source (Karnatik.com recommended - highest quality)
- Create basic ETL pipeline
- Implement simple de-duplication
- Build minimal review interface
- Manual temple/deity association
- Import 50-100 krithis end-to-end
Technology:
- Scrapy for web scraping
- Pandas for data processing
- PostgreSQL for storage
- Simple Flask/FastAPI review interface
- Manual orchestration (cron jobs)
Timeline: 6-8 weeks
Cost: ~$8,000 - $12,000
Success Criteria:
- Successfully import 50+ krithis
- Identify data quality patterns
- Validate de-duplication approach
- Test deity/temple association logic
7.2 Phase 2: Production Pipeline
Approach: Hybrid (Custom Code + Airflow Orchestration)
Rationale:
- PoC validates technical approach
- Need orchestration for reliability
- Airflow is open-source (no licensing cost)
- Keep custom code for flexibility
- Proven architecture for data pipelines
Scope:
- Extend to all 4 krithi sources
- Integrate TempleNet data
- Full de-duplication pipeline
- Enhanced review interface
- Airflow workflows for orchestration
- Monitoring and alerting
- API for application integration
Technology:
- Scrapers: Scrapy framework
- Orchestration: Apache Airflow
- Processing: Pandas, NumPy
- NLP: spaCy + IndicNLP
- Fuzzy Matching: Dedupe.io library
- Database: PostgreSQL with trigram indices
- Search: PostgreSQL full-text or Elasticsearch
- Review UI: React + FastAPI
- Deployment: Docker containers
Timeline: 3-4 months
Cost: ~$30,000 - $45,000
7.3 Koog.ai Evaluation Criteria
Consider Koog.ai if:
- They have proven web scraping capabilities
- Support for custom Python code integration
- Reasonable pricing (< $1,000/month)
- Good de-duplication features
- Can handle Indian language text
- Strong visual workflow builder reduces dev time significantly
Evaluation Steps:
- Request Koog.ai demo focused on web scraping use case
- Ask about Indian language support
- Test with sample data from one source
- Compare development time vs custom approach
- Get detailed pricing
- Check exit strategy (data export)
Decision Point: After PoC completion, evaluate if Koog.ai can reduce Phase 2 timeline by >40% at reasonable cost
8. Implementation Roadmap
Phase 1: Proof of Concept (Weeks 1-8)
Week 1-2: Setup and First Scraper
- Environment setup
- Study Karnatik.com structure
- Build first scraper
- Raw data extraction test
Week 3-4: ETL Pipeline
- Data transformation logic
- Database schema design
- Basic data loading
Week 5-6: De-duplication
- Implement fuzzy matching
- Test on sample data
- Tune thresholds
Week 7-8: Review Interface and Testing
- Simple review UI
- Manual deity/temple association
- End-to-end test with 50-100 krithis
- Document lessons learned
Phase 2: Production System (Months 3-6)
Month 3: Multi-Source Integration
- Scrapers for all 4 krithi sources
- TempleNet integration
- Standardize data formats
Month 4: Advanced Processing
- NLP for deity extraction
- Improved de-duplication
- Airflow workflow setup
- Automated quality checks
Month 5: Review System
- Production review interface
- User authentication
- Edit history tracking
- Moderation workflows
Month 6: Production Deployment
- Testing and QA
- Performance optimization
- Monitoring setup
- API development
- Documentation
- Production launch
Phase 3: Ongoing Operations (Month 7+)
Monthly:
- Run extraction pipelines
- Review new entries
- Monitor data quality
Quarterly:
- Add new sources if identified
- Refine de-duplication rules
- Community feedback integration
Annually:
- Major data quality audit
- Platform evaluation
- Feature enhancements
9. Risk Analysis and Mitigation
9.1 Technical Risks
| Risk |
Impact |
Probability |
Mitigation |
| Website structure changes break scrapers |
High |
Medium |
Version scrapers, automated tests, alerts |
| Data quality worse than expected |
High |
Medium |
PoC validates first, manual review queue |
| De-duplication too complex |
Medium |
Medium |
Phased approach, expert review layer |
| Indian language NLP challenges |
Medium |
High |
Use IndicNLP library, manual fallback |
| Scale issues with thousands of krithis |
Medium |
Low |
Database optimization, caching, pagination |
| Temple association ambiguity |
Medium |
High |
Accept as limitation, expert curation |
9.2 Operational Risks
| Risk |
Impact |
Probability |
Mitigation |
| Insufficient manual review capacity |
Medium |
Medium |
Prioritize high-confidence items, community |
| Source websites go offline |
Medium |
Low |
Archive raw data, diversify sources |
| Copyright/legal issues with lyrics |
High |
Low |
Ensure only metadata, first lines, links |
| Platform lock-in if using Koog |
Medium |
Medium |
Avoid Koog initially, keep data portable |
| Maintenance burden too high |
Medium |
Medium |
Good documentation, simple architecture |
9.3 Business Risks
| Risk |
Impact |
Probability |
Mitigation |
| Budget overruns |
Medium |
Medium |
Phased approach, PoC first |
| Timeline delays |
Medium |
Medium |
Conservative estimates, agile approach |
| User adoption of review interface |
Low |
Medium |
Simple UX, expert engagement |
| Data completeness concerns |
Medium |
High |
Set expectations, continuous improvement |
10. Alternative Approaches
Model: Wikipedia-style contribution platform
Approach:
- Build web interface for community to add/edit krithis
- Seed with automated import
- Expert verification layer
Pros:
- Higher quality from experts
- Continuous updates
- Community engagement
Cons:
- Slower initial population
- Requires community management
- Quality varies by contributor
Recommendation: Combine with automated import - use automation for bulk, community for enhancement
10.2 Commercial Data Purchase
Approach: License data from commercial Carnatic music platforms
Pros:
- Immediate data availability
- Higher quality
- Legal clarity
Cons:
- Expensive
- Limited to available datasets
- Ongoing licensing costs
- May not have temple associations
Recommendation: Explore as supplement, not primary strategy
10.3 Academic Partnership
Approach: Partner with music universities/research institutions
Pros:
- Expert knowledge
- Potential funding
- Academic rigor
Cons:
- Slow process
- Limited technical resources
- May have different goals
Recommendation: Good for validation and expertise, not primary data source
11. Success Metrics
11.1 Import Pipeline Metrics
- Coverage: % of known krithis imported (target: 70%+ of popular krithis)
- Quality: % of records with complete metadata (target: 85%+)
- Accuracy: % of records verified by experts (target: 50%+ in year 1)
- De-duplication: False positive rate < 5%, False negative rate < 10%
- Throughput: Import speed (target: 100+ krithis/day after automation)
- Freshness: Time from source update to import (target: < 1 week)
11.2 Data Quality Metrics
- Completeness:
- Krithi name: 100%
- Raga: 95%+
- Composer: 90%+
- Deity: 70%+
- Temple: 40%+ (lower acceptable due to difficulty)
- Lyrics: 60%+
- Consistency:
- Raga name standardization: 95%+
- Composer attribution consistency: 95%+
- Transliteration consistency: 90%+
11.3 Operational Metrics
- Pipeline Reliability: 99%+ successful runs
- Error Rate: < 5% of records fail processing
- Review Throughput: Target manual review capacity
- Time to Production: < 1 week from import to production
12. Technology Stack Recommendation
12.1 Core Technologies
Programming Language: Python 3.11+
- Rich ecosystem for data processing
- Excellent library support
- Good NLP tools
Web Scraping:
- Scrapy: Robust framework, handles JS, rate limiting
- BeautifulSoup4: For simple HTML parsing
- Selenium: For JavaScript-heavy sites (if needed)
Data Processing:
- Pandas: Data manipulation and analysis
- NumPy: Numerical operations
- IndicNLP: Indian language processing
NLP and Matching:
- spaCy: Modern NLP library
- FuzzyWuzzy/RapidFuzz: Fuzzy string matching
- Dedupe.io: Advanced de-duplication
- Indic-nlp-library: Sanskrit/Tamil/Telugu processing
Orchestration:
- Apache Airflow: Open-source workflow management
- Alternative: Prefect (more modern, Python-native)
Database:
- PostgreSQL 15+:
- Full-text search (for lyrics)
- Trigram indices (for fuzzy matching)
- JSONB for flexible metadata
- Strong data integrity
- Redis: Caching and session management
API Layer:
- FastAPI: Modern, fast, automatic API docs
- Alternative: Django REST Framework (if need full framework)
Frontend (Review Interface):
- React: Component-based UI
- Material-UI or Ant Design: Pre-built components
- Alternative: Vue.js
Infrastructure:
- Docker: Containerization
- Docker Compose: Local development
- Alternative Cloud: AWS/GCP/Azure for production
Monitoring:
- Prometheus + Grafana: Metrics and dashboards
- Sentry: Error tracking
- Logstash/ELK: Log aggregation
13. Conclusion and Recommendations
13.1 Primary Recommendation
Implement a phased, custom Python-based approach with Airflow orchestration:
- Start with Proof of Concept (8 weeks, ~$10K)
- Validate technical approach
- Understand data quality
- Test de-duplication logic
- Single source (Karnatik.com)
- Evaluate Koog.ai in parallel
- Request demo and trial
- Test with PoC data
- Compare cost/benefit
- Make informed decision
- Build Production System (4 months, ~$35K)
- If Koog.ai proves valuable: Hybrid approach
- If not: Full custom with Airflow
- All sources integrated
- Complete review workflow
- Launch and Iterate (Ongoing)
- Community feedback
- Continuous data quality improvement
- Add sources as discovered
13.2 Koog.ai Specific Recommendation
Do not commit to Koog.ai without thorough evaluation:
Required Validation:
- Confirm web scraping capabilities for your specific sources
- Test Indian language text handling
- Verify de-duplication sophistication
- Understand pricing model fully
- Check customer references with similar use cases
- Ensure data portability (can export if you leave platform)
Use Koog.ai if:
- Reduces development time by 50%+
- Total cost over 3 years is comparable to custom
- Provides meaningful features beyond orchestration
- Strong support for your use case
Avoid Koog.ai if:
- Primarily API-based (won’t help with web scraping)
- Pricing is > $15,000/year without clear ROI
- Limited flexibility for custom logic
- Poor support for your specific sources
13.3 Critical Success Factors
- Start Small: PoC before major investment
- Data Quality First: Perfect 100 records better than poor 10,000
- Expert Involvement: Engage Carnatic music experts for validation
- Flexible Architecture: Avoid lock-in, keep options open
- Incremental Value: Release data in phases, don’t wait for perfection
- Community Engagement: Consider crowdsourcing for enhancement
- Documentation: Document all transformations and business rules
13.4 Next Steps
Immediate (Week 1-2):
- Approve recommended approach
- Set up development environment
- Request Koog.ai demo (parallel track)
- Identify 1-2 Carnatic music experts for consultation
- Define initial database schema
Short-term (Month 1-2):
- Build first scraper
- Create basic ETL pipeline
- Test de-duplication approaches
- Evaluate Koog.ai trial results
- Make build-vs-buy decision
Medium-term (Month 3-6):
- Expand to all sources
- Production pipeline development
- Review interface
- Testing and refinement
- Initial data release
14. Appendices
Appendix A: Sample Data Schema (SQL)
– Core Krithi Table
CREATE TABLE krithis (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
name_iast VARCHAR(255),
name_tamil VARCHAR(255),
name_telugu VARCHAR(255),
composer_id UUID REFERENCES composers(id),
raga_id UUID REFERENCES ragas(id),
tala_id UUID REFERENCES talas(id),
language VARCHAR(50),
lyrics_pallavi TEXT,
lyrics_anupallavi TEXT,
lyrics_charanam TEXT,
lyrics_full TEXT,
meaning TEXT,
source_urls JSONB,
verification_status VARCHAR(50) DEFAULT ‘unverified’,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW(),
created_by VARCHAR(100),
UNIQUE(name, composer_id)
);
– Raga Table
CREATE TABLE ragas (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(100) NOT NULL UNIQUE,
name_variants JSONB,
melakarta_number INT,
arohanam VARCHAR(255),
avarohanam VARCHAR(255),
parent_raga_id UUID REFERENCES ragas(id)
);
– Composer Table
CREATE TABLE composers (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(100) NOT NULL,
name_variants JSONB,
period_start INT,
period_end INT,
language_primary VARCHAR(50),
biography TEXT
);
– Deity Table
CREATE TABLE deities (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(100) NOT NULL,
name_variants JSONB,
pantheon VARCHAR(50),
description TEXT
);
– Temple Table
CREATE TABLE temples (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
name_variants JSONB,
location VARCHAR(255),
city VARCHAR(100),
state VARCHAR(100),
country VARCHAR(50),
primary_deity_id UUID REFERENCES deities(id),
kshetra_type VARCHAR(100),
description TEXT
);
– Krithi-Deity Many-to-Many
CREATE TABLE krithi_deities (
krithi_id UUID REFERENCES krithis(id) ON DELETE CASCADE,
deity_id UUID REFERENCES deities(id) ON DELETE CASCADE,
is_primary BOOLEAN DEFAULT FALSE,
PRIMARY KEY (krithi_id, deity_id)
);
– Krithi-Temple Many-to-Many
CREATE TABLE krithi_temples (
krithi_id UUID REFERENCES krithis(id) ON DELETE CASCADE,
temple_id UUID REFERENCES temples(id) ON DELETE CASCADE,
reference_type VARCHAR(50), – ‘composed_at’, ‘about’, ‘dedicated_to’
PRIMARY KEY (krithi_id, temple_id)
);
– Temple-Deity Many-to-Many
CREATE TABLE temple_deities (
temple_id UUID REFERENCES temples(id) ON DELETE CASCADE,
deity_id UUID REFERENCES deities(id) ON DELETE CASCADE,
is_primary BOOLEAN DEFAULT FALSE,
PRIMARY KEY (temple_id, deity_id)
);
– Indices for Performance
CREATE INDEX idx_krithis_name_trgm ON krithis USING gin (name gin_trgm_ops);
CREATE INDEX idx_krithis_raga ON krithis(raga_id);
CREATE INDEX idx_krithis_composer ON krithis(composer_id);
CREATE INDEX idx_krithis_verification ON krithis(verification_status);
CREATE INDEX idx_krithi_deities_deity ON krithi_deities(deity_id);
CREATE INDEX idx_krithi_temples_temple ON krithi_temples(temple_id);
-- Full-text search
CREATE INDEX idx_krithis_lyrics_fts ON krithis USING gin(to_tsvector('english', lyrics_full));
Appendix B: Sample Airflow DAG Structure
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime, timedelta
default_args = {
‘owner’: ‘sangeetha-grantha’,
‘depends_on_past’: False,
‘start_date’: datetime(2026, 1, 1),
‘email_on_failure’: True,
‘email_on_retry’: False,
‘retries’: 2,
‘retry_delay’: timedelta(minutes=5),
}
with DAG(
‘krithi_import_pipeline’,
default_args=default_args,
description=’Import krithis from multiple sources’,
schedule_interval=’@weekly’,
catchup=False
) as dag:
# Stage 1: Extraction
scrape_karnatik = PythonOperator(
task_id='scrape_karnatik',
python_callable=scrape_karnatik_com,
)
scrape_guruguha = PythonOperator(
task_id='scrape_guruguha',
python_callable=scrape_guruguha_blog,
)
scrape_syamakrishna = PythonOperator(
task_id='scrape_syamakrishna',
python_callable=scrape_syamakrishna_blog,
)
scrape_thyagaraja = PythonOperator(
task_id='scrape_thyagaraja',
python_callable=scrape_thyagaraja_blog,
)
# Stage 2: Transformation
transform_data = PythonOperator(
task_id='transform_data',
python_callable=transform_raw_data,
)
# Stage 3: Enrichment
enrich_metadata = PythonOperator(
task_id='enrich_metadata',
python_callable=enrich_with_metadata,
)
# Stage 4: De-duplication
deduplicate = PythonOperator(
task_id='deduplicate',
python_callable=run_deduplication,
)
# Stage 5: Quality Checks
quality_checks = PythonOperator(
task_id='quality_checks',
python_callable=run_quality_checks,
)
# Stage 6: Load to Staging
load_staging = PythonOperator(
task_id='load_staging',
python_callable=load_to_staging_db,
)
# Dependencies
```text
[scrape_karnatik, scrape_guruguha, scrape_syamakrishna, scrape_thyagaraja] >> transform_data
transform_data >> enrich_metadata >> deduplicate >> quality_checks >> load_staging ```
Appendix C: Deity Name Normalization Examples
Sample deity normalization dictionary
DEITY_SYNONYMS = {
‘vishnu’: [‘perumal’, ‘narayana’, ‘hari’, ‘govinda’, ‘madhava’, ‘venkateshwara’],
‘rama’: [‘raghuvira’, ‘raghunatha’, ‘dasarathi’, ‘kodanda rama’, ‘sitapati’],
‘krishna’: [‘gopala’, ‘madhava’, ‘yadava’, ‘devaki nandana’, ‘vaasudeva’],
‘shiva’: [‘shankara’, ‘ishwara’, ‘mahadeva’, ‘hara’, ‘chandrashekara’],
‘murugan’: [‘kartikeya’, ‘skanda’, ‘subramanya’, ‘guha’, ‘shanmukha’],
‘ganesha’: [‘ganapati’, ‘vinayaka’, ‘pillayar’, ‘vighneshwara’],
}
def normalize_deity_name(name):
“"”Normalize deity name to canonical form”””
name_lower = name.lower().strip()
for canonical, synonyms in DEITY_SYNONYMS.items():
if name_lower == canonical or name_lower in synonyms:
return canonical
```text
return name_lower # Return as-is if not found ```
Appendix D: Fuzzy Matching Configuration
Sample de-duplication configuration
DEDUP_CONFIG = {
‘exact_match_threshold’: 1.0, # 100% match
‘high_confidence_threshold’: 0.92, # Auto-merge
‘medium_confidence_threshold’: 0.85, # Flag for review
‘low_confidence_threshold’: 0.75, # Ignore
'field_weights': {
'name': 0.5,
'composer': 0.2,
'raga': 0.15,
'pallavi': 0.15,
},
```text
'phonetic_algorithms': ['metaphone', 'soundex'],
'use_trigram': True,
'trigram_threshold': 0.7, } ```
Appendix E: Glossary
- Krithi/Kriti: A form of Carnatic music composition
- Raga: Melodic framework in Indian classical music
- Tala: Rhythmic pattern/cycle
- Pallavi: First section of a krithi
- Anupallavi: Second section
- Charanam: Verse section (can be multiple)
- Melakarta: Parent raga system (72 fundamental ragas)
- Janya: Derived raga from melakarta
- Kshetra: Sacred place/temple
- Divya Desam: 108 Vishnu temples
- IAST: International Alphabet of Sanskrit Transliteration
- Arohanam: Ascending scale of raga
- Avarohanam: Descending scale of raga
- Composer Trinity: Thyagaraja, Muthuswami Dikshitar, Syama Sastri
Document End
This analysis is based on general knowledge of Carnatic music data sources, typical data engineering challenges, and orchestration platform capabilities. Specific website structures and Koog.ai features should be validated through direct examination and vendor consultation.
Documentation home · Feature status