Skip to content

Latest commit

Β 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Demo Video

A full-stack ML experimentation and observability platform powered by an Agentic AI engineering co-pilot.

πŸ”¬ Highlight: Experiment Investigator

Ask any question about your experiment. An autonomous AI agent β€” built on Gemini's native function calling β€” plans a multi-step investigation, executes read-only tools against live telemetry, and returns a structured report with evidence provenance. Grounded in actual experiment telemetry. No hardcoded logic. A real agent loop. ↓ Jump to full details


πŸ€– Experiment Investigator β€” Agentic AI at the Core

Ask a question about any experiment. The agent autonomously plans, calls tools, evaluates results, and delivers a structured report β€” without hallucinating.

AI Investigator

The Experiment Investigator is an autonomous AI agent built with Google Gemini's native function calling. It is not a chatbot. It is a bounded, read-only reasoning loop that decides which tools to call, in what order, and when to stop.

User Query
    β”‚
    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  InvestigatorAgent                       β”‚
β”‚                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Gemini  │────▢│  Tool Dispatch│────▢│ DB / SHAP β”‚  β”‚
β”‚  β”‚  Flash   │◀────│  (5 tools)    │◀────│  Layer    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚       β”‚                                                 β”‚
β”‚  ≀ 5 iterations (hard cap)                              β”‚
β”‚       β”‚                                                 β”‚
β”‚       β–Ό                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Structured Report: Conclusion Β· Evidence Β· Limitsβ”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

5 read-only tools the agent can call:

Tool What it fetches
get_experiment_runs All runs in the experiment with status
get_run_metrics Accuracy, F1, precision, recall, ROC-AUC
get_run_config Hyperparameters and model configuration
compare_runs Side-by-side delta between any two runs
get_feature_importance SHAP values and top contributing features

Built-in safety guarantees: Hard iteration cap (≀5 loops) Β· Read-only tool access Β· SHA-256 response caching Β· 5-model Flash cascade failover Β· Evidence provenance on every claim.


Platform Features

MicroFlow
β”œβ”€β”€ ML Experimentation Platform
β”‚   β”œβ”€β”€ Dataset Management & Versioning
β”‚   β”œβ”€β”€ Experiment Tracking (runs, configs, artifacts)
β”‚   β”œβ”€β”€ SHAP Explainability (summary, dependence, values)
β”‚   └── Paginated Artifact Registry
β”œβ”€β”€ AI Engineering Suite (Google Gemini)
β”‚   β”œβ”€β”€ Experiment Investigator  ← Agentic, function-calling loop
β”‚   β”œβ”€β”€ AI Run Review            ← Peer-review per completed run
β”‚   β”œβ”€β”€ AI Run Comparison        ← Delta analysis across two runs
β”‚   β”œβ”€β”€ AI Strategy Co-Pilot     ← Chronological experiment guidance
β”‚   β”œβ”€β”€ AI Dataset Insights      ← Schema audit and quality scoring
β”‚   └── Ask MicroFlow            ← Hybrid RAG assistant + RAGAS eval
└── Infrastructure
    β”œβ”€β”€ FastAPI backend Β· React/TypeScript frontend
    β”œβ”€β”€ PostgreSQL + pgvector (semantic search)
    β”œβ”€β”€ Docker Compose (3-container stack)
    └── 289+ tests Β· CI/CD via GitHub Actions

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    React Frontend                         β”‚
β”‚  TanStack Query Β· TypeScript Β· Recharts Β· Tailwind CSS   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ HTTP / REST
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   FastAPI Backend                         β”‚
β”‚                                                          β”‚
β”‚  Routers β†’ Services β†’ Repositories                       β”‚
β”‚                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Training   β”‚  β”‚  AI Layer    β”‚  β”‚  RAG Layer     β”‚  β”‚
β”‚  β”‚  Engine     β”‚  β”‚  (Gemini)    β”‚  β”‚  (pgvector)    β”‚  β”‚
β”‚  β”‚  + SHAP     β”‚  β”‚  + Agent     β”‚  β”‚  + RAGAS eval  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ SQLAlchemy ORM
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              PostgreSQL 16 + pgvector                     β”‚
β”‚    Experiments Β· Runs Β· Artifacts Β· AI Cache Β· Embeddings β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key engineering decisions:

  • Repository Pattern β€” No SQL in services. No DB access in the AI layer.
  • Zero-Hallucination AI β€” Gemini receives pre-fetched structured data only. No SQL generation. No internet access.
  • Deterministic Caching β€” SHA-256 hash of every prompt. Identical queries skip the LLM entirely.
  • Resilience Cascade β€” Exponential backoff + 5-model Flash failover on rate limits.

Quick Start

git clone https://github.com/Mohitingale13/microflow-ml-platform.git
cd microflow-ml-platform
# add GEMINI_API_KEY to .env
docker compose up --build
Service URL
Frontend http://localhost:3000
Backend API http://localhost:8000
Swagger Docs http://localhost:8000/docs

Required .env variables:

GEMINI_API_KEY=your_google_gemini_api_key_here
POSTGRES_USER=microflow
POSTGRES_PASSWORD=microflow_secret
POSTGRES_DB=microflow

All AI features require GEMINI_API_KEY. Without it, AI endpoints return a descriptive 503 while all other platform features remain fully operational.

Running Tests

docker compose exec backend pytest -v

289+ tests covering services, routers, training, AI layer, and the full Investigator agent spec.


Project Structure

microflow-ml-platform/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ ai/
β”‚   β”‚   β”‚   β”œβ”€β”€ investigator_agent.py   # Agentic loop
β”‚   β”‚   β”‚   β”œβ”€β”€ tools/investigator_tools.py  # 5 read-only tools
β”‚   β”‚   β”‚   β”œβ”€β”€ gemini_service.py       # Retry + failover
β”‚   β”‚   β”‚   └── cache_service.py        # SHA-256 caching
β”‚   β”‚   β”œβ”€β”€ routers/                    # HTTP layer only
β”‚   β”‚   β”œβ”€β”€ services/                   # Business logic
β”‚   β”‚   β”œβ”€β”€ repositories/               # DB access
β”‚   β”‚   └── training/                   # Model Factory + SHAP
β”‚   └── tests/                          # 289+ tests
β”œβ”€β”€ frontend/
β”‚   └── src/
β”‚       β”œβ”€β”€ components/experiments/
β”‚       β”‚   β”œβ”€β”€ InvestigatorModal.tsx
β”‚       β”‚   β”œβ”€β”€ AIStrategyTab.tsx
β”‚       β”‚   └── CompareRunsDialog.tsx
β”‚       └── components/datasets/
β”‚           └── AIInsightsTab.tsx
β”œβ”€β”€ docker-compose.yml
└── CONTRIBUTING.md

Future Improvements

  • Authentication β€” JWT + role-based access control
  • Async training jobs β€” Celery/ARQ task queue with real-time status
  • Cloud artifact storage β€” S3-compatible backend (single service swap)
  • Streaming AI responses β€” Token-level streaming for the Investigator
  • Experiment scheduling β€” Grid search / random search across hyperparameter spaces

Contributing

See CONTRIBUTING.md for architecture conventions, layer rules, and PR guidelines.


License

MIT


Acknowledgements

Inspired by MLflow, Weights & Biases, and Kubeflow. AI powered by Google Gemini.

About

A production-grade ML experimentation and observability platform powered by an autonomous Agentic AI engineering co-pilot.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages