mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
4bc209c6f7
This notebook shows how the DialogueAgent and DialogueSimulator class make it easy to extend the [Two-Player Dungeons & Dragons example](https://python.langchain.com/en/latest/use_cases/agent_simulations/two_player_dnd.html) to multiple players. The main difference between simulating two players and multiple players is in revising the schedule for when each agent speaks To this end, we augment DialogueSimulator to take in a custom function that determines the schedule of which agent speaks. In the example below, each character speaks in round-robin fashion, with the storyteller interleaved between each player.
1.2 KiB
1.2 KiB
Agent Simulations
Agent simulations involve interacting one of more agents with eachother. Agent simulations generally involve two main components:
- Long Term Memory
- Simulation Environment
Specific implementations of agent simulations (or parts of agent simulations) include
Simulations with Two Agents
- CAMEL: an implementation of the CAMEL (Communicative Agents for “Mind” Exploration of Large Scale Language Model Society) paper, where two agents communicate with each other.
- Two Player D&D: an example of how to use a generic simulator for two agents to implement a variant of the popular Dungeons & Dragons role playing game.
Simulations with Multiple Agents
- Multi-Player D&D: an example of how to use a generic dialogue simulator for multiple dialogue agents with a custom speaker-ordering, illustrated with a variant of the popular Dungeons & Dragons role playing game.
- Generative Agents: This notebook implements a generative agent based on the paper Generative Agents: Interactive Simulacra of Human Behavior by Park, et. al.