---
pretty_name: StatAgent
language:
- en
tags:
- biostatistics
- r
- rag
- agents
- mcp
---
# StatAgent
[](https://github.com/mnoorchenar/StatAgent)
[](https://github.com/mnoorchenar/StatAgent) [](https://huggingface.co/datasets/mnoorchenar/StatAgent)
[](https://mnoorchenar.github.io/)
      
Ask a plain-English question about experiment or manufacturing data. The agent retrieves FDA and PubMed evidence, runs validated R statistics, states the uncertainty, and proposes the next experiment for a human to approve.
[](#features) [](#how-it-works) [](#results) [](#documentation) [](#disclaimer) [](#author)
Recorded from the running app on the built-in SECOM dataset (first sample question).
| 125 | 8 / 8 | 4 / 4 | 16 |
|:---:|:---:|:---:|:---:|
| cited regulatory and PubMed passages | retrieval hit@5 on the eval set | statistical checks passing | automated tests (9 R, 7 Python) |
## Features
| Capability | Detail |
|---|---|
| Statistical tools in R | Control-chart drift with bootstrap changepoint CI, four-parameter dose-response (EC50 CI), mixed-model batch variance, power and factorial design |
| Retrieval with citations | BM25 and LSA hybrid over 21 CFR Parts 11, 211 and 820 and PubMed abstracts; answers cite passage ids |
| Human approval gate | The agent cannot run experiments; proposals wait in a queue for Approve or Reject |
| Audit trail | Every question, tool call and decision is stored in SQLite with a hash of each tool result |
| MCP server | The same tools are exposed as typed MCP tools for any MCP client |
| Resilience | Model fallback, retries, prompt-injection sanitiser, and a replayed saved run if the LLM is rate-limited |
## How it works