Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test-backend:
name: Backend & Analysis Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version-file: .python-version
cache: pip
cache-dependency-path: requirements.txt

- name: Install dependencies
run: pip install -r requirements.txt

- name: Run tests
run: python -m pytest tests/backend/ tests/analysis/ -v -p no:django

test-frontend:
name: Frontend (Django) Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version-file: .python-version
cache: pip
cache-dependency-path: environment/frontend_server/requirements.txt

- name: Install dependencies
run: pip install -r environment/frontend_server/requirements.txt

- name: Run tests
run: python -m pytest tests/frontend/ -v
env:
DJANGO_SETTINGS_MODULE: frontend_server.settings.base
PYTHONPATH: reverie/backend_server:environment/frontend_server:analysis
56 changes: 56 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Docker

on:
push:
branches: [main]

jobs:
build-backend:
name: Build & Push Backend Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.backend
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/edsim-backend:latest
ghcr.io/${{ github.repository_owner }}/edsim-backend:${{ github.sha }}

build-frontend:
name: Build & Push Frontend Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.frontend
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/edsim-frontend:latest
ghcr.io/${{ github.repository_owner }}/edsim-frontend:${{ github.sha }}
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9.12
19 changes: 18 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# CLAUDE.md

![CI](https://github.com/denoslab/EDSim/actions/workflows/ci.yml/badge.svg)

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

EDsim is an LLM-powered multi-agent simulation of emergency department (ED) workflows. It builds on the [Generative Agents](https://arxiv.org/abs/2304.03442) framework (Park et al., 2023). Four agent types — Doctor, Bedside Nurse, Triage Nurse, and Patient — perceive their environment, plan actions, converse with each other, and execute behaviors driven by LLM calls.
EDSim is an LLM-powered multi-agent simulation of emergency department (ED) workflows. It builds on the [Generative Agents](https://arxiv.org/abs/2304.03442) framework (Park et al., 2023). Four agent types — Doctor, Bedside Nurse, Triage Nurse, and Patient — perceive their environment, plan actions, converse with each other, and execute behaviors driven by LLM calls.

## Environment Setup

Expand Down Expand Up @@ -46,6 +48,21 @@ To run tests inside the container:
docker compose run --rm backend python -m pytest /app/tests/backend/ /app/tests/analysis/ -v -p no:django
```

## CI/CD

GitHub Actions runs automatically on every PR and push to `main`:

| Workflow | Trigger | What it does |
|---|---|---|
| **CI** (`ci.yml`) | PR / push to `main` | Runs all unit tests — backend, analysis, and frontend |
| **Docker** (`docker.yml`) | Push to `main` | Builds and pushes images to GHCR |
| **Release** (`release.yml`) | Push a `v*` tag | Creates a GitHub Release with auto-generated notes |

To cut a release:
```bash
git tag v1.0.0 && git push origin v1.0.0
```

## Running the Simulation

### Interactive mode (frontend + backend)
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# EDsim: An LLM-Powered Emergency Department Simulation Using Generative Agents
# EDSim: An LLM-Powered Emergency Department Simulation Using Generative Agents

EDsim is a multi-agent simulation of emergency department (ED) workflows driven by large language model (LLM)-powered autonomous agents. Each agent (doctors, nurses, patients) perceives its environment, makes decisions through cognitive modules, and interacts with other agents in real time, producing realistic ED dynamics suitable for operational analysis and research.
[![CI](https://github.com/denoslab/EDSim/actions/workflows/ci.yml/badge.svg)](https://github.com/denoslab/EDSim/actions/workflows/ci.yml)

EDSim is a multi-agent simulation of emergency department (ED) workflows driven by large language model (LLM)-powered autonomous agents. Each agent (doctors, nurses, patients) perceives its environment, makes decisions through cognitive modules, and interacts with other agents in real time, producing realistic ED dynamics suitable for operational analysis and research.

## Table of Contents

Expand All @@ -16,7 +18,7 @@ EDsim is a multi-agent simulation of emergency department (ED) workflows driven

## Architecture Overview

EDsim consists of three main components:
EDSim consists of three main components:

### Backend Simulation Engine (`reverie/`)

Expand Down Expand Up @@ -52,8 +54,8 @@ Post-simulation scripts that compute operational metrics from the simulation out
2. Clone this repository:

```bash
git clone <repo-url> EDsim
cd EDsim
git clone <repo-url> EDSim
cd EDSim
```

3. Create and activate the Conda environment:
Expand Down Expand Up @@ -105,7 +107,7 @@ Post-simulation scripts that compute operational metrics from the simulation out

## Running the Simulation

There are two ways to run EDsim: **interactive mode** (with the frontend visualization) and **batch mode** (headless, using `run_simulation.py`).
There are two ways to run EDSim: **interactive mode** (with the frontend visualization) and **batch mode** (headless, using `run_simulation.py`).

---

Expand Down Expand Up @@ -278,14 +280,14 @@ Patient times in both area and state are also exported as separate CSV files alo

## Acknowledgments

EDsim builds on the **Generative Agents** framework by Park et al. (Stanford/Google):
EDSim builds on the **Generative Agents** framework by Park et al. (Stanford/Google):

> Joon Sung Park, Joseph C. O'Brien, Carrie J. Cai, Meredith Ringel Morris, Percy Liang, and Michael S. Bernstein. 2023. *Generative Agents: Interactive Simulacra of Human Behavior.* In Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology (UIST '23). ACM.
>

## Citation

If you use EDsim in your research, please cite:
If you use EDSim in your research, please cite:

```bibtex
@misc{wu2026edsim,
Expand Down
3 changes: 3 additions & 0 deletions environment/frontend_server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ packaging==23.0
pandas==1.1.5
patsy==0.5.3
Pillow==8.4.0
psutil==7.0.0
psycopg2-binary==2.9.5
pytest==8.1.1
pytest-django==4.8.0
pycparser==2.21
pyparsing==3.0.6
PySocks==1.7.1
Expand Down