TalksAWS re:Invent 2025 -Fidelity Investments: Text-to-SQL for data analytics at enterprise scale-IND3323
AWS re:Invent 2025 -Fidelity Investments: Text-to-SQL for data analytics at enterprise scale-IND3323
Fidelity Investments: Text-to-SQL for Data Analytics at Enterprise Scale
Business Challenge and Approach
Fidelity Investments observed that their users were struggling to access and derive insights from their data
Users were relying on multiple applications, spreadsheets, and manual collaboration to piece together the information they needed
The root cause was not the data itself, but the difficulty in accessing and querying the data
This challenge is common across enterprises where data is scattered, complex, and requires technical SQL expertise to leverage
Fidelity's solution was to enable a "natural language to SQL" capability to democratize data access and empower business users:
This approach brings the user's questions directly to the data, rather than forcing users to navigate complex data structures
It reduces dependencies on technical SQL experts and enables a wider range of personas within the organization to self-serve data insights
Technical Implementation
Fidelity's text-to-SQL solution is built on three key pillars:
1. AI-Ready Data
Fidelity followed four principles to structure their data for AI/ML consumption:
Use consistent naming conventions
Establish strong relationship foundations with explicit primary and foreign keys
Leverage product hierarchies to enable pre-aggregated data
Ensure a single source of truth
2. Semantic Layer
Fidelity created a semantic layer to translate business language into database terminology
This includes detailed metadata like business descriptions, example values, and relationship definitions
An automated tool was built to generate these semantic files, with human review to ensure accuracy
3. Dynamic Workflow
The workflow includes query rewrite capabilities to handle vague or ambiguous user questions
Context engineering is a critical component, assembling the right information (schema, examples, entity values, etc.) to feed the language model
Security guardrails are in place to only allow SELECT queries, not DML operations
Iterative learning is enabled by storing validated question-SQL pairs and using them to improve the model over time
Performance and Lessons Learned
Fidelity's current performance metrics include:
Execution accuracy: 93-95%
Result size comparison: 89-92%
Average response time: 28 seconds
These metrics have improved over time through continued learning and optimization
Key lessons learned:
Use a deterministic, production-ready workflow from the start
Maintain a clear, well-documented data schema to prevent interpretation errors
Focus on quality over quantity of teaching examples
Optimize the context fed to the language model for efficiency
Business Impact and Use Cases
Fidelity's text-to-SQL solution has democratized data access and enabled a wider range of business users to self-serve insights
It has reduced dependencies on technical SQL experts and allowed users to focus on their business questions rather than data access challenges
The solution has been applied across various business units and use cases within Fidelity, empowering users to make more informed, data-driven decisions.
These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.
If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.