https://github.com/kernelshreyak/agentopolis
Tool for simulating collaborative agents for solving a given scenario in a virtual environment
https://github.com/kernelshreyak/agentopolis
agentic-ai agentic-workflow crew-ai ready-tensor
Last synced: 28 days ago
JSON representation
Tool for simulating collaborative agents for solving a given scenario in a virtual environment
- Host: GitHub
- URL: https://github.com/kernelshreyak/agentopolis
- Owner: kernelshreyak
- Created: 2025-03-18T18:05:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-22T18:19:07.000Z (5 months ago)
- Last Synced: 2026-01-23T11:26:36.778Z (5 months ago)
- Topics: agentic-ai, agentic-workflow, crew-ai, ready-tensor
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Agentopolis - A Sprawling City of Agents
Agentopolis is an open source project that enables simulation of complex scenarios with agents.
The project defines a city called Agentopolis with a set of agents that can interact with each other and the world. The world is made up of resources and the agents can perform actions on the resources to change the world state.
The project allows users to create scenarios and define the agents' goals and backstories. The agents can then be run in a simulation and the results can be viewed in a reporting dashboard.
The project is built using Python and the following frameworks:
* Streamlit for the reporting dashboard
* SQLAlchemy for the database
* Pydantic for data models
* CrewAI for agent management
The project uses the following components:
* **CrewAI**: An open source framework for building and managing agents. It provides a simple way to create agents and define their roles, goals, backstories, and behaviors.
* **Streamlit**: A Python library for creating web applications. It is used to create the reporting dashboard where scenarios can be created and run.
* **SQLAlchemy**: A Python library for interacting with databases. It is used to create the database schema and interact with the database.
* **Pydantic**: A Python library for creating data models. It is used to define the data models for the agents and the world.
## Run the app
### Prerequisites
- Python 3.10+
- An OpenAI API key in `OPENAI_API_KEY`
### Setup
1) Create a virtualenv and install dependencies:
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
2) (Optional) Create a `.env` file:
```bash
OPENAI_API_KEY=your_key_here
# Optional: change DB location
# DATABASE_URL=sqlite:///./agentopolis.db
# Optional: disable CrewAI telemetry to avoid Streamlit thread signal warnings
CREWAI_DISABLE_TELEMETRY=true
OTEL_SDK_DISABLED=true
```
3) Initialize the database (SQLite by default):
```bash
python migration.py
```
### Start the Streamlit app
```bash
streamlit run app.py
```
The app will open in your browser. Choose a scenario, select agents, and click **Simulate**.
The project is organized into the following directories:
* **agentopolis_base**: This directory contains the base code for the project including the agents, the world, and the data models.
* **scenarios**: This directory contains the scenarios that can be run. Each scenario is a separate directory and contains a description of the scenario, the agents' goals and backstories, and the resources and agents available in the scenario.
* **world**: This directory contains the code for the world including the resources and the rules of the world. The resources are defined in the `world/resources` directory and the rules of the world are defined in the `world/rules` directory.
* **agents**: This directory contains the code for the agents including their roles, goals, backstories, and behaviors. The agents are defined in the `agents/agents` directory.