Introducing Spyglass AI GENIE!
I am thrilled to announce the launch of our new pre-built accelerator package, the Spyglass AI GENIE (Generative Expert Natural language Interactive E
5 min read
William Richard
:
June 3, 2025
By combining AI for unstructured and structured data assets, we are helping organizations unlock the full potential of their data, drive innovation, improve decision-making, and create more personalized and efficient user experiences beyond traditional Generative AI (GenAI). This transformative concept aims to leverage the strengths of both types of data to create a more comprehensive and intelligent data ecosystem.
But how do you do that? How do we bring the two data worlds together? SQL RAG! This blog delves into the concept, benefits, and approach to SQL RAG, focusing on its architecture, the role of metadata feeding vector stores, and the utilization of domain-based agents.
SQL RAG, or AI SQL Generation, leverages advanced AI models to automate the generation of SQL queries. This approach aims to streamline data retrieval processes, enhance efficiency, and reduce the dependency on manual query writing. By integrating AI capabilities, SQL RAG can dynamically generate optimized and accurate SQL queries based on the context and requirements of the data request at scale.
In the context of a recent project, the implementation of this solution vision involved several key concepts:
Data and AI | AI GENIE Accelerator
Combining AI for unstructured and structured data assets drives the need of a unified platform that can seamlessly integrate, process, and analyze diverse data types. Ensuring your AI and Data Processing platform are unified ensures and improves data accessibility, decision-making, and drives innovation faster.
The diagram below provides an overview of our Structured SQL RAG Agent Architecture.

SQL RAG and traditional SQL query methods serve the same fundamental purpose of retrieving data from databases, but they differ significantly in their approach, efficiency, and capabilities.
Traditional SQL query methods involve manually writing SQL statements to interact with databases. This approach requires a deep understanding of SQL syntax, database schema, and the relationships between different data entities.
SQL RAG leverages AI to automate the generation of SQL queries, offering several advantages over traditional methods:
Establishing a robust domain knowledge repository is crucial for the AI model to understand the data context. We can “build your own repository” or leverage Microsoft Purview Unified Catalog, which captures metadata like lineage, definitions, and structures. Likewise, we enrich this data directly in Purview with domain descriptions, business definitions and data product context. This metadata is then fed into the AI SQL RAG engine to enhance SQL generation as it relates to the specific enterprise.
Interoperability Across Diverse Sources: Normalizing and integrating information seamlessly across varied sources can be complex. Fabric supports hundreds of connectors out of the box, making the ingestion of new systems seamless but the application of quality data preparation and data modeling tailored for AI does not go without care here. Good data modeling and data quality practices make for a better AI experience.
Vector Database Integration: Integrating vector databases with existing SQL databases includes addressing issues related to SQL generation ensuring efficient data context retrieval. We select the best-performing vector technology for specific use cases, such as Azure SQL Database for structured assets.
SQL RAG represents a major advancement in AI-driven data access, automating SQL query generation for better efficiency, accuracy, and scalability. By integrating domain knowledge through Microsoft Purview and using domain-based AI SQL agents, SQL RAG enhances data retrieval and management for applications and data consumers.
We have seen significant improvements in data retrieval processes using SQL RAG. Traditional query methods rely on manual effort, but SQL RAG automates the process, offering dynamic and optimized query generation.
Implementing SQL RAG involves managing data extraction, context collection, performance optimization, and system integration challenges. However, the benefits of enhanced data retrieval and management make it worthwhile. Combining structured and unstructured data with AI creates truly intelligent solutions and the next gen analytical experience.
As a Microsoft Partner with 10 Advanced Specializations and a Featured Fabric Partner, Spyglass MTG can assist with any aspects of Fabric or AI, as well as other Microsoft technologies including Azure, Power Platform, and M365.
We are here to help, and if you have any questions, please contact me at wrichard@spyglassmtg.com.
I am thrilled to announce the launch of our new pre-built accelerator package, the Spyglass AI GENIE (Generative Expert Natural language Interactive E
Microsoft Fabric has traditionally concentrated on analytical databases, data transformation, and data visualization. Recently, Microsoft has...
For decades, the Data Warehouse Subject Area pattern has served as the backbone of enterprise data architecture. These subject areas, such as Sales,...