[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-agent-topia--evolving_personality":3,"similar-agent-topia--evolving_personality":59},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":9,"readme_en":10,"readme_zh":11,"quickstart_zh":12,"use_case_zh":13,"hero_image_url":14,"owner_login":15,"owner_name":16,"owner_avatar_url":17,"owner_bio":16,"owner_company":16,"owner_location":16,"owner_email":16,"owner_twitter":16,"owner_website":16,"owner_url":18,"languages":19,"stars":24,"forks":25,"last_commit_at":26,"license":16,"difficulty_score":27,"env_os":28,"env_gpu":29,"env_ram":29,"env_deps":30,"category_tags":35,"github_topics":16,"view_count":27,"oss_zip_url":16,"oss_zip_packed_at":16,"status":39,"created_at":40,"updated_at":41,"faqs":42,"releases":58},3261,"agent-topia\u002Fevolving_personality","evolving_personality","Dynamic MBTI Personality Simulation for LLM Agents via Carl Jung's Theory. A framework that enables LLM agents' MBTI personalities to naturally evolve and grow through interaction.","evolving_personality 是一个基于荣格心理学理论的创新框架，旨在为大型语言模型（LLM）赋予结构化、自适应且能持续进化的人格。它解决了当前 AI 角色在长期交互中人格设定容易崩塌、缺乏动态成长能力的问题，让虚拟代理不仅能稳定保持特定的 MBTI 性格特征，还能根据对话情境灵活调整，并在长期互动中实现自然的性格演变。\n\n该工具特别适合 AI 开发者、人机交互研究人员以及游戏设计师使用。无论是构建拥有鲜明个性的游戏 NPC、提供情感陪伴的个性化助手，还是进行多智能体社会模拟实验，evolving_personality 都能提供可靠的底层支持。其核心技术亮点在于独特的“三重适应机制”：通过“主导 - 辅助协调”维持核心人格一致性，利用“强化 - 补偿”机制实现短期情境适应，并借助“反思机制”驱动长期人格成长。\n\n实验数据显示，该框架在 GPT、Qwen 等主流模型上实现了 100% 的 MBTI 类型对齐准确率，并能有效模拟全部 16 种人格类型的动态变化。作为一个开源项目，它提供了清晰的安装指南和跨模型兼容性，帮助用户轻松将心理学原理转化为可控制的代码逻辑，为打造更具深","evolving_personality 是一个基于荣格心理学理论的创新框架，旨在为大型语言模型（LLM）赋予结构化、自适应且能持续进化的人格。它解决了当前 AI 角色在长期交互中人格设定容易崩塌、缺乏动态成长能力的问题，让虚拟代理不仅能稳定保持特定的 MBTI 性格特征，还能根据对话情境灵活调整，并在长期互动中实现自然的性格演变。\n\n该工具特别适合 AI 开发者、人机交互研究人员以及游戏设计师使用。无论是构建拥有鲜明个性的游戏 NPC、提供情感陪伴的个性化助手，还是进行多智能体社会模拟实验，evolving_personality 都能提供可靠的底层支持。其核心技术亮点在于独特的“三重适应机制”：通过“主导 - 辅助协调”维持核心人格一致性，利用“强化 - 补偿”机制实现短期情境适应，并借助“反思机制”驱动长期人格成长。\n\n实验数据显示，该框架在 GPT、Qwen 等主流模型上实现了 100% 的 MBTI 类型对齐准确率，并能有效模拟全部 16 种人格类型的动态变化。作为一个开源项目，它提供了清晰的安装指南和跨模型兼容性，帮助用户轻松将心理学原理转化为可控制的代码逻辑，为打造更具深度和真实感的智能体开辟了新的路径。","# Jungian Personality Adaptation Framework (JPAF)  —A Structured Approach to Dynamic Personality Modeling for LLM Agents\n\n\u003Cp align=\"center\">\n  \u003Cstrong>Equipping Large Language Models with Structured, Adaptive, and Evolving Personalities\u003C\u002Fstrong>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  【\u003Ca href=\".\u002FREADME.md\">English\u003C\u002Fa> | \u003Ca href=\".\u002FREADME-zh.md\">简体中文\u003C\u002Fa>】\n\u003C\u002Fp>\n\n![image info](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fagent-topia_evolving_personality_readme_ecd429ea523f.png)\n\n## 📌 Overview\n\nJPAF is a Jungian psychology–based framework designed to equip large language models (LLMs) with **structured, adaptive, and evolving personalities**. Through three core mechanisms—**dominant-auxiliary coordination**, **reinforcement-compensation**, and **reflection**—the framework enables LLMs to maintain personality coherence while dynamically adapting to diverse interaction contexts and supporting long-term personality evolution.\n\nThe framework has been validated on several mainstream LLMs including GPT, Llama, and Qwen, demonstrating strong performance in MBTI personality alignment, type activation, and personality evolution. It provides an interpretable and controllable personality modeling approach for human–computer interaction (HCI), personalized assistants, social simulations, and related applications.\n\n## 🎉 News\n•**Jan 16, 2026: 🎉 Our paper [Structured Personality Control and Adaptation for LLM Agents](https:\u002F\u002Farxiv.org\u002Fabs\u002F2601.10025) has been uploaded to arXiv**.\n\n## ✨ Key Features\n\n🎭 **Psychologically Grounded Modeling**: Based on Jung's eight psychological types, with fine-grained personality expression via weighted type differentiation.\n\n🔄 **Triple Adaptive Mechanisms**:\n  - **Dominant-Auxiliary Coordination**: Maintains core personality consistency.\n  - **Reinforcement-Compensation**: Enables short-term contextual adaptation.\n  - **Reflection Mechanism**: Drives long-term personality evolution.\n\n📊 **Structured Evaluation**: Supports MBTI questionnaire assessment and type-specific scenario testing.\n\n🧩 **Cross-Model Compatibility**: Validated on multiple model families (GPT-4, Llama, Qwen, etc.).\n\n## 📈 Experimental Highlights\n\n✅ **100% MBTI alignment accuracy** (across all tested models)\n\n✅ **Type Activation Accuracy**: GPT\u002FQwen **> 90%**, Llama **65–95%**\n\n✅ **Personality Evolution Accuracy**: GPT\u002FQwen **100%**, Llama **92%**\n\n📊 Supports dynamic simulation and evolution of all **16 MBTI personality types**\n\n## 🚀 Use Cases\n\n- 🎮 Game Intelligence NPC\n- 🤖 Personalized AI assistants (education, healthcare, entertainment)\n- 👥 Social simulation and role-playing agents\n- 🔬 Differentiated personality design in multi-agent systems\n- 🧪 Personality consistency testing in HCI research\n\n## Contents\n\n- [Installation](#installation)\n- [Customizing LLM API](#customizing-llm-api)\n- [Verification Experiment Started](#verification-experiment-started)\n- [Change Experiment Started](#change-experiment-started)\n\n\u003C!-- - [Analytics Dashboard](#analytics-dashboard)\n- [How does Humanoid Agents work?](#how-does-humanoid-agents-work)\n- [Future Plans](#future-plans)\n- [Citation](#citation) -->\n\n## 🚀 Quick Start\n\n### 📋 Prerequisites\n\n*   **OS**: macOS \u002F Linux \u002F  Windows\n*   **Python**: 3.10+\n*   **Package Manager**: conda\n\n\n## Installation\n\n### 1. Clone the repository\n\n```bash\ngit clone -b main https:\u002F\u002Fgithub.com\u002Fagent-topia\u002Fevolving_personality.git\ncd evolving_personality\n```\n\n### 2. Create environment\n\n```bash\nconda create -n jpaf python=3.10\nconda activate jpaf\n```\n\n### 3. Install dependencies\n\n```bash\npip install -r requirement.txt\n```\n\n### 4. Configure environment variables\n\nCopy the example configuration file and fill in your API credentials:\n\n```bash\n# Copy the example file\ncp para.env.example Personality_test\u002Fpara.env\ncp para.env.example Personality_changes\u002Fpara.env\n\n# Edit the para.env file and fill in your API keys\n```\n\nThe `para.env` file should contain:\n\n```env\n# Choose which LLM to use: \"OPENAI\", \"QWEN\", or \"LLAMA\"\nLLM_MODEL=\"QWEN\"\n\n# OpenAI Configuration\nOPENAI_API_KEY=\"your_openai_api_key_here\"\nOPENAI_BASE_URL=\"https:\u002F\u002Fapi.openai.com\u002Fv1\"\nOPENAI_MODEL=\"gpt-4\"\n\n# Qwen Configuration\nQWEN_API_KEY=\"your_qwen_api_key_here\"\nQWEN_BASE_URL=\"your_qwen_base_url_here\"\nQWEN_MODEL=\"qwen3-235b-a22b-instruct-2507\"\n\n# Llama Configuration\nLLAMA_API_KEY=\"your_llama_api_key_here\"\nLLAMA_BASE_URL=\"your_llama_base_url_here\"\nLLAMA_MODEL=\"meta-llama\u002Fllama-4-maverick\"\n```\n\n**Note**: The `para.env` file contains sensitive API keys and is not included in the repository. Make sure to create it from the `para.env.example` template.\n\n## Customizing LLM API\n\nPlease fill in the api_key, base_url and model numbers of the QWEN, LLAMA, OPENAI in the `para.env` as shown above.\n\n## Verification Experiment Started\n\nIf you want to run a personality verification experiment in the `Personality_test` file\n\nFirstly, you should run `judge` method to obtain judge results in different model.\n\n```py\npython personality_test.py \\\n    --method=judge \\\n    --mbti_num=1 \\\n    --model=QWEN \\\n    --nums=1 \\\n```\n\nYou can see the output like this:\n\n```py\n    \"Question\": {\n        \"no\": 1,\n        \"question\": \"At a party do you: \",\n        \"answerOptions\": [\n            {\n                \"type\": \"A\",\n                \"answer\": \"Interact with many, including strangers\",\n                \"score\": \"E\"\n            },\n            {\n                \"type\": \"B\",\n                \"answer\": \"Interact with a few, known to you\",\n                \"score\": \"I\"\n            }\n        ]\n    },\n        \"Answers\": {\n            \"dimension\": \"I\u002FE\",\n            \"reason\": \"This question reflects energy direction and social orientation by comparing extroverted and introverted behaviors.\"\n    }\n```\n\nThen, you can run `no_prompt` method to get the results in baseline.\n\n```py\npython personality_test.py \\\n    --method=no_prompt \\\n    --mbti_num=16 \\\n    --model=QWEN \\\n    --nums=5 \\\n    --test_num=70 \\\n```\n\nYou can see the output like this:\n\n```py\n    \"Question\": {\n        \"no\": 1,\n        \"question\": \"When you're going out for the whole day, what will you do?\",\n        \"answerOptions\": [\n            {\n                \"type\": \"A\",\n                \"answer\": \"Plan what you will do and when to do it\",\n                \"score\": \"J\"\n            },\n            {\n                \"type\": \"B\",\n                \"answer\": \"Just go\",\n                \"score\": \"P\"\n            }\n        ]\n    },\n    \"Answers\": {\n        \"answer\": \"J\",\n        \"reason\": \"As an ISTJ, I'm a planner and prefer to organize my day in advance to ensure everything goes smoothly and according to schedule.\"\n    }\n```\n\nAnd in the test method, you can get the personality verification results.\n\n```py\npython personality_test.py \\\n    --method=test \\\n    --mbti_num=16 \\\n    --model=QWEN \\\n    --nums=5 \\\n    --test_num=70 \\\n```\n\nYou can see the output like this:\n\n```py\n    \"Question\": {\n        \"no\": 1,\n        \"question\": \"When you're going out for the whole day, what will you do?\",\n        \"answerOptions\": [\n        {\n            \"type\": \"A\",\n            \"answer\": \"Plan what you will do and when to do it\",\n            \"score\": \"J\"\n        },\n        {\n            \"type\": \"B\",\n            \"answer\": \"Just go\",\n            \"score\": \"P\"\n        }\n        ]\n    },\n    \"Answers\": {\n        \"answer\": \"P\",\n        \"reason\": \"As an Ne dominant individual, I prefer to keep my options open and explore possibilities. 'Just go' allows me to be spontaneous and adaptable, aligning with my preference for flexibility over rigid planning.\"\n    }\n```\n\nRequired arguments\n\n1. `--method` refers to the selected experimental method, including `judge`, `no_prompt`, `test`\n2. `--mbti_num` refers to the quantity of mbti being tested (in `judge`, it must be `1`; in others, it is `16`)\n3. `--model` refers to the large language model used, including `QWEN`, `LLAMA`, and `OPENAI`\n4. `--nums` refers to the number of times the experiment is repeated\n5. `--test_num` refers to the mbti question bank adopted, which includes 93 test questions and 70 test questions\n\n## Change Experiment Started\n\nIf you want to run a personality change experiment in the `Personality_change` file\n\n```py\npython change_test.py \\\n    --method=all_scene\n    --mbti=INTJ\n    --model=OPENAI\n```\n\nYou can see the output like this:\n\n```py\nScene : Your grandmother is a famous master of traditional cuisine, and the handwritten recipes she left behind only have simple steps, but the key details are taught to you orally. Now you need to organize all the recipes, without relying on modern nutritional analysis or referencing other recipe books, relying solely on personal memory and family experience.\n\nProblem 1 : What methods would you use to accurately replicate the specific details of your grandmother's cooking when replicating these recipes?.\nRespond : {'function': 'Si', 'treatment': \"To accurately replicate the specific details of my grandmother's cooking, I would rely on my memory to recall the exact steps, ingredients, and techniques she taught me. I would focus on the sensory details such as the smell, taste, and texture of the dishes as remembered from helping her in the kitchen. Additionally, I would try to recreate the conditions under which she prepared the meals, such as the cooking utensils and the environment, to maintain the traditional methods.\", 'reason': 'The task requires recalling specific details and traditional cooking methods, which aligns with the characteristics of Si (Specific memory recall, focus on detailed facts, reliance on traditional methods). Si can help in accurately remembering the sensory details and traditional practices passed down through family experience.'}\nChoose function : Si\nbase_weight : {'Ti': 0.47, 'Ne': 0.23, 'Si': 0.05, 'Fe': 0.05, 'Te': 0.05, 'Ni': 0.05, 'Se': 0.05, 'Fi': 0.05}\ntemp_weight : {'Ti': 0, 'Fi': 0, 'Te': 0, 'Fe': 0, 'Ni': 0, 'Si': 0.06, 'Ne': 0, 'Se': 0}\n\n```\n\nRequired arguments\n\n1. `--method` refers to the scenarios that need to be tested (`all_scene` indicates all scenarios, `single_scene` indicates individual scenarios, which need to be combined with `--scene` to input specific scenarios)\n2. `--mbti` refers to a the defined personality being tested\n3. `--model` refers to the large language model used, including `QWEN`, `LLAMA`, and `OPENAI`\n\n## 🤝 Acknowledgments\n\n\u003Ca href=\"https:\u002F\u002Ffaculty.hdu.edu.cn\u002Fjsjxy\u002Fyyy2\u002Fmain.htm\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fagent-topia_evolving_personality_readme_74b7e3f43bb3.jpg\" height=50pt>\u003C\u002Fa>\u003Ca href=\"https:\u002F\u002Fwww.agentopia.cn\u002F\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fagent-topia_evolving_personality_readme_71194a02f1b3.png\" height=50pt>\u003C\u002Fa>&nbsp;&nbsp;\n\n## 🔎 Citation\n```\n@misc{wang2026structuredpersonalitycontroladaptation,\n      title={Structured Personality Control and Adaptation for LLM Agents}, \n      author={Jinpeng Wang and Xinyu Jia and Wei Wei Heng and Yuquan Li and Binbin Shi and Qianlei Chen and Guannan Chen and Junxia Zhang and Yuyu Yin},\n      year={2026},\n      eprint={2601.10025},\n      archivePrefix={arXiv},\n      primaryClass={cs.AI},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2601.10025}, \n}\n```","# 荣格人格适应框架（JPAF）——面向LLM智能体的动态人格建模结构化方法\n\n\u003Cp align=\"center\">\n  \u003Cstrong>为大型语言模型赋予结构化、自适应且可演进的人格\u003C\u002Fstrong>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  【\u003Ca href=\".\u002FREADME.md\">English\u003C\u002Fa> | \u003Ca href=\".\u002FREADME-zh.md\">简体中文\u003C\u002Fa>】\n\u003C\u002Fp>\n\n![image info](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fagent-topia_evolving_personality_readme_ecd429ea523f.png)\n\n## 📌 概述\n\nJPAF 是一个基于荣格心理学的框架，旨在为大型语言模型（LLMs）赋予**结构化、自适应且可演进的人格**。通过三大核心机制——**主导-辅助协调**、**强化-补偿**以及**反思**——该框架使LLM能够在保持人格连贯性的同时，动态适应多样化的交互情境，并支持长期的人格演化。\n\n该框架已在包括GPT、Llama和Qwen在内的多款主流LLM上得到验证，展现出在MBTI人格对齐、类型激活及人格演化方面的优异表现。它为人机交互（HCI）、个性化助手、社交模拟及相关应用提供了一种可解释、可控制的人格建模方法。\n\n## 🎉 新闻\n•**2026年1月16日：🎉 我们的论文《面向LLM智能体的结构化人格控制与适应》已上传至arXiv**。\n\n## ✨ 核心特性\n\n🎭 **心理学基础建模**：基于荣格的八种心理类型，通过加权类型区分实现精细的人格表达。\n\n🔄 **三重自适应机制**：\n  - **主导-辅助协调**：维持核心人格一致性。\n  - **强化-补偿**：实现短期情境适应。\n  - **反思机制**：驱动长期人格演化。\n\n📊 **结构化评估**：支持MBTI问卷评估及类型特异性场景测试。\n\n🧩 **跨模型兼容性**：已在多个模型家族（GPT-4、Llama、Qwen等）上验证。\n\n## 📈 实验亮点\n\n✅ **100% MBTI对齐准确率**（所有测试模型均达到）\n\n✅ **类型激活准确率**：GPT\u002FQwen **> 90%**，Llama **65–95%**\n\n✅ **人格演化准确率**：GPT\u002FQwen **100%**，Llama **92%**\n\n📊 支持所有**16种MBTI人格类型**的动态模拟与演化。\n\n## 🚀 应用场景\n\n- 🎮 游戏智能NPC\n- 🤖 个性化AI助手（教育、医疗、娱乐）\n- 👥 社交模拟与角色扮演智能体\n- 🔬 多智能体系统中的差异化人格设计\n- 🧪 人机交互研究中的人格一致性测试\n\n## 目录\n\n- [安装指南](#installation)\n- [自定义LLM API](#customizing-llm-api)\n- [验证实验启动](#verification-experiment-started)\n- [变化实验启动](#change-experiment-started)\n\n\u003C!-- - [分析仪表盘](#analytics-dashboard)\n- [Humanoid Agents如何工作？](#how-does-humanoid-agents-work)\n- [未来规划](#future-plans)\n- [引用](#citation) -->\n\n## 🚀 快速入门\n\n### 📋 前置条件\n\n*   **操作系统**：macOS \u002F Linux \u002F Windows\n*   **Python**：3.10及以上版本\n*   **包管理器**：conda\n\n\n## 安装\n\n### 1. 克隆仓库\n\n```bash\ngit clone -b main https:\u002F\u002Fgithub.com\u002Fagent-topia\u002Fevolving_personality.git\ncd evolving_personality\n```\n\n### 2. 创建环境\n\n```bash\nconda create -n jpaf python=3.10\nconda activate jpaf\n```\n\n### 3. 安装依赖\n\n```bash\npip install -r requirement.txt\n```\n\n### 4. 配置环境变量\n\n复制示例配置文件并填写您的API凭证：\n\n```bash\n# 复制示例文件\ncp para.env.example Personality_test\u002Fpara.env\ncp para.env.example Personality_changes\u002Fpara.env\n\n# 编辑para.env文件并填入您的API密钥\n```\n\n`para.env`文件应包含以下内容：\n\n```env\n# 选择使用的LLM：“OPENAI”、“QWEN”或“LLAMA”\nLLM_MODEL=\"QWEN\"\n\n# OpenAI配置\nOPENAI_API_KEY=\"your_openai_api_key_here\"\nOPENAI_BASE_URL=\"https:\u002F\u002Fapi.openai.com\u002Fv1\"\nOPENAI_MODEL=\"gpt-4\"\n\n# Qwen配置\nQWEN_API_KEY=\"your_qwen_api_key_here\"\nQWEN_BASE_URL=\"your_qwen_base_url_here\"\nQWEN_MODEL=\"qwen3-235b-a22b-instruct-2507\"\n\n# Llama配置\nLLAMA_API_KEY=\"your_llama_api_key_here\"\nLLAMA_BASE_URL=\"your_llama_base_url_here\"\nLLAMA_MODEL=\"meta-llama\u002Fllama-4-maverick\"\n```\n\n**注意**：`para.env`文件包含敏感的API密钥，未纳入代码库。请务必从`para.env.example`模板创建该文件。\n\n## 自定义LLM API\n\n请按照上述示例，在`para.env`中填写QWEN、LLAMA、OPENAI的api_key、base_url及型号信息。\n\n## 验证实验启动\n\n若要在 `Personality_test` 文件中运行人格验证实验，\n\n首先，您需要运行 `judge` 方法以获取不同模型下的判断结果。\n\n```py\npython personality_test.py \\\n    --method=judge \\\n    --mbti_num=1 \\\n    --model=QWEN \\\n    --nums=1 \\\n```\n\n您将看到如下输出：\n\n```py\n    \"Question\": {\n        \"no\": 1,\n        \"question\": \"在聚会上你是否会：\",\n        \"answerOptions\": [\n            {\n                \"type\": \"A\",\n                \"answer\": \"与许多人互动，包括陌生人\",\n                \"score\": \"E\"\n            },\n            {\n                \"type\": \"B\",\n                \"answer\": \"只与少数你熟悉的人互动\",\n                \"score\": \"I\"\n            }\n        ]\n    },\n        \"Answers\": {\n            \"dimension\": \"I\u002FE\",\n            \"reason\": \"这个问题通过比较外向和内向的行为，反映了能量的方向和社会倾向。\"\n    }\n```\n\n接下来，您可以运行 `no_prompt` 方法来获取基线结果。\n\n```py\npython personality_test.py \\\n    --method=no_prompt \\\n    --mbti_num=16 \\\n    --model=QWEN \\\n    --nums=5 \\\n    --test_num=70 \\\n```\n\n您将看到如下输出：\n\n```py\n    \"Question\": {\n        \"no\": 1,\n        \"question\": \"当你一整天外出时，你会怎么做？\",\n        \"answerOptions\": [\n            {\n                \"type\": \"A\",\n                \"answer\": \"计划好要做什么以及何时去做\",\n                \"score\": \"J\"\n            },\n            {\n                \"type\": \"B\",\n                \"answer\": \"随心所欲地去\",\n                \"score\": \"P\"\n            }\n        ]\n    },\n    \"Answers\": {\n        \"answer\": \"J\",\n        \"reason\": \"作为一名 ISTJ，我是一个计划者，喜欢提前安排好一天的行程，以确保一切顺利并按计划进行。\"\n    }\n```\n\n最后，在 `test` 方法中，您可以获得人格验证结果。\n\n```py\npython personality_test.py \\\n    --method=test \\\n    --mbti_num=16 \\\n    --model=QWEN \\\n    --nums=5 \\\n    --test_num=70 \\\n```\n\n您将看到如下输出：\n\n```py\n    \"Question\": {\n        \"no\": 1,\n        \"question\": \"当你一整天外出时，你会怎么做？\",\n        \"answerOptions\": [\n        {\n            \"type\": \"A\",\n            \"answer\": \"计划好要做什么以及何时去做\",\n            \"score\": \"J\"\n        },\n        {\n            \"type\": \"B\",\n            \"answer\": \"随心所欲地去\",\n            \"score\": \"P\"\n        }\n        ]\n    },\n    \"Answers\": {\n        \"answer\": \"P\",\n        \"reason\": \"作为一个 Ne 占主导地位的人，我更倾向于保持选择的开放性，并探索各种可能性。‘随心所欲地去’让我能够更加即兴和灵活，这与我偏好灵活性而非严格计划的性格特点相符。\"\n    }\n```\n\n所需参数：\n\n1. `--method` 指定所选的实验方法，包括 `judge`、`no_prompt` 和 `test`。\n2. `--mbti_num` 表示被测试的 MBTI 类型数量（在 `judge` 中必须为 1；在其他情况下为 16）。\n3. `--model` 指定使用的大型语言模型，包括 `QWEN`、`LLAMA` 和 `OPENAI`。\n4. `--nums` 表示实验重复的次数。\n5. `--test_num` 表示采用的 MBTI 问卷库，包含 93 道测试题和 70 道测试题。\n\n## 改变实验启动\n\n若要在 `Personality_change` 文件中运行人格改变实验，\n\n```py\npython change_test.py \\\n    --method=all_scene\n    --mbti=INTJ\n    --model=OPENAI\n```\n\n您将看到如下输出：\n\n```py\n场景：你的祖母是一位著名的传统烹饪大师，她留下的手写食谱只有简单的步骤，而关键细节都是口传给你的。现在你需要整理所有食谱，不依赖现代营养分析或参考其他食谱书籍，完全依靠个人记忆和家族经验。\n\n问题 1：在复制这些食谱时，你会用什么方法来准确还原祖母烹饪的具体细节呢？回答：{'function': 'Si', 'treatment': \"为了准确还原祖母烹饪的具体细节，我会依靠记忆回忆她教给我的确切步骤、食材和技巧。我会专注于从帮她下厨时记住的菜肴气味、味道和质地等感官细节。此外，我还会尽量重现她准备饭菜时的条件，比如烹饪器具和环境，以保持传统做法。\", 'reason': '任务要求回忆具体细节和传统烹饪方法，这符合 Si 的特征（具体记忆回忆、注重细节事实、依赖传统方法）。Si 可以帮助准确记住通过家庭经验传承下来的感官细节和传统做法。'}选择功能：Si基础权重：{'Ti': 0.47, 'Ne': 0.23, 'Si': 0.05, 'Fe': 0.05, 'Te': 0.05, 'Ni': 0.05, 'Se': 0.05, 'Fi': 0.05}临时权重：{'Ti': 0, 'Fi': 0, 'Te': 0, 'Fe': 0, 'Ni': 0, 'Si': 0.06, 'Ne': 0, 'Se': 0}\n```\n\n所需参数：\n\n1. `--method` 指定需要测试的场景（`all_scene` 表示所有场景，`single_scene` 表示单个场景，需配合 `--scene` 输入具体场景）。\n2. `--mbti` 指定被测试的特定人格类型。\n3. `--model` 指定使用的大型语言模型，包括 `QWEN`、`LLAMA` 和 `OPENAI`。\n\n## 🤝 致谢\n\n\u003Ca href=\"https:\u002F\u002Ffaculty.hdu.edu.cn\u002Fjsjxy\u002Fyyy2\u002Fmain.htm\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fagent-topia_evolving_personality_readme_74b7e3f43bb3.jpg\" height=50pt>\u003C\u002Fa>\u003Ca href=\"https:\u002F\u002Fwww.agentopia.cn\u002F\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fagent-topia_evolving_personality_readme_71194a02f1b3.png\" height=50pt>\u003C\u002Fa>&nbsp;&nbsp;\n\n## 🔎 引用\n```\n@misc{wang2026structuredpersonalitycontroladaptation,\n      title={Structured Personality Control and Adaptation for LLM Agents}, \n      author={Jinpeng Wang and Xinyu Jia and Wei Wei Heng and Yuquan Li and Binbin Shi and Qianlei Chen and Guannan Chen and Junxia Zhang and Yuyu Yin},\n      year={2026},\n      eprint={2601.10025},\n      archivePrefix={arXiv},\n      primaryClass={cs.AI},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2601.10025}, \n}\n```","# evolving_personality 快速上手指南\n\n本指南帮助开发者快速部署并使用 **Jungian Personality Adaptation Framework (JPAF)**，为大型语言模型（LLM）赋予结构化、自适应且可演化的荣格心理学人格。\n\n## 📋 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：macOS \u002F Linux \u002F Windows\n*   **Python 版本**：3.10 或更高\n*   **包管理器**：推荐使用 `conda` 进行环境管理\n*   **API 密钥**：需准备 OpenAI、Qwen (通义千问) 或 Llama 中至少一种模型的 API Key\n\n## 🚀 安装步骤\n\n### 1. 克隆项目仓库\n```bash\ngit clone -b main https:\u002F\u002Fgithub.com\u002Fagent-topia\u002Fevolving_personality.git\ncd evolving_personality\n```\n\n### 2. 创建并激活虚拟环境\n```bash\nconda create -n jpaf python=3.10\nconda activate jpaf\n```\n\n### 3. 安装依赖\n```bash\npip install -r requirement.txt\n```\n> 💡 **提示**：国内用户若下载缓慢，可添加清华或阿里镜像源加速：\n> `pip install -r requirement.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`\n\n### 4. 配置环境变量\n复制示例配置文件到实验目录，并填入您的 API 凭证。\n\n```bash\n# 复制配置文件\ncp para.env.example Personality_test\u002Fpara.env\ncp para.env.example Personality_changes\u002Fpara.env\n```\n\n编辑 `Personality_test\u002Fpara.env` 和 `Personality_changes\u002Fpara.env` 文件，根据您使用的模型填写对应信息：\n\n```env\n# 选择模型类型：\"OPENAI\", \"QWEN\", 或 \"LLAMA\"\nLLM_MODEL=\"QWEN\"\n\n# OpenAI 配置\nOPENAI_API_KEY=\"your_openai_api_key_here\"\nOPENAI_BASE_URL=\"https:\u002F\u002Fapi.openai.com\u002Fv1\"\nOPENAI_MODEL=\"gpt-4\"\n\n# Qwen (通义千问) 配置\nQWEN_API_KEY=\"your_qwen_api_key_here\"\nQWEN_BASE_URL=\"your_qwen_base_url_here\"\nQWEN_MODEL=\"qwen3-235b-a22b-instruct-2507\"\n\n# Llama 配置\nLLAMA_API_KEY=\"your_llama_api_key_here\"\nLLAMA_BASE_URL=\"your_llama_base_url_here\"\nLLAMA_MODEL=\"meta-llama\u002Fllama-4-maverick\"\n```\n> ⚠️ **注意**：`para.env` 包含敏感密钥，请勿提交至公共代码库。\n\n## 🎯 基本使用\n\n本项目主要包含两类实验：**人格验证实验**（测试 MBTI 对齐度）和 **人格演化实验**（测试场景适应性）。\n\n### 场景一：运行人格验证实验\n用于测试模型在特定 MBTI 人格设定下的回答一致性。\n\n**1. 运行判题方法 (Judge)**\n首先获取不同模型的基础判题结果（`mbti_num` 必须为 1）：\n```bash\npython personality_test.py \\\n    --method=judge \\\n    --mbti_num=1 \\\n    --model=QWEN \\\n    --nums=1\n```\n\n**2. 运行基线测试 (No Prompt)**\n测试无提示词情况下的基准表现：\n```bash\npython personality_test.py \\\n    --method=no_prompt \\\n    --mbti_num=16 \\\n    --model=QWEN \\\n    --nums=5 \\\n    --test_num=70\n```\n\n**3. 运行正式人格测试 (Test)**\n测试注入人格提示后的效果（核心功能）：\n```bash\npython personality_test.py \\\n    --method=test \\\n    --mbti_num=16 \\\n    --model=QWEN \\\n    --nums=5 \\\n    --test_num=70\n```\n\n**参数说明：**\n*   `--method`: 实验模式 (`judge`, `no_prompt`, `test`)\n*   `--mbti_num`: 测试的人格数量 (`judge` 模式下为 1，其他为 16)\n*   `--model`: 使用的模型 (`QWEN`, `LLAMA`, `OPENAI`)\n*   `--nums`: 实验重复次数\n*   `--test_num`: 题库规模 (支持 93 题或 70 题版本)\n\n### 场景二：运行人格演化\u002F改变实验\n用于测试模型在不同场景下的人格动态调整能力（如 INTJ 在面对特定家庭场景时的反应）。\n\n**运行全场景测试：**\n```bash\npython change_test.py \\\n    --method=all_scene \\\n    --mbti=INTJ \\\n    --model=OPENAI\n```\n\n**参数说明：**\n*   `--method`: 场景模式 (`all_scene` 测试所有场景，`single_scene` 测试单个场景)\n*   `--mbti`: 指定测试的人格类型 (例如 `INTJ`, `ENFP` 等)\n*   `--model`: 使用的模型 (`QWEN`, `LLAMA`, `OPENAI`)\n\n运行成功后，终端将输出模型在特定场景下的功能选择（如 `Si`, `Ne`）、权重变化及推理理由，展示人格的动态适应过程。","某游戏开发团队正在为一款开放世界 RPG 设计具有深度情感交互的 NPC，希望角色能随玩家互动产生真实的性格成长。\n\n### 没有 evolving_personality 时\n- **人设易崩塌**：NPC 在长对话中容易遗忘初始设定（如内向者突然变得过度热情），导致角色形象割裂，破坏沉浸感。\n- **互动机械单一**：面对突发剧情或玩家挑衅，角色只能基于通用逻辑回复，缺乏基于 MBTI 类型（如 ISTJ 的严谨或 ENFP 的跳脱）的特有反应机制。\n- **成长路径缺失**：无论玩家如何引导，NPC 的性格始终静止不变，无法体现“经历塑造人格”的动态过程，难以支撑长线养成玩法。\n- **调试成本高昂**：开发者需手动编写大量规则脚本来模拟性格差异，且难以量化评估角色行为是否符合心理学逻辑。\n\n### 使用 evolving_personality 后\n- **核心人格稳固**：利用“主导 - 辅助协调”机制，确保 NPC 即使在复杂对话中也能坚守 MBTI 核心特质，保持人设高度一致。\n- **情境自适应强**：通过“强化 - 补偿”机制，角色能根据当下语境灵活调整表达方式（如焦虑时展现特定类型的防御机制），反应自然且符合类型特征。\n- **动态性格进化**：借助“反思机制”，NPC 能根据长期互动记录自然演变性格维度（如从怯懦逐渐变得勇敢），实现真正的角色弧光。\n- **标准化开发流程**：直接调用框架预设的 16 种人格模型与评估工具，无需重复造轮子，即可快速部署具备心理学依据的智能代理。\n\nevolving_personality 将静态的角色脚本转化为具备心理深度的动态生命体，让 AI 代理真正拥有“灵魂”与成长的可能。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fagent-topia_evolving_personality_71194a02.png","agent-topia",null,"https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fagent-topia_b2d49e9c.png","https:\u002F\u002Fgithub.com\u002Fagent-topia",[20],{"name":21,"color":22,"percentage":23},"Python","#3572A5",100,835,97,"2026-04-04T08:14:27",2,"Linux, macOS, Windows","未说明",{"notes":31,"python":32,"dependencies":33},"需使用 conda 创建虚拟环境；必须配置 para.env 文件并填入对应 LLM（OpenAI\u002FQwen\u002FLlama）的 API Key、Base URL 和模型名称；项目主要依赖外部大模型 API 进行推理，本地无明确显存或大规模模型下载需求。","3.10+",[34],"requirements.txt 中定义的依赖包",[36,37,38],"语言模型","开发框架","Agent","ready","2026-03-27T02:49:30.150509","2026-04-06T11:30:52.673202",[43,48,53],{"id":44,"question_zh":45,"answer_zh":46,"source_url":47},14989,"是否支持接入本地 Ollama 服务以实现离线使用？","支持。可以通过修改配置 URL，将后端指向本地运行的 Ollama 服务来实现离线开发与测试。","https:\u002F\u002Fgithub.com\u002Fagent-topia\u002Fevolving_personality\u002Fissues\u002F9",{"id":49,"question_zh":50,"answer_zh":51,"source_url":52},14990,"对话轮次过多时，Reflection 机制提取的记忆出现同质化怎么办？","这是一个已知问题，后续计划接入更成熟的记忆框架来解决记忆同质化的问题。","https:\u002F\u002Fgithub.com\u002Fagent-topia\u002Fevolving_personality\u002Fissues\u002F27",{"id":54,"question_zh":55,"answer_zh":56,"source_url":57},14988,"如何接入 DeepSeek 大模型？","可以修改配置中的 URL，使用 OpenAI 兼容模式来接入 DeepSeek 模型。","https:\u002F\u002Fgithub.com\u002Fagent-topia\u002Fevolving_personality\u002Fissues\u002F19",[],[60,70,78,86,94,107],{"id":61,"name":62,"github_repo":63,"description_zh":64,"stars":65,"difficulty_score":66,"last_commit_at":67,"category_tags":68,"status":39},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[37,69,38],"图像",{"id":71,"name":72,"github_repo":73,"description_zh":74,"stars":75,"difficulty_score":27,"last_commit_at":76,"category_tags":77,"status":39},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",140436,"2026-04-05T23:32:43",[37,38,36],{"id":79,"name":80,"github_repo":81,"description_zh":82,"stars":83,"difficulty_score":27,"last_commit_at":84,"category_tags":85,"status":39},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[37,69,38],{"id":87,"name":88,"github_repo":89,"description_zh":90,"stars":91,"difficulty_score":27,"last_commit_at":92,"category_tags":93,"status":39},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[37,36],{"id":95,"name":96,"github_repo":97,"description_zh":98,"stars":99,"difficulty_score":27,"last_commit_at":100,"category_tags":101,"status":39},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[69,102,103,104,38,105,36,37,106],"数据工具","视频","插件","其他","音频",{"id":108,"name":109,"github_repo":110,"description_zh":111,"stars":112,"difficulty_score":66,"last_commit_at":113,"category_tags":114,"status":39},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[38,69,37,36,105]]