File size: 6,705 Bytes
73dbae4
 
 
 
 
 
273dfc4
73dbae4
 
 
 
9086f9d
 
 
3ee0764
 
 
 
 
 
 
9086f9d
 
b3dc6f8
 
 
9086f9d
b3dc6f8
9086f9d
b3dc6f8
b97ab3c
 
b3dc6f8
 
 
 
 
 
 
 
b97ab3c
b3dc6f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b97ab3c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9086f9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
---
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.
<br>

---
## ํ•œ๊ตญ์–ด ์„ค๋ช…์„œ
# ๐Ÿง  ์ž์œจ ์„ฑ์žฅํ˜• AI ์—์ด์ „ํŠธ ์†Œ์…œ ์‹œ๋ฎฌ๋ ˆ์ด์…˜
> ๊ฐ์ •, ๊ธฐ์–ต, ๊ฐ€์น˜๊ด€์„ ๊ฐ€์ง„ NPC๋“ค๊ณผ ํ•จ๊ป˜ ์‚ด์•„๊ฐ€๋Š” ๊ฐ€์ƒ ์„ธ๊ณ„

![Python](https://img.shields.io/badge/Python-3.11-blue?logo=python)
![Flask](https://img.shields.io/badge/Flask-Web_Framework-black?logo=flask)
![License](https://img.shields.io/badge/License-Restricted-red)
<br>

## ๐Ÿ“ 1. ํ”„๋กœ์ ํŠธ ์†Œ๊ฐœ
์ด ํ”„๋กœ์ ํŠธ๋Š” ๋‹จ์ˆœํžˆ ์ •ํ•ด์ง„ ๋Œ€์‚ฌ๋ฅผ ๋ฐ˜๋ณตํ•˜๋Š” ๊ฒŒ์ž„ NPC๋ฅผ ๋„˜์–ด, ์ž์ฒด์ ์ธ ๊ฐ์ •, ๊ธฐ์–ต, ์„ฑ๊ฒฉ, ๊ด€๊ณ„๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ์ƒํ˜ธ์ž‘์šฉํ•˜๋ฉฐ<br>
<strong>์Šค์Šค๋กœ ํŒ๋‹จํ•˜๊ณ  ์„ฑ์žฅํ•˜๋Š” ๊ฐ€์ƒ ์ธ๊ฐ„(AI Agent)</strong>์„ ๊ตฌํ˜„ํ•˜๋Š” AI ์‹œ๋ฎฌ๋ ˆ์ด์…˜์ž…๋‹ˆ๋‹ค.

- **ํ”Œ๋žซํผ**: ์›น ๊ธฐ๋ฐ˜ (Python + Flask)
- **ํ•ต์‹ฌ ๊ธฐ์ˆ **: LLM (Gemini), Sentence-TransFormers, FAISS
- **์ฃผ์š” ๊ธฐ๋Šฅ**: ์ž์œจ ํ–‰๋™, ๊ธฐ์–ต ๊ธฐ๋ฐ˜ ๋Œ€ํ™”, ๊ฐ€์น˜๊ด€ ํ˜•์„ฑ, ์„ฑ๊ฒฉ/๊ด€๊ณ„ ๋ณ€ํ™”, ํ”Œ๋ ˆ์ด์–ด ๊ฐœ์ž… ๋“ฑ
<br>

## ๐Ÿš€ 2. ์ฃผ์š” ๊ธฐ๋Šฅ ๋ฐ ์‹œ์Šคํ…œ
### ๐Ÿงฉ ๋™์  ๋ฉ€ํ‹ฐํ„ด ๋Œ€ํ™” ์‹œ์Šคํ…œ
- ๋‹จ๋‹ตํ˜• ๋ฌธ๋‹ต์„ ๋„˜์–ด, NPC์˜ ๊ฐ์ •, ๊ธฐ์–ต, ๊ด€๊ณ„๋ฅผ ํ™œ์šฉํ•œ ๊นŠ์ด ์žˆ๋Š” ๋Œ€ํ™”

### ๐Ÿง  ์ž์œจ ์—์ด์ „ํŠธ ์•„ํ‚คํ…์ฒ˜
- LLM ๊ธฐ๋ฐ˜ Reasoner/Planner๊ฐ€ ์žฅ๊ธฐ ๋ชฉํ‘œ์™€ ํ–‰๋™ ๊ณ„ํš์„ ์ž์œจ์ ์œผ๋กœ ์ƒ์„ฑ

### ๐Ÿ” ๊ณ ์ฐจ์› ์ž์•„ ์„ฑ์ฐฐ ๊ธฐ๋Šฅ
- NPC๋Š” ๊ด€๊ณ„๋ฅผ ์žฌ์ •์˜ํ•˜๊ณ  ์Šค์Šค๋กœ์˜ ๊ฐ€์น˜๊ด€์„ ์ ์ง„์ ์œผ๋กœ ํ˜•์„ฑ

### ๐Ÿงญ ์ƒํ™ฉ ์ธ์ง€ ๊ธฐ๋ฐ˜ ์‚ฌํšŒ์  ํ–‰๋™
- "๋„์›€ ์ฃผ๊ธฐ" ๋“ฑ์˜ ์‚ฌํšŒ์  ํ–‰๋™์ด ๋ฉ”๋ชจ๋ฆฌ์™€ ๊ด€๊ณ„์— ์˜ํ–ฅ์„ ์คŒ

### ๐Ÿง  RAG ๊ธฐ๋ฐ˜ ๊ธฐ์–ต ์‹œ์Šคํ…œ
- FAISS๋ฅผ ํ†ตํ•œ ์˜๋ฏธ์  ๊ธฐ์–ต ๊ฒ€์ƒ‰ ๋ฐ ํ™œ์šฉ (Sentence-Transformers + LLM)

### ๐Ÿ•น๏ธ ํ”Œ๋ ˆ์ด์–ด ๊ฐœ์ž… ์‹œ์Šคํ…œ
- ๊ด€๊ณ„ ์„ค์ •, ์ด๋ฒคํŠธ ์œ ๋„ ๋“ฑ์œผ๋กœ NPC ์„ธ๊ณ„์— ์‹ค์‹œ๊ฐ„ ๊ฐœ์ž… ๊ฐ€๋Šฅ
<br>

## ๐Ÿ–ผ๏ธ 3. ์‹œ๊ฐํ™”: ์›”๋“œ ๊ด€์ฐฐ์ž ๋Œ€์‹œ๋ณด๋“œ
> NPC๋“ค์˜ ๋‚ด๋ฉด ์ƒํƒœ์™€ ๊ด€๊ณ„ ๋ณ€ํ™”๋ฅผ ์‹ค์‹œ๊ฐ„์œผ๋กœ ์‹œ๊ฐํ™”ํ•˜๋Š” ์›น ๊ธฐ๋ฐ˜ ๋Œ€์‹œ๋ณด๋“œ์ž…๋‹ˆ๋‹ค.<br>
![Dashboard Example](/npc_social_network/static/images/assets/dashboard_example.png)
<br>

## ๐Ÿงฐ 4. ์‚ฌ์šฉ ๊ธฐ์ˆ  ์Šคํƒ
- **AI/ML**: Google Gemini, Sentence-Transformers, FAISS
- **Frontend**: HTML, CSS
- **Backend**: Python 3.10, Flask
- **Memory Architecture**: RAG
<br>

## โš™๏ธ 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๋Š” ๊ฒ€ํ†  ํ›„ ๋ฐ˜์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
- ์ด ํ”„๋กœ์ ํŠธ์˜ ์ €์ž‘๊ถŒ์€ <strong>[@Rorshi](https://github.com/Rorshi)</strong>์—๊ฒŒ ์žˆ์œผ๋ฉฐ, ๋ฌด๋‹จ ์‚ฌ์šฉ, ์ˆ˜์ •, ๋ฐฐํฌ๋ฅผ ๊ธˆ์ง€ํ•ฉ๋‹ˆ๋‹ค.
> โœ‰๏ธ ์ด์šฉ ๋ฐ ํ˜‘์—… ๋ฌธ์˜: [email protected]

<br>
<br>

---
## English Documentation
# ๐Ÿง  Autonomous AI Agent Social Simulation  
> A virtual world where NPCs grow through emotion, memory, and personal values

![Python](https://img.shields.io/badge/Python-3.11-blue?logo=python)
![Flask](https://img.shields.io/badge/Flask-Web_Framework-black?logo=flask)
![License](https://img.shields.io/badge/License-Restricted-red)
<br>

## ๐Ÿ“ 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  
<br>

## ๐Ÿš€ 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  
<br>

## ๐Ÿ–ผ๏ธ 3. Visualization: World Observer Dashboard  
> A web-based dashboard that visualizes NPCs' internal states and relationship changes in real time  
![Dashboard Example](/npc_social_network/static/images/assets/dashboard_example.png)  
<br>

## ๐Ÿงฐ 4. Technology Stack

- **AI/ML**: Google Gemini, Sentence-Transformers, FAISS  
- **Frontend**: HTML, CSS  
- **Backend**: Python 3.10, Flask  
- **Memory Architecture**: RAG (Retrieval-Augmented Generation)  
<br>

## โš™๏ธ 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: [email protected]

<br>

[Back to top](#ํ•œ๊ตญ์–ด-์„ค๋ช…์„œ)