---
title: NPC Social Network AI Simulation
emoji: ๐ค
colorFrom: blue
colorTo: indigo
sdk: gradio
python_version: "3.11"
app_file: app.py
pinned: false
---
## ๐๏ธ Language | ์ธ์ด ์ ํ
- ๐ฐ๐ท [ํ๊ตญ์ด๋ก ๋ณด๊ธฐ](#ํ๊ตญ์ด-์ค๋ช
์)
- ๐บ๐ธ [Read in English](#english-documentation)
---
## ์ฃผ์ ๋ฒ์ ๊ด๋ฆฌ
- 1.0.0v:
> ์์จ ์ฑ์ฅํ AI ์์ด์ ํธ ์์
์๋ฎฌ๋ ์ด์
๊ธฐ๋ณธ ๋์ ํ์ธ ์๋ฃ
> Basic functionality verified for autonomous, self-growing AI agent social simulation.
---
## ํ๊ตญ์ด ์ค๋ช
์
# ๐ง ์์จ ์ฑ์ฅํ AI ์์ด์ ํธ ์์
์๋ฎฌ๋ ์ด์
> ๊ฐ์ , ๊ธฐ์ต, ๊ฐ์น๊ด์ ๊ฐ์ง NPC๋ค๊ณผ ํจ๊ป ์ด์๊ฐ๋ ๊ฐ์ ์ธ๊ณ



## ๐ 1. ํ๋ก์ ํธ ์๊ฐ
์ด ํ๋ก์ ํธ๋ ๋จ์ํ ์ ํด์ง ๋์ฌ๋ฅผ ๋ฐ๋ณตํ๋ ๊ฒ์ NPC๋ฅผ ๋์ด, ์์ฒด์ ์ธ ๊ฐ์ , ๊ธฐ์ต, ์ฑ๊ฒฉ, ๊ด๊ณ๋ฅผ ๋ฐํ์ผ๋ก ์ํธ์์ฉํ๋ฉฐ
์ค์ค๋ก ํ๋จํ๊ณ ์ฑ์ฅํ๋ ๊ฐ์ ์ธ๊ฐ(AI Agent)์ ๊ตฌํํ๋ AI ์๋ฎฌ๋ ์ด์
์
๋๋ค.
- **ํ๋ซํผ**: ์น ๊ธฐ๋ฐ (Python + Flask)
- **ํต์ฌ ๊ธฐ์ **: LLM (Gemini), Sentence-TransFormers, FAISS
- **์ฃผ์ ๊ธฐ๋ฅ**: ์์จ ํ๋, ๊ธฐ์ต ๊ธฐ๋ฐ ๋ํ, ๊ฐ์น๊ด ํ์ฑ, ์ฑ๊ฒฉ/๊ด๊ณ ๋ณํ, ํ๋ ์ด์ด ๊ฐ์
๋ฑ
## ๐ 2. ์ฃผ์ ๊ธฐ๋ฅ ๋ฐ ์์คํ
### ๐งฉ ๋์ ๋ฉํฐํด ๋ํ ์์คํ
- ๋จ๋ตํ ๋ฌธ๋ต์ ๋์ด, NPC์ ๊ฐ์ , ๊ธฐ์ต, ๊ด๊ณ๋ฅผ ํ์ฉํ ๊น์ด ์๋ ๋ํ
### ๐ง ์์จ ์์ด์ ํธ ์ํคํ
์ฒ
- LLM ๊ธฐ๋ฐ Reasoner/Planner๊ฐ ์ฅ๊ธฐ ๋ชฉํ์ ํ๋ ๊ณํ์ ์์จ์ ์ผ๋ก ์์ฑ
### ๐ ๊ณ ์ฐจ์ ์์ ์ฑ์ฐฐ ๊ธฐ๋ฅ
- NPC๋ ๊ด๊ณ๋ฅผ ์ฌ์ ์ํ๊ณ ์ค์ค๋ก์ ๊ฐ์น๊ด์ ์ ์ง์ ์ผ๋ก ํ์ฑ
### ๐งญ ์ํฉ ์ธ์ง ๊ธฐ๋ฐ ์ฌํ์ ํ๋
- "๋์ ์ฃผ๊ธฐ" ๋ฑ์ ์ฌํ์ ํ๋์ด ๋ฉ๋ชจ๋ฆฌ์ ๊ด๊ณ์ ์ํฅ์ ์ค
### ๐ง RAG ๊ธฐ๋ฐ ๊ธฐ์ต ์์คํ
- FAISS๋ฅผ ํตํ ์๋ฏธ์ ๊ธฐ์ต ๊ฒ์ ๋ฐ ํ์ฉ (Sentence-Transformers + LLM)
### ๐น๏ธ ํ๋ ์ด์ด ๊ฐ์
์์คํ
- ๊ด๊ณ ์ค์ , ์ด๋ฒคํธ ์ ๋ ๋ฑ์ผ๋ก NPC ์ธ๊ณ์ ์ค์๊ฐ ๊ฐ์
๊ฐ๋ฅ
## ๐ผ๏ธ 3. ์๊ฐํ: ์๋ ๊ด์ฐฐ์ ๋์๋ณด๋
> NPC๋ค์ ๋ด๋ฉด ์ํ์ ๊ด๊ณ ๋ณํ๋ฅผ ์ค์๊ฐ์ผ๋ก ์๊ฐํํ๋ ์น ๊ธฐ๋ฐ ๋์๋ณด๋์
๋๋ค.

## ๐งฐ 4. ์ฌ์ฉ ๊ธฐ์ ์คํ
- **AI/ML**: Google Gemini, Sentence-Transformers, FAISS
- **Frontend**: HTML, CSS
- **Backend**: Python 3.10, Flask
- **Memory Architecture**: RAG
## โ๏ธ 5. ์ค์น ๋ฐ ์คํ ๋ฐฉ๋ฒ
```bash
# 1. ํด๋ก
git clone http://github.com/Rorshi/autonomous-ai-agent-sim.git
cd autonomous-ai-agent-sim
# 2. ํ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
pip install -r requirements.txt
# 3. ์คํ
python app.py
http://127.0.0.1:5000 ์ ์
# 4. LLM ๋ชจ๋ธ ์ ํ ๋ฐ API Key ์
๋ ฅ
# 5. ์์ ์ค์ (์ ํ ์ฌํญ)
autonomous-ai-agent-sim\npc_social_network\scenarios\scenario_setup.py ํ์ผ ์์
```
## ๐ค 6. ๊ธฐ์ฌ / ๋ผ์ด์ ์ค
- ์ด ํ๋ก์ ํธ๋ **๊ฐ์ธ ํฌํธํด๋ฆฌ์ค ๋ฐ ์ฐ๊ตฌ ๋ชฉ์ **์ผ๋ก ์ ์๋์์ต๋๋ค.
- ์ธ๋ถ ์ฌ์ฉ์์ Issue ๋ฐ Pull Request๋ ๊ฒํ ํ ๋ฐ์ํ ์ ์์ต๋๋ค.
- ์ด ํ๋ก์ ํธ์ ์ ์๊ถ์ [@Rorshi](https://github.com/Rorshi)์๊ฒ ์์ผ๋ฉฐ, ๋ฌด๋จ ์ฌ์ฉ, ์์ , ๋ฐฐํฌ๋ฅผ ๊ธ์งํฉ๋๋ค.
> โ๏ธ ์ด์ฉ ๋ฐ ํ์
๋ฌธ์: saffad4851@gmail.com
---
## English Documentation
# ๐ง Autonomous AI Agent Social Simulation
> A virtual world where NPCs grow through emotion, memory, and personal values



## ๐ 1. Project Overview
This project aims to go beyond traditional NPCs with predefined dialogue.
It simulates **virtual humans (AI Agents)** capable of autonomous interaction, emotion, memory, personality, and growth.
- **Platform**: Web-based (Python + Flask)
- **Core Technologies**: LLM (Gemini), Sentence-Transformers, FAISS
- **Key Features**: Autonomous behavior, memory-based dialogue, evolving values and personality, player intervention
## ๐ 2. Key Features and Systems
### ๐งฉ Dynamic Multi-turn Dialogue System
- NPCs engage in deep, contextual conversations based on emotion, memory, and relationships
### ๐ง Autonomous Agent Architecture
- Each NPC utilizes LLM-based Reasoners and Planners to formulate long-term goals and actionable plans
### ๐ Higher-Order Cognitive Reflection
- NPCs redefine their relationships and gradually form personal values over time
### ๐งญ Context-Aware Social Behavior
- NPCs perform social actions like "helping" and simulate their effects on memory and relationships
### ๐ง RAG-based Memory System
- Semantic memory retrieval using FAISS + Sentence-Transformers to enhance dialogue relevance
### ๐น๏ธ Player Intervention System
- Players can modify relationships or trigger events to observe and influence NPC responses in real time
## ๐ผ๏ธ 3. Visualization: World Observer Dashboard
> A web-based dashboard that visualizes NPCs' internal states and relationship changes in real time

## ๐งฐ 4. Technology Stack
- **AI/ML**: Google Gemini, Sentence-Transformers, FAISS
- **Frontend**: HTML, CSS
- **Backend**: Python 3.10, Flask
- **Memory Architecture**: RAG (Retrieval-Augmented Generation)
## โ๏ธ 5. Setup & Run Instructions
```bash
# 1. Clone the repository
git clone http://github.com/Rorshi/autonomous-ai-agent-sim.git
cd autonomous-ai-agent-sim
# 2. Install required packages
pip install -r requirements.txt
# 3. Run the app
python app.py
# Access the app at:
http://127.0.0.1:5000
# 4. Choose LLM model and enter your API key
# 5. (Optional) Configure initial setup
Edit the file:
autonomous-ai-agent-sim\npc_social_network\scenarios\scenario_setup.py
```
## ๐ค 6. Contribution & License
This project is intended for personal portfolio and research purposes.
External contributions via Issues and Pull Requests are welcome and will be reviewed case-by-case.
All rights reserved by @Rorshi.
Unauthorized use, modification, or redistribution is strictly prohibited.
> โ๏ธ For inquiries or collaboration requests: saffad4851@gmail.com
[Back to top](#ํ๊ตญ์ด-์ค๋ช
์)