How priyanshmathur-28/export-sql-generator works
Export SQL Generator turns carrier/vendor specification workbooks into T-SQL. The main workflow reads and classifies workbook sheets, makes schema context searchable, generates population and supplementary-data SQL through specialist agents, then assembles and writes the final query. The graph preserves the documented formatting, multi-record, and audit capabilities. Some capabilities are documented rather than visible in the excerpts; those relationships cite the README, and unsampled implementation details are not inferred.
Main entry points: main_orchestrator.py Workflow orchestrator · rag_query.py Schema retrieval · epopagent.py Population SQL · vector_db.py Schema indexing
Components 18
Workbook ingestion
- Workflow orchestrator
agents/main_orchestrator.py - Workbook reader
tools/excel_reader.py - Sheet classification
agents/main_orchestrator.py
Schema retrieval
- Schema indexing
tools/vector_db.py - Schema vector index
- Schema retrieval
tools/rag_query.py
SQL synthesis
- Population SQL
agents/epopagent.py - Entity mapping
agents/epopagent.py - Attribute pivots
agents/Attragent.py - Coverage details
agents/coveragent.py - Header/detail records
agents/Detailagent.py - Trailer summaries
agents/traileragent.py - SQL assembly
agents/main_orchestrator.py
Runtime support
- Application entry
main.py - Audit logging
utils/log.py
Other components
- Engineer
- OpenAI services
- Pinecone
Connections 25
- Engineer → Application entry: starts run
README.md - Application entry → Workflow orchestrator: invokes
main.py - Workflow orchestrator → Workbook reader: reads workbook
agents/main_orchestrator.py - Workflow orchestrator → Sheet classification: classifies sheets
agents/main_orchestrator.py - Workbook reader → Sheet classification: provides sheet data
README.md - Workflow orchestrator → Schema indexing: indexes schema
agents/main_orchestrator.py - Schema indexing → Schema vector index: upserts embeddings
tools/vector_db.py - Schema indexing → OpenAI services: creates embeddings
tools/vector_db.py - Schema indexing → Pinecone: writes vectors
tools/vector_db.py - Schema retrieval → OpenAI services: embeds query
tools/rag_query.py - Schema retrieval → Pinecone: queries index
tools/rag_query.py - Population SQL → Schema retrieval: retrieves schema
agents/epopagent.py - Population SQL → Entity mapping: generates mapping phase
agents/epopagent.py - Population SQL → Attribute pivots: dispatches pivots
agents/epopagent.py - Population SQL → Coverage details: dispatches coverage phase
agents/epopagent.py - Entity mapping → Schema retrieval: retrieves schema
agents/epopagent.py - Coverage details → Schema retrieval: retrieves schema
agents/coveragent.py - Header/detail records → Schema retrieval: retrieves schema
agents/Detailagent.py - Trailer summaries → Schema retrieval: retrieves schema
agents/traileragent.py - Workflow orchestrator → Population SQL: runs synthesis
agents/main_orchestrator.py - Workflow orchestrator → Header/detail records: runs record generation
agents/main_orchestrator.py - Workflow orchestrator → Trailer summaries: runs trailer generation
agents/main_orchestrator.py - Workflow orchestrator → SQL assembly: assembles SQL
README.md - SQL assembly → Engineer: delivers T-SQL
README.md - Workflow orchestrator → Audit logging: records run activity