Ask Your Database
In Plain English
Extensiv's warehouse platform runs on 207 tables across four databases: shipping, billing, inventory, operations. Reading it required SQL. Kodexo Labs built the AI layer that lets any operator just ask, and get a governed, accurate answer back.
The bar the agentic pipeline hits before expanding scope
Shipping, billing, inventory, and operations, now reachable in plain English
By the initial rollout, before wider schema expansion
About the client
The Operational Backbone Behind 1,500+ 3PL Providers
Extensiv (formerly 3PL Central) has built cloud-based warehouse management software since 2006. Its products, 3PL Warehouse Manager, Order Manager, and Integration Manager, cover the fulfillment lifecycle from shopping cart to doorstep, serving over 1,500 third-party logistics providers and processing more than one million orders every week.
The platform connects to Shopify, WooCommerce, Amazon, and Magento, plus leading ERPs, shipping carriers, and accounting systems, making it a central nervous system for modern logistics operations, and its underlying data one of the most valuable and complex assets in the business.
The challenge
Great Data, Locked Behind a Language Only Engineers Spoke
Extensiv's own engineers had started building text-to-SQL capability. It worked, until the questions got real. Four problems stood between an early experiment and something operators could trust.
01SQL Accuracy Broke Down on Complex Joins+
Simple queries ran fine, but questions needing three or four table joins produced SQL that was valid syntax but wrong logic, pulling in far more rows than intended.
02The Schema Was Too Big to Hand the AI+
With 207 tables, there was no way to show the model the whole database at once, and no way, yet, to automatically show it just the tables a given question needed.
03Two Kinds of Questions, One Pipeline+
Some questions need live numbers from the database; others need an answer from policy documents and help content. Nothing decided which was which.
04No Guardrails for What Comes Next+
Read-only queries were low-risk, but Extensiv's roadmap includes letting the AI take actions. Raw, AI-written SQL with write access was not a risk worth taking.
"The raw SQL generation from the LLM works well on simple elements, but sometimes we would get syntax errors or different issues as they got larger. We need the LLM to understand the concept of not wanting to bring in additional records. What's the right table to look at, not bringing in multiple different tables."
Brant Snow, Extensiv
The solution
A System That Decides How to Answer Before It Answers
Kodexo Labs built the AI layer around a LangGraph orchestration engine, a workflow coordinator that reads every question, decides what kind of question it is, and routes it down the right path before a single answer is generated.
A single, lightweight AI call classifies each question the moment it arrives, keeping the extra step fast while making sure every question lands in the pipeline built to answer it correctly.
Data questions · SQL Expert Pipeline
Instead of Asking the AI to Write SQL Blind, It Plans First
Letting a model generate SQL end-to-end against 207 tables is how the fan-out and join errors happened in the first place. The pipeline instead breaks the job into four narrower stages, each one checked before the next begins.
Plan & Extract Tables
The question is broken into logical parts, and a dedicated module identifies only the tables relevant to it, out of 207.
Prune the Schema
Only the schema for those tables is retrieved, then trimmed further to the relevant columns: a focused context, not the whole database.
Generate & Validate
The AI writes SQL against that narrow schema. If it fails validation, the error is fed straight back to it until the query is correct.
Aggregate & Format
Once executed, raw database rows are turned into a plain-English answer shaped around the operator's original question.
A collaborative innovation
Extensiv had independently built a "canonical intent engine" that turns questions into structured JSON before writing SQL. Kodexo Labs ran it head-to-head against this agentic pipeline on identical query sets: the canonical approach won on governance and security, the agentic pipeline won on complex joins and dynamic schemas, pointing toward a hybrid of both.
Help questions · Knowledge Expert Pipeline
Answers Grounded Only in What's Actually Written Down
Questions about policies, business rules, or how the platform works don't need a database. They need Extensiv's own documentation, retrieved and checked for relevance before an answer is written.
Hybrid Search
Keyword (BM25) and semantic search run together via Pinecone, catching both exact terminology and conceptual questions.
Query Fan-Out
Multi-part questions are split into sub-questions, each retrieved in parallel, then merged into one complete answer.
CRAG Check & Rephrase
Retrieved documents below a 0.7 confidence score are discarded; a rephrasing agent retries the search until confidence holds.
Re-Rank & Order
A Cohere cross-encoder re-ranks results, placing the strongest documents first and last, where models pay the most attention.
The CRAG evaluator's discard-and-retry loop is what keeps the assistant from ever answering with a guess: if the documentation doesn't support an answer, the system keeps searching rather than filling the gap itself.
Data & security layer
Every Answer Passes Through Governance Before It Reaches Anyone
Read-only queries today; write access on the roadmap. The guardrails were built for both from day one.
Input Sanitization
Every question is screened before processing to block prompt injection and protect system integrity.
Query Governor
An output filter validates generated SQL against governance rules, keeping every query read-only and unauthorized writes off the table.
Auth & RBAC
AWS Cognito handles authentication; role-based access control governs exactly which data and actions each user can reach.
Audit Logging
Every query, classification decision, and database interaction is logged for compliance and debugging.
Results & impact
From an Engineering Bottleneck to a Question Anyone Can Ask
Overall SQL query accuracy, up from ~75% baseline
RAG answer accuracy, up from 70%
Average query latency, down from 5–8s
Tables across 4 databases now reachable in plain English
✓Accessibility
Warehouse operators, account managers, and analysts now reach operational data directly, removing the wait on engineering for ad-hoc requests.
✓Security Posture
The canonical intent layer and query governor give enterprise-grade governance, ready for write operations when the roadmap calls for them.
✓Trustworthy Answers
The CRAG evaluator grounds every knowledge answer in retrieved documents, virtually eliminating hallucinated responses.
✓Built to Scale
Separate pipelines for data and knowledge queries mean new capabilities can be added without re-architecting the core system.
The complete picture
One Question, Start to Finish
Every piece covered on this page, in the order it actually runs: from the moment someone types a question to the moment a checked, governed answer comes back.
Why Kodexo Labs
Production-Grade AI, Built With the Client Rather Than For Them
Deep AI/ML Engineering
Production experience with LangGraph, RAG systems, and text-to-SQL pipelines: systems that run reliably, not just prototypes.
Collaborative Problem-Solving
Rather than prescribing a solution, the team evaluated approaches and compared results with Extensiv's engineers to reach the architecture together.
Full-Stack System Design
From API gateway and authentication through orchestration and data security: a complete, production-ready architecture.
Evidence-Based Development
Every architectural decision was backed by comparative testing and real query results, tuned to Extensiv's own data.
Questions we get asked
What Teams Ask Before They Build This
Do we have to clean up the database first?
No. Extensiv's 207 tables across four databases went in as they were. Each question is planned and passed through table extraction, so only the relevant tables are pulled, then schema retrieval prunes down to the relevant columns. The model never sees the full schema, so nothing has to be restructured first.
How do you stop the AI writing bad SQL?
Generated SQL runs through an automated validation loop: syntax, semantic, and execution errors are fed back to the generator with context until a valid query comes out. A separate query governor then checks the statement against governance rules and enforces the read-only constraint before anything touches the database.
What happens when the answer isn't in the database?
The intent classifier sends help, policy, and business-rule questions to the knowledge pipeline instead. It searches Extensiv's documentation with hybrid keyword and semantic retrieval, discards anything below a 0.7 confidence score, and a rephrasing agent reformulates and retries rather than letting the model guess.
How accurate is it, and how fast?
100% on simple to moderate data queries, and 90%+ on SQL queries overall, up from a roughly 75% baseline. Knowledge answers run 85%+ accuracy, up from 70%. Average query latency is 3 to 5 seconds, down from 5 to 8.
How long before operators can actually use it?
Scope starts narrow on purpose. The first rollout covered the most-used tables, about 70% of common queries, so accuracy could be proven on real questions before expanding toward the full schema.
Can it ever do things, not just answer questions?
Every query today is read-only. Because write operations were on the roadmap from the start, the guardrails were built for both: input screening for prompt injection, the query governor on every generated statement, AWS Cognito authentication with role-based access control, and audit logging of each query, routing decision, and database interaction.
Ready to Make Your Data Speak Your Language?
Whether you're in logistics, manufacturing, healthcare, or any data-intensive industry, Kodexo Labs can help you build intelligent, natural-language interfaces to your most critical systems.
Book a Discovery Call