# BookWorld **Repository Path**: qingge_dada/BookWorld ## Basic Information - **Project Name**: BookWorld - **Description**: This is the official implementation of the paper "BOOKWORLD: From Novels to Interactive Agent Societies for Story Creation". - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-08 - **Last Updated**: 2025-07-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # BookWorld: Interactive Multi-Agent Story Creation System
## Introduction
BookWorld is a comprehensive system for social simulation in fictional worlds through multi-agent interactions. The system features:
- Scene-based story progression with multiple character agents
- Continuous updating of agent memories, status, and goals
- World agent orchestration of the simulation
- Support for human intervention and control
- LLM-based story generation and refinement
## Setup
### Step 1. Clone the repository
```bash
git clone https://github.com/your-repo/bookworld.git
cd bookworld
```
### Step 2.Install dependencies
Conda
```bash
conda create -n bookworld python=3.10
conda activate bookworld
pip install -r requirements.txt
```
Docker
```bash
docker build -t bookworld .
```
### Step 3. Configure Simulation Settings
Fill in the configuration parameters in `config.json`:
- `role_llm_name`: LLM model for character roles
- `world_llm_name`: LLM model for world simulation
- `preset_path`: The path to the experiment preset
- `if_save`: Enable/disable saving (1/0)
- `scene_mode`: Scene progression mode
- `rounds`: Number of simulation rounds
- `mode`: Simulation mode ("free" or "script")
Then enter the API key of the LLM provider you're using either in `config.json` or through the frontend interface.
## Usage
### Step 1. Start the server
```bash
python server.py
```
or
```bash
uvicorn server:app --host 127.0.0.1 --port 8000
```
Docker
```bash
docker run -p 7860:7860 bookworld
```
### Step 2. Access the web interface
Open a browser and navigate to:
- Local Python: http://localhost:8000
- Local Docker: http://localhost:7860
### Step 3. Interact with the system
- Start/pause/stop story generation
- View character information and map details
- Monitor story progression and agent interactions
- Edit generated content if needed
### Step 4. Continue from previous simulation
1. Locate the directory of the previous simulation within `/experiment_saves/`
2. Set its path to the `save_dir` field in `config.json`. Ensure that the selected directory directly contains `server_info.json` and `world_agent.json`.
## Customization
### Construct Your Virtual World Manually
1. Create the roles, map, worldbuilding following the examples given in `/data/`. Additionally, you can place an image named `icon.(png/jpg)` inside the character's folder — this will be used as the avatar displayed in the interface.
2. You can improve the simulation quality by providing background settings about the world in `world_details/` or put character dialogue lines in `role_lines.jsonl`.
3. Enter the preset path to `preset_path` in `config.json`.
### Extract Role, Location, and Setting Data Automatically
Utilize the script provided in `/extract_data/` to extract key story elements using LLMs.
⚠️ Note: We are sorry that the extraction code is currently unstable and may not produce reliable results. We recommend manually entering the character profiles and descriptions, or using data from sources such as Wikipedia. You can quickly generate a template for location and character information by setting if_auto_extract to 0 in extract_config.json.