Frekil Logo
Self-Improving AI Agents

RWE Generation
in minutes.

Ask any question, chat with your data in natural language, and refine each step. Our 8-stage agentic workflow handles everything from literature review to publication-ready reports.

Question Clarifier
MD
I want to run a retrospective study comparing Drug X against Standard of Care for reducing heart failure hospitalizations in patients over 65.
01. Literature Review
Synthesized 42 relevant studies from PubMed & internal repos.
02. Question Clarification
PopulationAge ≥ 65
ExposureDrug X
ComparatorStandard of Care
OutcomeICD-10 I50.*
03. Cohort Building
Initial: 1.2MApplying Rules...Final: N=14,205
Generating Causal DAG...
01

Literature Review

Search & Synthesize

The AI agent searches across PubMed and your proprietary studies to automatically synthesize existing evidence, providing a comprehensive foundation for your research question.

Synthesizing 42 Studies
PMID: 31254321 (NEJM)
Extracted: HR 0.74 (95% CI: 0.62-0.88)
Proprietary: Study_A_2023
Extracted: Covariates [Age, Sex, BMI] aligned
PMID: 29881100 (JAMA)
Extracted: Adjusted for Immortal Time Bias
02

Question Clarifier

Structure & Resolve

Through natural language chat, the agent structures your question into the PECO framework (Population, Exposure, Comparator, Outcomes), resolving clinical concepts and ICD codes.

> User: I want to study the effect of Drug X on heart failure.
> Agent: Refining to PECO framework...
- Population: Patients > 18y with ICD-10 I50.*
- Exposure: Drug X (NDC codes generated)
- Comparator: Standard of Care
- Outcome: Hospitalization for Heart Failure
> Status: Ready for cohort building.
03

Cohort Builder

Design & Refine

Define complex temporal rules (baseline, wash out, index, and follow-up). The agent automatically detects methodological flaws like immortal time bias, ensuring rigorous inclusion/exclusion state criteria.

Temporal Design Immortal Time Bias Check
WINDOW INDEX (Day 0)
BASELINERequirements / Inclusion
WASH OUT
Exclusion Rules
FOLLOW-UP WINDOWState tracking / Outcomes
Exposure Starts
Bias Corrected
Time between Index and actual exposure start is safely accounted for to prevent misattributed survival.
04

Causal DAG Builder

Map & Simulate

Automatically draw all causal effects cited from literature and validate them via simulated Healthcare Professional (HCP) reasoning to ensure confounders are accurately identified.

Exposure
Age
Comorb.
Outcome
05

SAP Generator

Specify Analysis

Generates a complete Statistical Analysis Plan (SAP), detailing confounders to adjust, and specifying primary, secondary, subgroup, and sensitivity analyses.

Statistical Analysis Plan v1.0
1. Primary Analysis:

Cox Proportional Hazards model adjusting for identified confounders.
2. Sensitivity Analysis:

Propensity Score Matching (1:1 Nearest Neighbor).
3. Subgroups:

Stratified by age (>65 vs <=65) and sex.
06

Data Extractor

Connect & Extract

Seamlessly connects to your data infrastructure, extracts the relevant cohort, maps schemas to standard terminologies, and performs basic exploratory data analysis (EDA).

PostgreSQL (EHR)
CSV (Claims)
OMOP CDM Output
Rows Extracted1.2M
Missingness EDAPass
07

SAP Executor

Sandbox Execution

Executes the statistical plan step-by-step in a secure, sandboxed environment. Runs R/Python code to output accurate tables, figures, listings, and statistical code.

sandbox_env_R
library(survival)
# Executing Step 4: Cox PH
fit <- coxph(Surv(time, status) ~ trt, data = df)
Execution complete (1.2s)
08

Report Writer

Publish & Present

A research-paper-style report is automatically generated with your custom formats. Complete auditability ensures transparency in every decision, code, and output.

Final TFL Report
READY FOR PUBLICATION
PDF generated with Audit Trail

The 8-step pipeline is built.
Bring your question.