MANA (Modular Agentic NoSQL Architecture): Robust NL-to-NoSQL Querying at Enterprise Scale
Abstract
Databases are a crucial part of modern information systems, but interacting with them has traditionally required users to have some level of expertise in formal query languages. This barrier prevents non-technical users from getting the most out of the data that is stored. In this work, we propose a robust production oriented natural language interface that enables users to query document oriented Not Only SQL (NoSQL) databases (MongoDB) using natural language without requiring knowledge of complex query syntax. Unlike NL-to-SQL approaches, NL-to-MongoDB translation must handle evolving, nested document schemas and multi-stage aggregation pipelines, making schemaconsistent query generation and appropriate operator selection (e.g., match, group, lookup) error-prone. Our system addresses this via a modular agent pipeline comprising a Query Builder, Query Runner, and Response Synthesizer, combined with dual dynamic retrieval of relevant schema fragments and similar examples. This architecture allows for self-correction and efficient query generation at the enterprise scale. We evaluate our system on public NL-to-MongoDB benchmarks, including DocSpider and TEND, as well as proprietary datasets. Across DocSpider and TEND, our pipeline improves execution accuracy over prior baselines by up to 40% on DocSpider and 23% on TEND. These findings highlight the potential of our approach as an accessible and effective solution for natural language querying of document oriented NoSQL databases.