AI + structured data

Grounded Research Agent

Enterprise research agent with hybrid RAG and validated NL-to-SQL over a local Llama 3.1 8B model. Every claim is cited to a document chunk or SQL result.

  • RAG
  • NL-to-SQL
  • Llama 3.1
  • Python

Role

Retrieval design, SQL validation layer, agent orchestration

Timeframe

2025

The problem

LLM answers are unusable for business decisions when you can't trace a number back to the document or query that produced it.

Approach

  1. 01

    Built hybrid retrieval (semantic plus keyword) over an internal document corpus with chunk-level provenance.

  2. 02

    Added a validated NL-to-SQL path that parses and checks generated SQL against the schema before execution.

  3. 03

    Ran everything against a local Llama 3.1 8B model so no data leaves the environment.

  4. 04

    Enforced a citation contract: every sentence in the answer maps to a chunk ID or query result.

Outcome

  • Answers that combine unstructured context and live SQL figures in one response.

  • Full auditability — each claim links back to its source.

  • A private, self-hosted setup suitable for sensitive enterprise data.