$ show x-glacier/GenerativeAgentsCN
This repository implements a Chinese-localized version of the Stanford Generative Agents simulation. It creates a virtual town with 25 AI agents powered by LLMs (primarily via Ollama) that autonomously organize events, form relationships, and exhibit human-like behaviors. The system consists of a simulation engine that runs agent interactions over time, a compression tool to generate replay data, and a Flask-based web frontend for visualizing the simulation. Agents maintain memory, generate plans, reflect on experiences, and interact through LLM-driven conversations and actions. The application supports local deployment with configurable LLMs and includes features like breakpoint resumption and conversation logging.
The LLM identified 3 files worth highlighting for reuse:
Core agent implementation that integrates LLM reasoning with memory systems. Demonstrates excellent separation of concerns between perception, planning, action execution, and reflection. The agent architecture cleanly handles the complex interplay between short-term actions, long-term planning, and memory consolidation through concepts. Shows sophisticated use of LLM prompts for decision-making while maintaining deterministic simulation behavior.
Advanced memory system using LlamaIndex for vector storage and retrieval of agent experiences. Implements sophisticated concept formation with poignancy scoring, temporal decay, and associative retrieval. The component effectively balances memory relevance with computational efficiency through configurable retention policies and importance weighting. Demonstrates strong data engineering in implementing a working memory system for LLM agents.
Well-designed prompt management system that uses Pydantic models for structured LLM output validation. Replaces fragile regex parsing with type-safe response handling. Shows excellent prompt engineering practices through careful template design, fallback mechanisms, and systematic validation. The component makes LLM interactions reliable and maintainable through systematic prompt construction and response handling.