# shreetejshinde2003/ai-agent-environment-simulator architecture

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

- Interactive diagram: https://gitdiagram.com/shreetejshinde2003/ai-agent-environment-simulator
- Repository: https://github.com/shreetejshinde2003/ai-agent-environment-simulator

## Overview

FMProject is a multi-agent execution simulator with workspace-scoped persistence, live run updates, research evaluation, and organization HR review. A user signs in, selects a workspace, creates a Single, Fixed, or Adaptive run, then inspects its persisted stages and output; research and HR workflows add separate evaluation and human-approval paths. The diagram combines README-described capabilities with relationships visible in the supplied excerpts and SOURCE INDEX. Several route and frontend modules were not sampled, so their internal calls are not inferred.

Main entry points: [`backend/app/api/routes/tasks.py`](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/api/routes/tasks.py) (Task lifecycle API), [`backend/app/main.py`](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/App.jsx`](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/App.jsx) (App navigation), [`backend/app/experiments/research.py`](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/experiments/research.py) (Benchmarks and comparisons)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Workspace client"]
  node_app["App navigation<br/>[App.jsx]"]
  node_workspace["Workspace selection<br/>[useWorkspace.js]"]
  node_api_client["REST client<br/>[apiClient.js]"]
  node_live_client["Live run client"]
  node_history["Run history<br/>[TaskSummary.jsx]"]
end

subgraph group_execution["Simulation execution"]
  node_api["FastAPI application<br/>[main.py]"]
  node_task_api["Task lifecycle API<br/>[tasks.py]"]
  node_routing["Adaptive routing<br/>[routing.py]"]
  node_agent_engine["Agent stages<br/>[orchestrator.py]"]
  node_contracts["Stage contracts<br/>[contracts.py]"]
  node_llm["Groq model adapter<br/>[llm_client.py]"]
  node_checkpoint[("Graph checkpoints<br/>[checkpointing.py]")]
end

subgraph group_platform["Identity and persistence"]
  node_repository[("Run and workspace store<br/>[database.py]")]
  node_identity["Google OIDC identity<br/>[auth.py]"]
  node_live_server["Workspace live stream<br/>[manager.py]"]
end

subgraph group_research["Research Lab"]
  node_research_lab["Benchmarks and comparisons<br/>[research.py]"]
  node_provenance["Run provenance<br/>[provenance.py]"]
end

subgraph group_hr["HR hiring"]
  node_hr_routes["Hiring and review APIs<br/>[hiring.py]"]
  node_hr_store[("Hiring records and reviews<br/>[hr_reviews.py]")]
end

node_user(("Workspace user"))
node_groq{{"Groq AI service"}}
node_google{{"Google identity provider"}}
node_reviewer(("HR human reviewers"))

node_user -->|"uses"| node_app
node_app -->|"selects"| node_workspace
node_app -.->|"requests data"| node_api_client
node_app -.->|"loads run state"| node_live_client
node_api_client -->|"calls REST"| node_api
node_live_client -->|"reconciles REST"| node_api
node_live_client -->|"receives updates"| node_live_server
node_api -->|"registers routes"| node_task_api
node_task_api -->|"persists runs"| node_repository
node_task_api -->|"selects route"| node_routing
node_task_api -->|"runs stages"| node_agent_engine
node_agent_engine -->|"validates handoffs"| node_contracts
node_agent_engine -->|"requests completion"| node_llm
node_llm -->|"sends prompts"| node_groq
node_task_api -->|"resumes graphs"| node_checkpoint
node_live_server -->|"serves WebSocket"| node_api
node_identity -->|"authenticates via OIDC"| node_google
node_api -->|"registers routes"| node_identity
node_user -->|"signs in"| node_identity
node_research_lab -->|"creates and reruns"| node_task_api
node_research_lab -->|"records provenance"| node_provenance
node_research_lab -->|"stores reviews"| node_repository
node_user -->|"compares runs"| node_research_lab
node_user -->|"uses HR workflows"| node_hr_routes
node_hr_routes -.->|"stores review records"| node_hr_store
node_reviewer -->|"reviews revisions"| node_hr_routes
node_hr_routes -.->|"requests HR assistance"| node_llm
node_history -->|"loads saved runs"| node_api_client
node_user -->|"inspects results"| node_history

click node_app "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/App.jsx"
click node_workspace "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/hooks/useWorkspace.js"
click node_api_client "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/services/apiClient.js"
click node_live_client "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/hooks/useSimulationData.js"
click node_history "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/pages/TaskSummary.jsx"
click node_api "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/main.py"
click node_task_api "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/api/routes/tasks.py"
click node_routing "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/routing.py"
click node_agent_engine "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/orchestrator.py"
click node_contracts "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/contracts.py"
click node_llm "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/llm_client.py"
click node_checkpoint "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/checkpointing.py"
click node_repository "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/storage/database.py"
click node_identity "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/api/routes/auth.py"
click node_live_server "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/websocket/manager.py"
click node_research_lab "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/experiments/research.py"
click node_provenance "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/experiments/provenance.py"
click node_hr_routes "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/api/routes/hiring.py"
click node_hr_store "https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/storage/hr_reviews.py"

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_app,node_workspace,node_api_client,node_live_client,node_history,node_user,node_reviewer toneBlue
class node_api,node_task_api,node_routing,node_agent_engine,node_contracts,node_llm,node_checkpoint toneAmber
class node_repository,node_identity,node_live_server toneMint
class node_research_lab,node_provenance toneRose
class node_hr_routes,node_hr_store,node_groq,node_google toneIndigo
```

## Components

### Workspace client

- [App navigation](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Workspace selection](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/hooks/useWorkspace.js): `frontend/src/hooks/useWorkspace.js`
- [REST client](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/services/apiClient.js): `frontend/src/services/apiClient.js`
- [Live run client](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/hooks/useSimulationData.js): `frontend/src/hooks/useSimulationData.js`
- [Run history](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/frontend/src/pages/TaskSummary.jsx): `frontend/src/pages/TaskSummary.jsx`

### Simulation execution

- [FastAPI application](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/main.py): `backend/app/main.py`
- [Task lifecycle API](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/api/routes/tasks.py): `backend/app/api/routes/tasks.py`
- [Adaptive routing](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/routing.py): `backend/app/agents/routing.py`
- [Agent stages](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/orchestrator.py): `backend/app/agents/orchestrator.py`
- [Stage contracts](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/contracts.py): `backend/app/agents/contracts.py`
- [Groq model adapter](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/llm_client.py): `backend/app/agents/llm_client.py`
- [Graph checkpoints](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/agents/checkpointing.py): `backend/app/agents/checkpointing.py`

### Identity and persistence

- [Run and workspace store](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/storage/database.py): `backend/app/storage/database.py`
- [Google OIDC identity](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`
- [Workspace live stream](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/websocket/manager.py): `backend/app/websocket/manager.py`

### Research Lab

- [Benchmarks and comparisons](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/experiments/research.py): `backend/app/experiments/research.py`
- [Run provenance](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/experiments/provenance.py): `backend/app/experiments/provenance.py`

### HR hiring

- [Hiring and review APIs](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/api/routes/hiring.py): `backend/app/api/routes/hiring.py`
- [Hiring records and reviews](https://github.com/shreetejshinde2003/ai-agent-environment-simulator/blob/main/backend/app/storage/hr_reviews.py): `backend/app/storage/hr_reviews.py`

### Other components

- **Workspace user**
- **Groq AI service**
- **Google identity provider**
- **HR human reviewers**

## Connections

- Workspace user → App navigation: uses (evidence: `README.md`)
- App navigation → Workspace selection: selects (evidence: `frontend/src/App.jsx`)
- App navigation → REST client: requests data
- App navigation → Live run client: loads run state
- REST client → FastAPI application: calls REST (evidence: `README.md`)
- Live run client → FastAPI application: reconciles REST (evidence: `README.md`)
- Live run client → Workspace live stream: receives updates (evidence: `README.md`)
- FastAPI application → Task lifecycle API: registers routes (evidence: `backend/app/main.py`)
- Task lifecycle API → Run and workspace store: persists runs (evidence: `README.md`)
- Task lifecycle API → Adaptive routing: selects route (evidence: `backend/app/api/routes/tasks.py`)
- Task lifecycle API → Agent stages: runs stages (evidence: `backend/app/api/routes/tasks.py`)
- Agent stages → Stage contracts: validates handoffs (evidence: `backend/app/agents/contracts.py`)
- Agent stages → Groq model adapter: requests completion (evidence: `backend/app/agents/llm_client.py`)
- Groq model adapter → Groq AI service: sends prompts (evidence: `README.md`)
- Task lifecycle API → Graph checkpoints: resumes graphs (evidence: `backend/app/api/routes/tasks.py`)
- Workspace live stream → FastAPI application: serves WebSocket (evidence: `backend/app/main.py`)
- Google OIDC identity → Google identity provider: authenticates via OIDC (evidence: `README.md`)
- FastAPI application → Google OIDC identity: registers routes (evidence: `backend/app/main.py`)
- Workspace user → Google OIDC identity: signs in (evidence: `README.md`)
- Benchmarks and comparisons → Task lifecycle API: creates and reruns (evidence: `backend/app/experiments/research.py`)
- Benchmarks and comparisons → Run provenance: records provenance (evidence: `backend/app/experiments/research.py`)
- Benchmarks and comparisons → Run and workspace store: stores reviews (evidence: `backend/app/storage/database.py`)
- Workspace user → Benchmarks and comparisons: compares runs (evidence: `README.md`)
- Workspace user → Hiring and review APIs: uses HR workflows (evidence: `README.md`)
- Hiring and review APIs → Hiring records and reviews: stores review records
- HR human reviewers → Hiring and review APIs: reviews revisions (evidence: `README.md`)
- Hiring and review APIs → Groq model adapter: requests HR assistance (evidence: `README.md`)
- Run history → REST client: loads saved runs (evidence: `frontend/src/pages/TaskSummary.jsx`)
- Workspace user → Run history: inspects results (evidence: `README.md`)
