How cooperative-ia/cooperativegpt works
CooperativeGPT runs LLM-driven agents in Melting Pot substrate simulations: a user selects a game/scenario and players, the server sets up the environment, agents reason from observations and memory, and their actions advance the simulation. Supporting branches include human-controlled play, cooperative understanding, substrate-specific game rules, and recording/replay. Relationships among many agent modules are based on the SOURCE INDEX; unsampled implementations are not inferred beyond those references.
Main entry points: agent.py LLM agent · main.py Simulation runner · server.py Episode server · level_playing_utils.py Level play loop
Components 24
Simulation orchestration
- Run configuration
utils/args_handler.py - Simulation runner
main.py
Agent reasoning
- LLM agent
agent/agent.py - Human agent
agent/human_agent.py - Cognitive modules
agent/cognitive_modules - Cooperative understanding
agent/cooperative_modules/understanding.py - Spatial memory
agent/memory_structures/spatial_memory.py - Short-term memory
agent/memory_structures/short_term_memory.py - Memory retrieval
agent/cognitive_modules/retrieve.py
Game environment
- Episode server
game_environment/server.py - Level play loop
game_environment/playing_utils/level_playing_utils.py - Game substrates
game_environment/substrates/python - Substrate installer
game_environment/substrates/installer.py - Bot policies
game_environment/bots.py - Observation generation
game_environment/scene_descriptor/observations_generator.py - Scene description
game_environment/scene_descriptor/scene_descriptor.py - Episode recorder
game_environment/recorder/recorder.py - Simulation replay
game_environment/recorder/recreate_simulation.py
Memory and model services
- Long-term memory
agent/memory_structures/long_term_memory.py - LLM utilities
utils/llm.py - Model adapters
llm/base_llm.py - Player interface
utils/player_gui.py - Memory persistence
utils/files.py
Other components
- Simulation user
Connections 24
- Simulation user → Run configuration: sets options
utils/args_handler.py - Run configuration → Simulation runner: configures
main.py - Simulation runner → Episode server: starts episode
main.py - Episode server → Substrate installer: installs substrate
game_environment/server.py - Episode server → Level play loop: runs episode
game_environment/server.py - Episode server → Bot policies: initializes bots
game_environment/server.py - Episode server → Game substrates: selects game
game_environment/server.py - Level play loop → Observation generation: generates observations
game_environment/playing_utils/level_playing_utils.py - Level play loop → Scene description: describes scene
game_environment/playing_utils/level_playing_utils.py - Level play loop → Episode recorder: records play
game_environment/playing_utils/level_playing_utils.py - Episode recorder → Simulation replay: supports replay
game_environment/recorder/recorder.py - Simulation runner → LLM agent: runs agents
main.py - LLM agent → Cognitive modules: uses reasoning
agent/agent.py - LLM agent → Short-term memory: updates memory
agent/agent.py - LLM agent → Long-term memory: stores memories
agent/agent.py - LLM agent → Spatial memory: plans movement
agent/agent.py - LLM agent → Cooperative understanding: uses cooperation
agent/agent.py - LLM agent → Memory retrieval: retrieves memories
agent/agent.py - Memory retrieval → Long-term memory: queries memories
agent/cognitive_modules/retrieve.py - Cognitive modules → LLM utilities: uses prompts
agent/cognitive_modules/act.py - LLM utilities → Model adapters: selects model
utils/llm.py - Simulation runner → Human agent: optional human play
- Human agent → Player interface: uses interface
agent/human_agent.py - Simulation runner → Memory persistence: persists memories
main.py