# vinaysathwik-ai/research_lens architecture

> Architecture diagram of the GitHub repository vinaysathwik-ai/research_lens, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vinaysathwik-ai/research_lens
- Repository: https://github.com/vinaysathwik-ai/research_lens

## Overview

explog is a networked experiment-tracking system: a Python context manager audits reproducibility, registers runs, records metrics and artifacts, and reports completion or failure to a FastAPI server. The server persists run and metric state in SQLite and serves a browser dashboard for searching, filtering, and inspecting runs and metric curves. The README documents these capabilities; the shown source confirms the client, audit helpers, API, persistence models, and dashboard behavior. Some dashboard and server details are unsampled, so only documented or excerpt-visible links are shown.

Main entry points: [`explog/client.py`](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog/client.py) (Run tracker), [`explog_server/main.py`](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/main.py) (Run API), [`explog_server/static/index.html`](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/static/index.html) (Dashboard page), [`explog_server/database.py`](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/database.py) (Run and metric store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Tracking client"]
  node_tracker["Run tracker<br/>[client.py]"]
end

subgraph group_audit["Reproducibility audits"]
  node_git_audit["Git audit<br/>[git_utils.py]"]
  node_env_audit["Environment audit<br/>[env_utils.py]"]
end

subgraph group_server["Tracking server"]
  node_api["Run API<br/>[main.py]"]
  node_store[("Run and metric store<br/>[database.py]")]
end

subgraph group_dashboard["Run dashboard"]
  node_dashboard_shell["Dashboard page<br/>[index.html]"]
  node_dashboard_logic["Dashboard logic<br/>[app.js]"]
end

node_experimenter(("Experiment code"))
node_browser(("Dashboard user"))
node_sqlite[("SQLite database")]

node_experimenter -->|"starts run"| node_tracker
node_tracker -->|"checks Git"| node_git_audit
node_tracker -->|"checks environment"| node_env_audit
node_tracker -->|"sends run and metrics"| node_api
node_tracker -->|"reports outcome"| node_api
node_api -->|"reads and writes"| node_store
node_store -->|"persists data"| node_sqlite
node_browser -->|"opens dashboard"| node_dashboard_shell
node_dashboard_shell -.->|"loads logic"| node_dashboard_logic
node_dashboard_logic -->|"fetches and deletes runs"| node_api
node_api -->|"serves page"| node_dashboard_shell

click node_tracker "https://github.com/vinaysathwik-ai/research_lens/blob/main/explog/client.py"
click node_git_audit "https://github.com/vinaysathwik-ai/research_lens/blob/main/explog/git_utils.py"
click node_env_audit "https://github.com/vinaysathwik-ai/research_lens/blob/main/explog/env_utils.py"
click node_api "https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/main.py"
click node_store "https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/database.py"
click node_dashboard_shell "https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/static/index.html"
click node_dashboard_logic "https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/static/app.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tracker,node_browser toneBlue
class node_git_audit,node_env_audit,node_sqlite toneAmber
class node_api,node_store toneMint
class node_dashboard_shell,node_dashboard_logic toneRose
class node_experimenter toneIndigo
```

## Components

### Tracking client

- [Run tracker](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog/client.py): `explog/client.py`

### Reproducibility audits

- [Git audit](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog/git_utils.py): `explog/git_utils.py`
- [Environment audit](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog/env_utils.py): `explog/env_utils.py`

### Tracking server

- [Run API](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/main.py): `explog_server/main.py`
- [Run and metric store](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/database.py): `explog_server/database.py`

### Run dashboard

- [Dashboard page](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/static/index.html): `explog_server/static/index.html`
- [Dashboard logic](https://github.com/vinaysathwik-ai/research_lens/blob/main/explog_server/static/app.js): `explog_server/static/app.js`

### Other components

- **Experiment code**
- **Dashboard user**
- **SQLite database**

## Connections

- Experiment code → Run tracker: starts run (evidence: `README.md`)
- Run tracker → Git audit: checks Git (evidence: `explog/client.py`)
- Run tracker → Environment audit: checks environment (evidence: `explog/client.py`)
- Run tracker → Run API: sends run and metrics (evidence: `explog/client.py`)
- Run tracker → Run API: reports outcome (evidence: `explog/client.py`)
- Run API → Run and metric store: reads and writes (evidence: `explog_server/main.py`)
- Run and metric store → SQLite database: persists data (evidence: `explog_server/database.py`)
- Dashboard user → Dashboard page: opens dashboard (evidence: `README.md`)
- Dashboard page → Dashboard logic: loads logic
- Dashboard logic → Run API: fetches and deletes runs (evidence: `explog_server/static/app.js`)
- Run API → Dashboard page: serves page (evidence: `explog_server/main.py`)
