How lamm-mit/swarmworld works
SwarmWorld is a deterministic agent-society research simulator. Its principal workflow configures a world and agent policy, advances an authoritative simulation, records traces for replay, then analyzes study outcomes and presents live or recorded state in the Observatory. The graph also preserves documented capabilities for technology and artifact inheritance, scenario packages, LLM providers, and human play. Several analysis and presentation modules were not sampled; their capabilities and broad relationships are included only where the README documents them.
Main entry points: simulation.py Authoritative simulator · config.py Run configuration · App.tsx Three.js Observatory · llm.py LLM policy
Components 28
World simulation
- Run configuration
src/biofoundry/config.py - Scenario packages
src/biofoundry/scenarios.py - Authoritative simulator
src/biofoundry/simulation.py - World state
src/biofoundry/world.py - Material systems
src/biofoundry/materials.py
Agents and technology
- Agent policies
src/biofoundry/policies/scripted.py - LLM policy
src/biofoundry/policies/llm.py - Compatible model provider
src/biofoundry/providers/openai_compatible.py - Agent memory
src/biofoundry/memory.py - Executable programs
src/biofoundry/programs.py - Persistent artifacts
src/biofoundry/artifacts.py - Causal knowledge
src/biofoundry/knowledge.py
Research and replay
- Event traces
src/biofoundry/events.py - Study analysis
src/biofoundry/analysis.py - Mobility analysis
src/biofoundry/mobility_analysis.py - Trace diagnostics
src/biofoundry/trace_analysis.py - Counterfactual replay
src/biofoundry/counterfactuals.py - Ecological evaluation
src/biofoundry/technology_ecology.py
Live clients
- Live simulation server
src/biofoundry/server.py - Three.js Observatory
web/src/App.tsx - Live state connection
web/src/hooks/useBiofoundry.ts - World renderer
web/src/components/WorldScene.tsx - Lineage visualization
web/src/lib/lineage.ts - Human-in-swarm client
game/client/js/main.js - Human game session
game/session.py
Other components
- Researcher
- Human player
- Model API
Connections 27
- Researcher → Run configuration: configures
README.md - Run configuration → Scenario packages: selects
src/biofoundry/simulation.py - Run configuration → Authoritative simulator: configures
src/biofoundry/server.py - Scenario packages → Authoritative simulator: supplies world
src/biofoundry/simulation.py - Authoritative simulator → World state: advances
src/biofoundry/simulation.py - Authoritative simulator → Material systems: updates
src/biofoundry/simulation.py - Authoritative simulator → Event traces: records
src/biofoundry/simulation.py - Agent policies → Material systems: consults
src/biofoundry/policies/scripted.py - LLM policy → Agent memory: retrieves
src/biofoundry/policies/llm.py - LLM policy → Compatible model provider: requests generation
src/biofoundry/policies/llm.py - Compatible model provider → Model API: calls API
- Authoritative simulator → Executable programs: uses programs
src/biofoundry/simulation.py - Authoritative simulator → Persistent artifacts: updates artifacts
src/biofoundry/simulation.py - Authoritative simulator → Causal knowledge: uses knowledge
src/biofoundry/simulation.py - Researcher → Study analysis: analyzes studies
README.md - Researcher → Mobility analysis: analyzes movement
README.md - Researcher → Trace diagnostics: diagnoses trace
README.md - Researcher → Counterfactual replay: runs interventions
README.md - Researcher → Ecological evaluation: evaluates artifacts
README.md - Authoritative simulator → Live simulation server: served by
src/biofoundry/server.py - Live simulation server → Three.js Observatory: streams state
README.md - Three.js Observatory → Live state connection: uses connection
web/src/App.tsx - Live state connection → World renderer: supplies state
- Three.js Observatory → Lineage visualization: builds lineage
web/src/App.tsx - Human player → Human-in-swarm client: joins and acts
README.md - Human-in-swarm client → Human game session: sends actions
game/client/js/main.js - Human game session → Authoritative simulator: uses engine
game/session.py