经 AI Skill Hub 精选评估,Agent4Rec Agent工作流 获评「强烈推荐」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。
基于大语言模型的推荐系统AI代理框架。实现SIGIR 2024论文方案,支持生成式智能体在推荐场景中的应用。适合推荐系统研究者、NLP工程师和AI产品开发者深度定制个性化推荐流程。
Agent4Rec Agent工作流 是一款基于 Python 开发的开源工具,专注于 推荐系统、LLM代理、生成式AI 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
基于大语言模型的推荐系统AI代理框架。实现SIGIR 2024论文方案,支持生成式智能体在推荐场景中的应用。适合推荐系统研究者、NLP工程师和AI产品开发者深度定制个性化推荐流程。
Agent4Rec Agent工作流 是一款基于 Python 开发的开源工具,专注于 推荐系统、LLM代理、生成式AI 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install agent4rec
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install agent4rec
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/LehengTHU/Agent4Rec
cd Agent4Rec
pip install -e .
# 验证安装
python -c "import agent4rec; print('安装成功')"
# 命令行使用
agent4rec --help
# 基本用法
agent4rec input_file -o output_file
# Python 代码中调用
import agent4rec
# 示例
result = agent4rec.process("input")
print(result)
# agent4rec 配置文件示例(config.yml) app: name: "agent4rec" debug: false log_level: "INFO" # 运行时指定配置文件 agent4rec --config config.yml # 或通过环境变量配置 export AGENT4REC_API_KEY="your-key" export AGENT4REC_OUTPUT_DIR="./output"
<img src="https://img.shields.io/badge/License-MIT-blue" alt="license">

Agent4Rec, a recommender system simulator with 1,000 LLM-empowered generative agents. These agents are initialized from the MovieLens-1M dataset, embodying varied social traits and preferences. Each agent interacts with personalized movie recommendations in a page-by-page manner and undertakes various actions such as watching, rating, evaluating, exiting, and interviewing. With Agent4Rec, we would like to explore the potential of LLM-empowered generative agents in simulating the behavior of genuine, independent humans in recommendation environments.
</div>
<p id="Catalogue"></p>
Set up a virtualenv and install the pytorch manually. After that, install all the dependencies listed in the requirements.txt file by running the following command:
pip install -r requirements.txt Our experiments have been tested on Python 3.9.12 with PyTorch 1.13.1+cu117. Python version over 3.10 may lead to some bugs in the package 'reckit'.
By running the following command, you will start a toy simulation with 3 agents.
python main.py The response of agents to recommended items will be printed in the terminal. This simulation will take around 3 minutes to finish.
<p id="Explore-Various-Recommender-Settings"></p>
Make sure you are in the directory of recommenders/ (where setup.py can be found), and run the following code.
python setup.py build_ext --inplace
The command will install necessary tools for accelerating recommender evaluation.
<p id="Simulation"></p>
Agent4Rec supports various recommendation systems and different simulation configurations.
python main.py --simulation_name MyExp --modeltype MF --n_avatars 10 --max_pages 5 --items_per_page 4 --execution_mode parallel
By running this code, you will start a simulation named MyExp with 10 agents, each agent will browse max to 5 pages with 4 items on a single page. The recommender used in this example is Matrix Factorization (short for MF). And the experiment will be executed in parallel model to speed up the simulation.
You can choose the employed recommender by modifying --modeltype <model_name> in the command. You can replace <model_name> with the following supported recommenders: - Random: Randomly recommend items to users. - Pop: Randomly recommend popular items to users. - MF: Pretrained Matrix Factorization model with BPR loss. - MultVAE: Pretrained MultVAE model. - LightGCN: Pretrained LightGCN model with BPR loss.
<p id="Results"></p>
学术驱动的高质量项目,SIGIR论文实现具有参考价值。代理框架设计合理,适合推荐系统创新研究。维护度良好,社区关注度可。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:Agent4Rec Agent工作流 的核心功能完整,质量优秀。对于AI爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | Agent4Rec |
| 原始描述 | 开源AI工作流:SIGIR 2024 perspective The implementation of paper "On Generative Agents in Reco。⭐483 · Python |
| Topics | 推荐系统LLM代理生成式AIAI工作流学术实现 |
| GitHub | https://github.com/LehengTHU/Agent4Rec |
| License | MIT |
| 语言 | Python |
收录时间:2026-05-14 · 更新时间:2026-05-16 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。