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
- 01
Built hybrid retrieval (semantic plus keyword) over an internal document corpus with chunk-level provenance.
- 02
Added a validated NL-to-SQL path that parses and checks generated SQL against the schema before execution.
- 03
Ran everything against a local Llama 3.1 8B model so no data leaves the environment.
- 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.
More case studies
SaaS Retention Warehouse
A full analytics warehouse for SaaS revenue and retention. Built a star schema in DuckDB, modeled cohort retention, MRR waterfall, NRR, and LTV, and served metrics through a FastAPI + React dashboard.
Readmit-IQ
End-to-end ML system for hospital readmission risk. PySpark medallion architecture, scikit-learn modeling with SHAP explainability, FastAPI inference, and a React frontend with RAG over PubMed via Qdrant.
Surgical Complications Benchmarking
Multi-page Streamlit dashboard benchmarking real CMS hospital surgical outcomes. Includes a calibrated synthetic patient-level layer for risk adjustment and predictive modeling.