How vaishali-dhanoa/hcai-project works
This repository is a multi-agent discussion playground with a browser UI and Python backend, plus a root-level simulation/CLI package. The primary user journey is to set up agents and a topic (optionally with a dataset), run discussion rounds, and follow live turns, visuals, and metrics. The backend implementation and frontend wiring are only partly excerpted; documented or indexed connections are shown where supported, and uncertain integration links are dashed.
Main entry points: App.tsx Playground UI · app/simulation.py Round orchestration · main.py API and sockets · app/simulation.py Root simulation
Components 28
Browser experience
- Playground UI
frontend/src/App.tsx - HTTP client
frontend/src/api.ts - Live updates
frontend/src/ws.ts - Discussion arena
frontend/src/components/ArenaTable.tsx - Visual renderer
frontend/src/components/VisualCard.tsx - Visual dashboard
frontend/src/components/DashboardCanvas.tsx - Dataset preview
frontend/src/components/DataPreviewTable.tsx - Speech playback
frontend/src/hooks/useTTS.ts
Backend service
- API and sockets
backend/main.py - Session state
backend/app/state.py
Discussion engine
- Round orchestration
backend/app/simulation.py - Agent creation
backend/app/agent_factory.py - Domain models
backend/app/models.py - Speaker selection
backend/app/selection.py - Civility controls
backend/app/safety.py - Emergent metrics
backend/app/metrics.py - Language generation
backend/app/llm.py
Data and visuals
- Dataset parsing
backend/app/dataset.py - Visual generation
backend/app/auto_visual.py - Chart computation
backend/app/chart_compute.py
Root simulation runtime
- CLI entry
app/cli.py - Root simulation
app/simulation.py - Root metrics
app/metrics.py - Root domain models
app/models.py - Root agent factory
app/agent_factory.py - Root civility controls
app/safety.py - Root speaker selection
app/selection.py
Other components
- Participant
Connections 32
- Participant → Playground UI: uses
- Playground UI → HTTP client: requests actions
frontend/src/App.tsx - Playground UI → Live updates: opens live feed
frontend/src/App.tsx - Playground UI → Discussion arena: renders arena
frontend/src/App.tsx - Playground UI → Visual dashboard: renders dashboard
frontend/src/App.tsx - Playground UI → Dataset preview: renders preview
frontend/src/App.tsx - Playground UI → Visual renderer: renders visuals
frontend/src/App.tsx - Discussion arena → Visual renderer: renders visuals
frontend/src/components/ArenaTable.tsx - Visual dashboard → Visual renderer: renders visuals
frontend/src/components/DashboardCanvas.tsx - Playground UI → Speech playback: plays speech
frontend/src/App.tsx - Speech playback → HTTP client: requests audio
frontend/src/hooks/useTTS.ts - HTTP client → API and sockets: sends API requests
- Live updates → API and sockets: receives events
- API and sockets → Session state: reads and updates
backend/main.py - API and sockets → Agent creation: creates agents
backend/main.py - API and sockets → Dataset parsing: parses uploads
backend/main.py - API and sockets → Round orchestration: runs rounds
backend/main.py - Round orchestration → Speaker selection: selects speakers
backend/app/simulation.py - Round orchestration → Civility controls: checks civility
backend/app/simulation.py - Round orchestration → Emergent metrics: computes metrics
backend/app/simulation.py - Round orchestration → Language generation: generates discussion
backend/app/simulation.py - Round orchestration → Visual generation: generates visuals
backend/app/simulation.py - Round orchestration → Chart computation: computes charts
backend/app/simulation.py - Agent creation → Domain models: builds agents
backend/app/agent_factory.py - Round orchestration → Domain models: uses domain types
backend/app/simulation.py - CLI entry → Root agent factory: creates agents
app/cli.py - CLI entry → Root simulation: runs simulation
app/cli.py - Root simulation → Root speaker selection: selects speakers
app/simulation.py - Root simulation → Root civility controls: checks civility
app/simulation.py - Root simulation → Root metrics: computes metrics
app/simulation.py - Root simulation → Root domain models: uses domain types
app/simulation.py - Root agent factory → Root domain models: builds agents
app/agent_factory.py