Answer
It’s an internal Q&A platform — staff ask questions in natural language and get answers from the company’s own policies, documents, and business data. The key challenge is that different questions need different levels of accuracy, so we built three different approaches and the system decides which one to use.
Two approaches only handle pre-validated questions. First, Exact Q&A — it returns an approved verbatim answer word for word. Second, governed Text-to-SQL for numerical questions. The SQL template is written, validated and approved in advance, and the model are only allowed to fill in parameters like dates or regions — it never generates free-form SQL.
If the first two fail to match, it falls back to document RAG, which retrieves relevant documents and generates an answer with citations. If there isn’t enough evidence, it says something like "I don’t have the information" instead of guessing.
I built it with our senior AI engineer. We co-designed the architecture; he handled QA and governed Text-to-SQL, while I focused on RAG.
On results, Text-to-SQL scored 20 out of 20 and correctly refused all 7 unsupported questions. Retrieval scored 20 out of 21 on questions with a known correct answer.
If he digs: "Why self-built, not LangChain?" → Fewer moving parts, every step is visible, easier for teammates to debug. For one bounded turn with a fixed order, an agent framework adds freedom we don't want. I use LangGraph where the graph is genuinely complex.
If he digs into routing: the interesting failure was a product-warranty question scoring 0.52 against a stock-movement template — confidently wrong, and no threshold could fix it without killing real positives. The fix was a null route: index a set of "none of the above" examples alongside the real intents, so the question loses to a better match instead of to a number. Zero extra LLM cost, same mechanism.
If he asks about the fourth kind: workflows are designed and have a place in the product, but no backend yet — deliberately scoped out.
One-liner to land: "The model is probabilistic; the system around it doesn't have to be. Deterministic shell, agentic core." And: "We moved the thinking from answer time to curation time." On Text-to-SQL: "We replaced 'did the model write correct SQL?' with 'did a human sign this template?' — one is unanswerable, the other is governable."