Natural Language Query for Warehouse Data
An AI-driven natural language interface allows warehouse operators to access over 130 database tables using plain English through Text-to-SQL and knowledge retrieval. This feature is part of Extensiv, a leading cloud-based warehouse management system (WMS) utilized by more than 1,500 third-party logistics (3PL) providers.
**Challenges and Solutions:** Previously, 207 tables across four SQL Server databases needed SQL expertise for data access, leading to coordination problems within a fragmented multi-agent system, with query latencies of 5-8 seconds and around 75% accuracy. Now, users can make queries in plain English via a unified LangGraph orchestrator, supported by an eight-stage validation pipeline, achieving over 90% accuracy and reducing query latency to 3-5 seconds, allowing non-technical users to access data directly.
**Key Outcomes:** Management of 207 tables across four databases has resulted in more than 90% accuracy in SQL queries (up from approximately 75%), and over 85% accuracy in retrieval-augmented generation (RAG), which is an improvement from 70%. The average query latency has decreased from 5-8 seconds to 3-5 seconds, with the 95th percentile latency being below 5 seconds. A projected reduction of 30-40% in support tickets is expected, and hybrid search methods outperform vector-only searches by over 10%. There is no risk of cross-tenant data leakage, with a mean time to detect (MTTD) incidents under 5 minutes and a mean time to resolve (MTTR) under 30 minutes. The solution has received a perfect 5-star client rating (5.0/5.0 across all categories).
**Technology Stack:** The solution is built using Python, LangGraph, LangChain, Claude Sonnet 4 (the primary language model), OpenAI GPT-4 (as a fallback), Qdrant (vector database for SQL examples and document embeddings), PostgreSQL (for schema registry and metadata storage), Redis (for caching), FastAPI (as the API gateway), Microsoft SQL Server (for client databases), OpenAI text-embedding-3-large, NeMo Guardrails (for security), and monitoring tools like Prometheus and Grafana, along with OpenTelemetry for distributed tracing.