StatGit + AgentGit Observability Suite By Aarya Chaurasia

The Statistical Firewall for Data & AI Agents.

Treat datasets and agent trajectories like code. StatGit generates 5KB statistical signatures to catch silent tabular drift via Zero-ETL, while AgentGit tracks cognitive and behavioral drift across prompts, tools, and reasoning chains—100% on-device.

DuckDB + Polars Local Ollama Judge
❯ statgit check incoming_data.parquet --baseline v1
Analyzing 4.2B rows... Done (0.8s via Zero-ETL)
PSI Jensen-Shannon Wasserstein/EMD Mahalanobis
Feature PSI JS Div Status
user_age 0.021 0.004 PASS
income_bracket 0.184 ↑ 0.051 ↑ DRIFT DETECTED
email_address - - PII LEAK
transaction_vol 0.080 0.012 PASS
✖ 2 checks failed. Action: quarantine triggered via CI webhook.
Security Action: --anonymize flag suggested to redact email_address.

Zero-ETL Cloud Warehouses & On-Device Agent Stack

AWS S3
GCS
Snowflake
DuckDB
Polars
LangChain
Ollama
Part I: Tabular Observability (StatGit)

Four Pillars of Data Integrity

StatGit replaces fragile DAGs and heavy ETL validation pipelines with a lightweight, cloud-native statistical engine.

Zero-ETL Cloud Native

Snapshot data directly from S3, GCS, or Snowflake. Computation happens natively in your cloud warehouse using push-down queries. Only the 5KB mathematical signature stays local.

s3://bucket
.statgit/v1 (5KB)

Privacy-First Diffing

Automated PII scanning blocks sensitive columns. Differential Privacy (DP) noise injection means you version metrics, not raw user data.

user_email BLOCKED

Model-Aware Sensitivity

Prioritize alerts based on feature importance. Stop waking up for noise in unused columns; start acting on what drives predictions.

ALERT

Automated CI/CD Remediation

Connect StatGit & AgentGit to your deployment gates. Automatically quarantine corrupted data, fail pipelines if agent TUEI regresses >10%, and trigger retraining DAGs.

Pipeline Gate: retrain-xgboost
Check Data & Agent Integrity
Drift threshold exceeded (>0.2)
Triggering model_retrain.yml...
Part II: Sister Project Expansion

Meet AgentGit: Behavioral Version Control for AI Agents

Where StatGit detects silent drift in tabular datasets, AgentGit detects behavioral and cognitive drift in locally running AI agents—tracking how changing a system prompt, tool schema, or model affects decision-making quality over time. Everything runs on-device; no traces ever leave your machine.

SHA-256 Snapshots

Agent Traces & Prompt Versions

Every complete run is captured as a Pydantic v2 AgentTrace ("Agent Signature") containing inputs, reasoning chains, timed tool calls, and outputs—tagged against SHA-256-hashed system prompt commits (v1.2 → v1.3).

Storage Engine: .agentgit/agentgit.duckdb
Information Theory

TUEI & Decision Path Entropy

Quantify trajectory stability mathematically before deploying a new prompt:

  • TUEI: success_rate × (1000ms / avg_latency)
  • Path Entropy: Shannon entropy of step-type sequences to catch erratic loops.
Async Ollama Judge

On-Device LLM-as-a-Judge

A local Ollama model asynchronously evaluates traces post-run for Hallucination Risk, Goal Alignment, and Reasoning Coherence, feeding a rolling z-score detector that fires DriftAlerts on regression.

Composite Health: (1-Halluc)×.35 + Align×.30 + Coher×.20 + Eff×.15

Local-First Architecture

Instrument custom agent loops or drop in the AgentGitCallbackHandler for LangChain. If the FastAPI server (:7432) is unreachable, the SDK automatically falls back to .agentgit/fallback_traces.jsonl with zero data loss.

FastAPI :7432 React UI :5173 Typer CLI
1. Agent Loop
AgentTracker SDK / LangChain Callback
2. FastAPI :7432
POST /traces & TraceRegistry
3. DuckDB + Polars
Z-Score Drift + Ollama Judge
4. React UI :5173
TrajectoryTimeline & DiffView
First-Class Python SDKs

Built for the Modern ML & Agent Stack.

Integrate StatGitClient into orchestration tools like Airflow and Dagster, or wrap autonomous agent runs with AgentTracker and LangChain callbacks in just a few lines of Python.

Declarative Data & Trace Instrumentation Control your statistical firewall, synthesize privacy-safe tabular data, or log timed tool calls and reasoning steps directly from Python.
Zero-Overhead Drop-In Callbacks Pass AgentGitCallbackHandler directly into LangChain or instrument custom reasoning loops with context managers.
from agentgit import AgentTracker
from agentgit.integrations.langchain import AgentGitCallbackHandler

SYSTEM_PROMPT = "You are a quantitative research assistant..."

# 1. Context Manager for custom agent loops
with AgentTracker(
    agent_id="research-agent",
    system_prompt=SYSTEM_PROMPT,
    model_name="gpt-4o",
    tags=["production"],
) as tracker:
    tracker.set_input("Find recent papers on LLM drift")
    tracker.planning("Search recent literature, then synthesize.")

    with tracker.timed_tool_call("web_search", {"q": "LLM drift"}) as tc:
        tc.output = web_search("LLM drift")

    tracker.reasoning("Primary cause is fine-tuning on conflicting data.")
    tracker.finish("Based on recent papers, the primary cause is...")

# 2. Or one-line LangChain drop-in
with AgentTracker(agent_id="lc-agent", system_prompt=SYSTEM_PROMPT) as t:
    agent.run(query, callbacks=[AgentGitCallbackHandler(t)])
statgit serve
agentgit serve

Interactive React & Streamlit Dashboards

Deploy visual observatories in seconds. Inspect marginal distribution overlays in StatGit, or step through interactive TrajectoryTimelines, EvalPanel judge scores, and sparkline health trends in AgentGit's React UI.

agentgit commit v1.3
statgit trend

Statistical & Behavioral Version Control

Track continuous feature decay across your dataset history or run agentgit diff <hash_a> <hash_b> to compare two system prompt versions across latency, token usage, TUEI, and reasoning entropy.

Unified CLI Workflow

Git-style semantics for both tabular pipelines and autonomous agent loops.

zsh — statgit & agentgit cli
Global Metric: Stable Segment (EU): Drifted
Global Average
Regional Drift

Drag or swipe slider to reveal hidden subpopulation drift

Expose Hidden Drift with Subpopulation Slicing.

Global averages lie. When you average out features across a massive dataset or aggregate agent latency across task types, dangerous regressions cancel each other out—a phenomenon rooted in Simpson's Paradox.

StatGit automatically slices your data across categorical dimensions (like Region or Age Group) and runs statistical tests on every segment.

  • Prevent Silent Failures Catch a 10% performance drop in a specific cohort before it impacts downstream models, even when global metrics appear stable.
  • Automated Cohort Discovery No manual slice definitions required. The engine isolates high-variance dimensions and anomalous agent tags automatically.
About the Creator

Architected & Engineered by Aarya Chaurasia

AI Systems Engineer, Quantitative Researcher, and Statistics & Computer Science student at the University of British Columbia (UBC). Explore my full engineering portfolio, quantitative research systems, and production AI projects.