How tsinghua-fib-lab/agentsociety works
Project Type and Purpose
• AgentSociety is a simulation framework designed for building LLM-driven agents operating in urban environments. Its purpose is to simulate human-like decision-making, social interactions, and urban dynamics using an advanced layered architecture that separates agent behaviors, messaging, environmental interactions, LLM integrations, and supporting tools.
Analyzing the File Structure
• The top-level “agentsociety” directory contains most of the core code with sub-packages such as:
• agent & cityagent: implementing core agent behaviors and specialized urban agent variants (e.g., bankagent, governmentagent).
• environment: covering simulation services (like sim submodule with services for clocks, lanes, roads, etc.), interaction with urban context, and sidecar mechanisms.
• memory: handling memory modules for agents including memory profiles, querying (e.g., using faiss), and state management.
• llm: managing integration with Large Language Models (including embeddings and utilities).
• workflow & message: defining how agent actions are triggered and how messages are exchanged.
• Additional directories and files (e.g., configs, simulation, tools, docs, examples) provide configuration templates, simulation storage mechanisms, experimental use cases, and design documentation.
• Notice also support files like Dockerfile, Makefile, and CI/CD configurations which highlight the project’s deployment and integration testing approach.
Specific Elements
• Command and configuration flows (from Model to Agent).
• Communication flows among agents (within Message Layer).
• Feedback from simulation data (Environment to Agent).
• Integration calls between Agent workflows and the LLM services.
• Rectangles for core modules (Agent, Environment, LLM).
• Ovals or circles for external services (databases, MLFlow).