Skip to content

D2I-CUHKSZ/MicroWorld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MicroWorld logo

Multi-modal event analysis and social simulation✨

A lightweight system for turning event materials into structured graphs, agent populations, and inspectable social simulations.

Project Site Python License

Project Site Β· Architecture Β· User Guide Β· Examples

πŸ•΅οΈβ€β™‚οΈ Overview

MicroWorld starts from raw event material: πŸ“„ documents, πŸ–ΌοΈ images, πŸŽ₯ videos, and πŸ•ΈοΈ graph-ready context. It builds an event graph, derives platform-facing agent profiles, runs a multi-agent discussion process, and keeps the intermediate artifacts available for inspection after the run!

🎯 Why MicroWorld? It is built for cases where the final report is not enough on its own. The project keeps the graph πŸ“Š, prompts πŸ’¬, simulation inputs 🎬, action traces πŸ‘£, memory states 🧠, and report outputs πŸ“‘ tied to the same run.

πŸ›οΈ System Architecture

MicroWorld graph-structured simulation framework

MicroWorld is organized around four key stages:

  1. πŸ“₯ Ingestion and graph build: Convert event materials into ontology, entities, and relations.
  2. βš™οΈ Simulation preparation: Derive topic keywords, cluster topology, and generate platform profiles.
  3. πŸƒβ€β™‚οΈ Runtime execution: Run the topology-aware simulation with directional influence and lightweight memory.
  4. πŸ“ˆ Reporting and inspection: Collect logs, traces, configs, and reports from the same run.

✨Key Contributions

Multi-modal event ingestion
Multi-modal Event Ingestion
Handles text, image, and video inputs in one unified workflow.
Two topology clustering modes
Two Topology Clustering Modes
Supports both threshold-based and LLM-keyword-driven clustering.
PPR-guided directional influence
PPR-guided Directional Influence
Models activation and information flow with topology-aware influence.
Lightweight memory
Lightweight Memory
Preserves useful state incrementally without full-history replay.
Inspectable outputs
Inspectable Outputs
Keeps graph artifacts, traces, configs, and reports available for inspection.

πŸ’‘ Efficiency Boost: Removes redundant updates and cuts token usage sharply as workloads grow. Keeps the simulation trajectory closer to the reference trend than the baseline run! πŸ“‰

Cluster-based coordination reduces token usage PPR-guided influence improves simulation accuracy
Removes redundant updates and cuts token usage sharply as workloads grow. Keeps the simulation trajectory closer to the reference trend than the baseline run.

πŸ§ͺExample: LK-99

The public example uses the LK-99 room-temperature-superconductor news cycle. It is a good fit for the project because it contains:

  • 🧩 Mixed evidence types, including long-form text and videos.
  • 🎒 A clear shift from early excitement to later scrutiny.
  • πŸ—£οΈ Visible changes in narrative focus, participants, and discussion structure.

LK-99 demonstration clip LK-99 explanatory illustration

LK-99 annotated frame LK-99 materials figure strip

πŸš€Quick Start

1️⃣ Clone the repository

git clone https://github.com/d2i-cuhksz/MicroWorld.git
cd MicroWorld

2️⃣ Prerequisites πŸ› οΈ

Required:

  • 🐍 Python 3.11+
  • ⚑ uv

Recommended for video inputs:

  • 🎞️ ffmpeg
  • 🎞️ ffprobe

(If ffmpeg and ffprobe are not on your PATH, set MULTIMODAL_FFMPEG_PATH and MULTIMODAL_FFPROBE_PATH in .env)

3️⃣ Configure environment variables πŸ”

cp .env.example .env

Set at least:

LLM_API_KEY=your_key
ZEP_API_KEY=your_key

Common defaults:

LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
LLM_MODEL_NAME=qwen-plus
MULTIMODAL_AUDIO_API_KEY=
MULTIMODAL_AUDIO_BASE_URL=

4️⃣ Install dependencies πŸ“¦

uv sync

5️⃣ Start the API service πŸ”Œ

uv run microworld-api

(The backend uses FLASK_HOST, FLASK_PORT, and FLASK_DEBUG from the environment. The default backend port is 5001.)

6️⃣ Create a run config πŸ“

cp configs/full_run/full_run.template.json /tmp/microworld-run.json

Minimal example:

{
  "project_name": "My MicroWorld Run",
  "graph_name": "My MicroWorld Graph",
  "simulation_requirement": "Build entities, relations, and a two-platform social simulation from the input materials.",
  "files": [
    "/abs/path/to/event.md",
    "/abs/path/to/video.mp4"
  ],
  "pipeline": {
    "chunk_size": 500,
    "chunk_overlap": 50,
    "batch_size": 3
  },
  "simulation": {
    "enable_twitter": true,
    "enable_reddit": true
  },
  "report": {
    "generate": false
  }
}

(You can also leave files empty and provide files_from, with one local path per line.)

7️⃣ Run the full pipeline πŸš‚

uv run microworld-full-run \
  --config /abs/path/to/microworld-run.json

To avoid the interactive clustering choice:

uv run microworld-full-run \
  --config /abs/path/to/microworld-run.json \
  --cluster-method threshold

Generated data is written under: πŸ“

  • data/generated/
  • output/simulations/
  • output/reports/
  • runs/

⌨️ Main Commands

Command Description
uv run microworld-api πŸ”Œ Start the API backend
uv run microworld-local-pipeline --config <path> πŸ”„ Run the local pipeline
uv run microworld-parallel-sim --config <path> πŸƒβ€β™‚οΈ Run parallel simulation
uv run microworld-full-run --config <path> 🌍 Run the entire MicroWorld flow

πŸ“‚ Outputs

A typical run exposes artifacts from several stages:

  • πŸ—οΈ Project build: Extracted text, parsed multimodal content, source manifests, ontology output.
  • 🎭 Simulation preparation: Entity prompts, graph snapshots, social relation graph, simulation config.
  • 🎬 Runtime execution: Platform profiles, action logs, memory states, topology traces.
  • πŸ“Š Reporting: Report outline, full report, agent logs, console logs.

🌲 Repository Structure

MicroWorld/
β”œβ”€β”€ πŸ“„ pyproject.toml
β”œβ”€β”€ πŸ“ src/
β”‚   └── πŸ“ microworld/
β”‚       β”œβ”€β”€ πŸ”Œ api/
β”‚       β”œβ”€β”€ πŸ“± application/
β”‚       β”œβ”€β”€ ⌨️ cli/
β”‚       β”œβ”€β”€ βš™οΈ config/
β”‚       β”œβ”€β”€ 🧩 domain/
β”‚       β”œβ”€β”€ πŸ•ΈοΈ graph/
β”‚       β”œβ”€β”€ πŸ“₯ ingestion/
β”‚       β”œβ”€β”€ πŸ—οΈ infrastructure/
β”‚       β”œβ”€β”€ 🧠 memory/
β”‚       β”œβ”€β”€ πŸ“Š reporting/
β”‚       β”œβ”€β”€ πŸƒ simulation/
β”‚       β”œβ”€β”€ πŸ’Ύ storage/
β”‚       β”œβ”€β”€ πŸ“‘ telemetry/
β”‚       └── πŸ› οΈ tools/
β”œβ”€β”€ πŸ“ configs/
β”‚   β”œβ”€β”€ πŸƒ full_run/
β”‚   └── 🎬 simulation/
β”œβ”€β”€ πŸ“ data/
β”‚   └── πŸ—οΈ generated/
β”œβ”€β”€ πŸ“ docs/
└── πŸ“ tests/

πŸ§‘β€πŸ’» Development

Want to contribute or run tests?

uv sync --group dev
uv run pytest

πŸ™ Acknowledgements

MicroWorld is built on top of prior open-source efforts. We would like to thank MiroFish and OASIS for making their work publicly available. Our project extends and adapts ideas and implementation foundations from these repositories for a lightweight, topology-aware, multi-modal social simulation workflow.


🎡 Citation

If this repository is useful for your work, please cite our project.

@article{xu2026topology,
  title={Topology-Aware LLM-Driven Social Simulation: A Unified Framework for Efficient and Realistic Agent Dynamics},
  author={Xu, Yuwei and Zhang, Shulun and Zhou, Yingli and Zeng, Shipei and Lakshmanan, Laks VS and Ma, Chenhao},
  journal={arXiv preprint arXiv:2604.18011},
  year={2026}
}

License

MicroWorld is released under the GNU Affero General Public License v3.0.

MicroWorld footer

Releases

No releases published

Packages

 
 
 

Contributors

Languages