BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Swiggy Rolls Out Hermes V3: From Text-to-SQL to Conversational AI

Swiggy Rolls Out Hermes V3: From Text-to-SQL to Conversational AI

Listen to this article -  0:00

Swiggy released Hermes V3, a GenAI-powered text-to-SQL assistant that enables employees to query data in plain English. Hermes operates within Slack, combining vector retrieval, session memory, agentic orchestration, and an explanation layer to generate accurate SQL queries from natural language inputs.

Swiggy, an Indian online food ordering and delivery company, initially launched Hermes as a lightweight interface that allowed employees to ask simple questions and receive corresponding SQL queries executed against internal data stores. Early versions faced limitations with derived metrics, lacked conversational context, produced inconsistent results for similar prompts, and offered no clear way to validate generated SQL. To address these challenges, the engineering team rebuilt the system using few-shot learning, metadata retrieval, and structured workflows around large language models.

Previous Hermes overall architecture (Source: Swiggy Tech Blog)

In its third iteration, Hermes introduces a vector-based prompt retrieval system built on historical SQL executed in Snowflake. Still challenged by most production queries lacking descriptive metadata, the team utilized large-context language models to convert SQL queries into natural-language explanations, effectively reconstructing the missing query intent. These generated prompts are indexed using vector similarity and injected as few-shot examples, allowing Hermes to ground new requests in prior analytical patterns and significantly improve SQL generation accuracy.

As emphasized 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.

Hermes V3 workflow (Source: Swiggy Tech Blog)

Hermes V3 also maintains conversational memory, enabling multi-turn queries that reference previous exchanges without repeating context. User interactions flow naturally as the system tracks session state, expanding simple metrics into compound requests. An orchestrator agent implements a ReAct-style reasoning loop, breaking down complex questions into discrete tasks in a repeatable workflow: intent parsing, completeness checks, metadata lookups, example retrieval, intermediate logic building, SQL generation, and optional clarification requests.

Structured intelligence for query generation agentic flow (Source: Swiggy Tech Blog)

Another significant enhancement is the addition of an explanation layer that surfaces the assumptions behind generated SQL and assigns confidence scores. This transparency enables non-technical stakeholders to understand how queries were formed, thereby increasing trust in machine-generated insights.

Hermes V3 system is tightly integrated with Swiggy’s security, compliance, and metadata infrastructure. Role-based access control, single sign-on, ephemeral replies, and audit logs ensure that sensitive data access adheres to internal governance policies. Hybrid metadata retrieval strategies fetch relevant schema, tables, and column details efficiently, keeping token usage below LLM service limits while preserving performance.

Hermes’s architecture touches multiple open-source and cloud-native technologies. Retrieval functions use vector databases and embedding models; orchestrator logic is implemented with tools such as LangChain for structured prompt workflows; and provenance and monitoring are layered on through observability frameworks. Tools like Snowflake for analytics, PostgreSQL or similar transactional databases, and API gateways are integral to the broader ecosystem supporting Hermes’s functionality.

About the Author

Rate this Article

Adoption
Style

BT