How google-deepmind/concordia works
Concordia is a library for building generative social simulations. A user configures entity and Game Master prefabs, then runs a simulation engine that selects actors, elicits natural-language actions, resolves them into world outcomes, and returns observations for subsequent turns. Entities combine action-selection and context components, with memory and prompt-building supporting behavior. Documented extension areas include questionnaire-driven simulations, specialized prefabs and components, CLI/GUI authoring, and optional language-model providers. The graph follows README-documented relationships; unsampled subsystem links are omitted where implementation calls could not be verified.
Main entry points: sequential.py Turn-taking loops · event_resolution.py Event resolution · interactive_document.py Interactive prompts · engine.py Simulation engine
Components 23
Configuration and authoring
- Entity prefabs
concordia/prefabs/entity/basic.py - Game Master prefabs
concordia/prefabs/game_master/physically_situated_and_dramaturgic.py - Simulation prefabs
concordia/prefabs/simulation/generic.py - CLI and GUI authoring
concordia/command_line_interface/concordia_session.py
Simulation runtime
- Simulation engine
concordia/environment/engine.py - Turn-taking loops
concordia/environment/engines/sequential.py - Step control
concordia/environment/step_controller.py
Entity behavior
- Entity agent
concordia/agents/entity_agent.py - Entity contracts
concordia/typing/entity.py - Agent components
concordia/components/agent/action_spec_ignored.py - Memory component
concordia/components/agent/memory.py - Associative memory
concordia/associative_memory/basic_associative_memory.py
World and extensions
- Event resolution
concordia/components/game_master/event_resolution.py - Observation making
concordia/components/game_master/make_observation.py - Actor selection
concordia/components/game_master/next_acting.py - Specialized world systems
concordia/contrib/components/game_master - Questionnaire simulations
concordia/prefabs/simulation/questionnaire_simulation.py
Models and context
- Interactive prompts
concordia/document/interactive_document.py - Language-model interface
concordia/language_model/language_model.py - Model providers
concordia/contrib/language_models
Other components
- Simulation author
- LLM API
- Text embedder
Connections 26
- Simulation author → Entity prefabs: configures
README.md - Simulation author → Game Master prefabs: configures
README.md - Simulation author → Simulation prefabs: instantiates
README.md - Simulation author → CLI and GUI authoring: authors with
README.md - Simulation prefabs → Simulation engine: runs through
concordia/prefabs/simulation/generic.py - Simulation engine → Turn-taking loops: uses loop
concordia/environment/engine.py - Simulation engine → Step control: supports stepping
concordia/environment/engine.py - Turn-taking loops → Entity agent: requests actions
README.md - Turn-taking loops → Event resolution: requests outcomes
README.md - Turn-taking loops → Observation making: requests observations
README.md - Turn-taking loops → Actor selection: selects actors
README.md - Entity agent → Entity contracts: implements
concordia/agents/entity_agent.py - Entity agent → Agent components: runs phases
concordia/agents/entity_agent.py - Agent components → Memory component: uses memory
concordia/components/agent/memory.py - Memory component → Associative memory: reads and writes
concordia/components/agent/memory.py - Game Master prefabs → Event resolution: assembles
concordia/prefabs/game_master/physically_situated_and_dramaturgic.py - Event resolution → Observation making: queues observations
concordia/components/game_master/event_resolution.py - Actor selection → Interactive prompts: builds prompts
concordia/components/game_master/next_acting.py - Event resolution → Interactive prompts: builds prompts
concordia/components/game_master/event_resolution.py - Observation making → Interactive prompts: uses prompts
concordia/components/game_master/make_observation.py - Interactive prompts → Language-model interface: samples responses
concordia/document/interactive_document.py - Model providers → Language-model interface: implements
concordia/contrib/language_models/vllm/vllm_model.py - Language-model interface → LLM API: calls optionally
README.md - Associative memory → Text embedder: requires embedding
README.md - Specialized world systems → Event resolution: extends resolution
concordia/contrib/components/game_master/narrative_event_resolution.py - Simulation author → Questionnaire simulations: runs study