Introducing Hermes V3: Swiggy’s GenAI-Powered Text-to-SQL Assistant
Swiggy has made significant strides in enhancing data accessibility for its employees by launching Hermes V3, a GenAI-powered text-to-SQL assistant. This innovative tool allows users to query complex datasets effortlessly using plain English, marking a remarkable evolution from its earlier versions. Available directly within Slack, Hermes V3 combines cutting-edge technologies such as vector retrieval, session memory, agentic orchestration, and an explanation layer to transform natural language inputs into accurate SQL queries.
From Simple Queries to Advanced Interactions
Initially, Hermes served as a lightweight interface designed for straightforward questions and corresponding SQL queries executed against Swiggy’s internal data repositories. However, the early versions of this assistant faced considerable limitations. They struggled with derived metrics and lacked the conversational context necessary for creating consistent results across similar prompts. Moreover, users had no clear method for validating the generated SQL.
The Rebuild: Addressing Key Challenges
To tackle these challenges, Swiggy’s engineering team embarked on a revamp of Hermes using advanced machine learning techniques. By leveraging few-shot learning, metadata retrieval, and structured workflows centered on large language models, they effectively rectified previous shortcomings. This allowed for a significantly enhanced interaction experience and overall functionality.
Previous Hermes overall architecture (Source: Swiggy Tech Blog)
Unleashing Vector-Based Retrieval for Enhanced Accuracy
With the launch of Hermes V3, a vector-based prompt retrieval system has been introduced. This system is built on historical SQL executed in Snowflake, addressing the previous challenges posed by missing descriptive metadata in production queries. By harnessing large-context language models, Hermes V3 can now convert SQL queries into natural-language explanations, allowing the system to reconstruct the query intent effectively.
As stated by Meghana Negi and Rutvik Reddy, Engineers at Swiggy:
“Hermes now taps into a curated database of previously executed queries and their prompts, uses vector similarity for retrieval, and remembers conversational context, improving SQL generation accuracy from 54% to 93% while enabling natural, multi-turn interactions.”
Multi-Turn Queries and Enhanced Contextual Memory
One of the standout features of Hermes V3 is its ability to maintain conversational memory. This capability allows users to engage in multi-turn interactions without needing to repeatedly establish context. The system adeptly tracks session states, translating simple metrics into compound requests. An orchestrator agent implements a ReAct-style reasoning loop, efficiently breaking down complex questions into manageable tasks—ranging from intent parsing to SQL generation.
Hermes V3 workflow (Source: Swiggy Tech Blog)
The Explanation Layer: Enhancing Trust with Transparency
Another significant upgrade in Hermes V3 is the addition of an explanation layer. This feature surfaces the assumptions behind generated SQL queries and assigns confidence scores, empowering non-technical stakeholders to grasp the mechanics of how queries are formed. This newfound transparency fosters an environment of trust, ensuring users are confident in the machine-generated insights.
Securing Data Access with Robust Protocols
Security and compliance are paramount for Swiggy, and Hermes V3 is no exception. The system is seamlessly integrated with Swiggy’s stringent security measures, including role-based access control, single sign-on capabilities, and audit logs. This ensures that sensitive data access adheres strictly to internal governance policies. Additionally, hybrid metadata retrieval strategies are employed to efficiently fetch relevant schema, tables, and column details without exceeding token usage limits.
Architechting with Open-Source and Cloud-Native Technologies
The architecture of Hermes intertwines multiple open-source and cloud-native technologies. Vector databases and embedding models facilitate robust retrieval functions, while workflow orchestration makes extensive use of tools like LangChain. Observability frameworks have been layered on, enhancing provenance and monitoring features. Moreover, tools such as Snowflake for analytics and PostgreSQL for database management form the backbone of the ecosystem that supports Hermes’s functionality.
With these groundbreaking enhancements, Hermes V3 has solidified itself as an indispensable tool within Swiggy, allowing employees to derive valuable insights from complex datasets with unprecedented ease and accuracy.
Inspired by: Source
- From Simple Queries to Advanced Interactions
- The Rebuild: Addressing Key Challenges
- Unleashing Vector-Based Retrieval for Enhanced Accuracy
- Multi-Turn Queries and Enhanced Contextual Memory
- The Explanation Layer: Enhancing Trust with Transparency
- Securing Data Access with Robust Protocols
- Architechting with Open-Source and Cloud-Native Technologies



