Dinesh Jinjala

01A multi-tenant Pharma Manufacturing Analytics SaaS

Governed AI Analytics Agent

Lead engineer

An AI analyst that answers quality questions in plain English over regulated pharma data. I replaced the first-generation agent with a governed design: the model works through validated tools, none of its SQL reaches the database unchecked, and a review step checks every answer before anyone sees it.

7/7
correct in a live side-by-side test (previous version 6/7)
~30%
faster mean response (~12 s vs ~17 s)
0
regressions

Python / FastAPI / PostgreSQL / LLM tool calling

Problem

Quality teams wanted to ask questions of their manufacturing quality data in plain English. On a GxP platform serving 10+ enterprise pharma clients, every answer must be correct, traceable and safe to run against each client's data. A model sending its own unchecked queries to the database could not meet that bar.

Approach

  • I designed an orchestrator that routes each question to an agent and checks the draft answer before it is returned.
  • The agent works through validated, parameterized tools. When no tool fits, it can draft a read-only query, and that query is checked before it runs.
  • Each client's data model is mapped behind the tools, so one agent works across every tenant.
  • Hard limits keep every run bounded in time and cost, and each step is traced for audit.

Architecture

  1. Question
  2. Orchestrator
  3. Agent loop
  4. Validated tools
  5. Answer review
  6. Answer

Outcome

In a live side-by-side test the new agent answered 7 of 7 questions correctly, against 6 of 7 for the previous version, with no regressions and about 30% lower mean latency (~12 s vs ~17 s). Every answer can now be traced from question to data.

What I learnedLet the model decide what to ask. Let code compute the answer.

Building something like this?

Tell me about it