{"id":13958298,"url":"https://github.com/microsoft/RecAI","last_synced_at":"2025-07-20T23:31:04.545Z","repository":{"id":219532718,"uuid":"688379529","full_name":"microsoft/RecAI","owner":"microsoft","description":"Bridging LLM and Recommender System.","archived":false,"fork":false,"pushed_at":"2024-11-15T07:39:00.000Z","size":17531,"stargazers_count":599,"open_issues_count":12,"forks_count":54,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-11-21T03:05:41.989Z","etag":null,"topics":["llm","recommender"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-07T08:21:52.000Z","updated_at":"2024-11-20T17:08:32.000Z","dependencies_parsed_at":"2024-01-28T05:27:18.491Z","dependency_job_id":"564a832f-6cf8-4da9-a780-7f66dd8bc626","html_url":"https://github.com/microsoft/RecAI","commit_stats":{"total_commits":53,"total_committers":10,"mean_commits":5.3,"dds":0.7358490566037736,"last_synced_commit":"757e4cac8faf6bd688c65e98bfc8b6e0bce5e7a7"},"previous_names":["microsoft/recai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FRecAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FRecAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FRecAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FRecAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/RecAI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226844968,"owners_count":17691136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llm","recommender"],"created_at":"2024-08-08T13:01:29.002Z","updated_at":"2025-07-20T23:31:04.532Z","avatar_url":"https://github.com/microsoft.png","language":"Jupyter Notebook","funding_links":[],"categories":["其他_推荐系统","Jupyter Notebook"],"sub_categories":["网络服务_其他"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"./assets/logo.png\" alt=\"Recommender System with AI\"/\u003e\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# RecAI: Leveraging Large Language Models for Next-Generation Recommender Systems\n\n\u003c/div\u003e\n\nLarge Language Models (LLMs) offer significant potential for the development of cutting-edge recommender systems, particularly in terms of enhancing interactivity, explainability, and controllability. These are aspects that have traditionally posed challenges. However, the direct application of a general-purpose LLM for recommendation purposes is not viable due to the absence of specific domain knowledge.\n\nThe RecAI project aims to bridge this gap by investigating various strategies to integrate LLMs into recommender systems, a concept people usually term as LLM4Rec. Our goal is to reflect the real-world needs of LLM4Rec through holistic views and methodologies.\n\nWe believe that by adopting a holistic perspective, we can incorporate the majority of practical requirements of LLM4Rec into one or more of the techniques explored in the RecAI project. These techniques include, but are not limited to, Recommender AI agents, the injection of knowledge through personalized prompting, fine-tuning language models as recommenders, evaluation, and LLMs as model explainers. The ultimate objective is to create a more sophisticated, interactive, and user-centric recommender system.\n\n\u003cdiv align=\"center\" style=\"background-image:url(./assets/background/background.png);background-color:rgba(255, 255, 255, 0.8);background-blend-mode:overlay;background-position:right;background-repeat:no-repeat;background-size:100% 100%;\"\u003e\n\n\u003ctable\u003e  \n  \u003ctr\u003e  \n    \u003ctd\u003e \u003cimg src=\"./assets/recagent.png\" alt=\"Recommender AI agent\" /\u003e \u003c/td\u003e  \n    \u003ctd\u003e \n     \u003cstrong style=\"font-size:3vw\"\u003e \u003ca href=\"https://github.com/microsoft/RecAI/blob/main/InteRecAgent/README.md\" style=\"color: #0000FF; text-decoration: underline;\"\u003e Recommender AI Agent \u003c/a\u003e \u003c/strong\u003e \u003cbr\u003e LLMs provide natural interactions and respond smartly to human instructions but lack domain-specific expertise. In contrast, traditional recommender systems excel with in-domain data training yet are constrained to structured data and lack interactivity. InteRecAgent introduces an AI agent that combines the strengths of both: it employs an LLM as the brain and traditional recommender models as tools. Consequently, traditional models like matrix factorization can be transformed into conversational, interactive, and explainable recommender systems..\n     \u003c/td\u003e  \n  \u003c/tr\u003e \n\n  \u003ctr\u003e  \n    \u003ctd\u003e \u003cimg src=\"./assets/knowledge-plugin.png\" alt=\"Selective Knowledge Plugin\" /\u003e \u003c/td\u003e  \n    \u003ctd\u003e \n     \u003cstrong style=\"font-size:3vw\"\u003e \u003ca href=\"https://github.com/microsoft/RecAI/blob/main/Knowledge_Plugin/README.md\" style=\"color: #0000FF; text-decoration: underline;\"\u003e Selective Knowledge Plugin \u003c/a\u003e\u003c/strong\u003e \u003c/br\u003e\n     How can we enhance an LLM's domain-specific ability without finetuning the model? Then the prompt is the key. In this work, we introduce a method that augments LLMs with selective knowledge, so that large-scale, continuously evolving, and domain-specific data patterns can be injected by prompt. \n     \u003c/td\u003e  \n  \u003c/tr\u003e   \n\n  \u003ctr\u003e  \n    \u003ctd\u003e \u003cimg src=\"./assets/reclm-emb.png\" alt=\"Embedding RecLM\" /\u003e \u003c/td\u003e  \n    \u003ctd\u003e \n     \u003cstrong style=\"font-size:3vw\"\u003e \u003ca href=\"https://github.com/microsoft/RecAI/blob/main/RecLM-emb/README.md\" style=\"color: #0000FF; text-decoration: underline;\"\u003e Embedding RecLM \u003c/a\u003e\u003c/strong\u003e \u003c/br\u003e\n     Dense retrieval is a crucial component in a range of scenarios, including recommender systems and retrieval-augmented generation (RAG). While generative language models such as GPTs are designed for sequential token generation, they are not optimized for retrieval-oriented embedding. This is where our project, RecLM-emb, comes into play. RecLM-emb aligns with text-embedding models like text-embedding-ada-002, but it is specifically optimized for item retrieval. The goal is to embed everything for item retrieval. Currently it only supports text modality, such as search query, item description, and user instructions.\n     \u003c/td\u003e  \n  \u003c/tr\u003e \n\n  \u003ctr\u003e  \n    \u003ctd\u003e \u003cimg src=\"./assets/reclm-gen.png\" alt=\"Generative RecLM \" /\u003e \u003c/td\u003e  \n    \u003ctd\u003e \n     \u003cstrong style=\"font-size:3vw\"\u003e \u003ca href=\"https://github.com/microsoft/RecAI/blob/main/RecLM-gen/README.md\" style=\"color: #0000FF; text-decoration: underline;\"\u003e Generative RecLM \u003c/a\u003e\u003c/strong\u003e \u003c/br\u003e\n  It's important to note that data patterns vary significantly across domains, meaning a general-purpose LLM may not deliver optimized performance within a specific domain. To adapt to specific domain data patterns, grounding to domain item catalogs, and enhance instruction-following capability, this project discusses the process of fine-tuning a generative Language Model for recommenders, referred to as RecLM-gen. Techniques include supervised finetuning (SFT) and reinforcement learning (RL). Potential applications of this approach include rankers, conversational recommenders, and user simulators.\n     \u003c/td\u003e  \n  \u003c/tr\u003e \n\n  \u003ctr\u003e  \n    \u003ctd\u003e \u003cimg src=\"./assets/recexplainer.png\" alt=\"Recommendation model explainer\" /\u003e \u003c/td\u003e  \n    \u003ctd\u003e \n     \u003cstrong style=\"font-size:3vw\"\u003e \u003ca href=\"https://github.com/microsoft/RecAI/blob/main/RecExplainer/README.md\" style=\"color: #0000FF; text-decoration: underline;\"\u003e Model Explainer \u003c/a\u003e\u003c/strong\u003e \u003c/br\u003e\n     Deep learning-based recommender systems are widely used in various online services, thanks to their superiority in effectiveness and efficiency. However, these models often lack interpretability, making them less reliable and transparent for both users and developers. In this work, we propose a new model interpretation approach for recommender systems, call RecExplainer, by using LLMs as surrogate models and learn to mimic and comprehend target recommender models.\n     \u003c/td\u003e  \n  \u003c/tr\u003e \n\n  \u003ctr\u003e  \n    \u003ctd\u003e \u003cimg src=\"./assets/eval.png\" alt=\"Recommendation Evaluator\"/\u003e \u003c/td\u003e  \n    \u003ctd\u003e \n     \u003cstrong style=\"font-size:3vw\"\u003e \u003ca href=\"https://github.com/microsoft/RecAI/blob/main/RecLM-eval/README.md\" style=\"color: #0000FF; text-decoration: underline;\"\u003e RecLM Evaluator \u003c/a\u003e\u003c/strong\u003e \u003c/br\u003e\nEvaluation is crucial for assessing the true capabilities of models and identifying areas of weakness for further improvement. In the era of using language models as recommenders, which function in a human-like manner, the evaluation method has significantly deviated from traditional styles. This project intends to offer a comprehensive service for the evaluation of LM-based recommender systems. Whether provided with a trained LM or an API (such as Azure OpenAI API), it assesses the model's performance from various perspectives, including retrieval, ranking, explanation capability, and general AI ability.\n     \u003c/td\u003e  \n  \u003c/tr\u003e \n\u003c/table\u003e  \n\u003c/div\u003e\n\n## License\nRecAI uses [MIT](./LICENSE) license. \n\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft \ntrademarks or logos is subject to and must follow \n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n\n\n## Acknowledge\n\nThanks to the open source codes of the following projects:\n\n[UniRec](https://github.com/microsoft/UniRec) \u0026#8194;\n[VisualChatGPT](https://github.com/microsoft/TaskMatrix/blob/main/visual_chatgpt.py) \u0026#8194;\n[JARVIS](https://github.com/microsoft/JARVIS) \u0026#8194;\n[LangChain](https://github.com/langchain-ai/langchain) \u0026#8194;\n[guidance](https://github.com/microsoft/guidance) \u0026#8194;\n[FlagEmbedding](https://github.com/FlagOpen/FlagEmbedding) \u0026#8194;\n\n## Responsible AI FAQ\n\nPlease refer to [RecAI: Responsible AI FAQ](./RAI_FAQ.md) for document on the purposes, capabilities, and limitations of the RecAI systems. \n\n\n\n## Citation\nIf this project aids your research, please cite our following paper:\n#### RecAI Overview:\n```\n@inproceedings{10.1145/3589335.3651242,\n    author = {Lian, Jianxun and Lei, Yuxuan and Huang, Xu and Yao, Jing and Xu, Wei and Xie, Xing},\n    title = {RecAI: Leveraging Large Language Models for Next-Generation Recommender Systems},\n    year = {2024},\n    isbn = {9798400701726},\n    publisher = {Association for Computing Machinery},\n    address = {New York, NY, USA},\n    url = {https://doi.org/10.1145/3589335.3651242},\n    doi = {10.1145/3589335.3651242},\n    booktitle = {Companion Proceedings of the ACM Web Conference 2024},\n    pages = {1031–1034},\n    numpages = {4},\n    keywords = {large language models, recommender systems},\n    location = {Singapore, Singapore},\n    series = {WWW '24}\n}\n```\nAnd corresponding paper in the subfolder:\n\n#### InteRecAgent:\n```\n@article{10.1145/3731446,\n    author = {Huang, Xu and Lian, Jianxun and Lei, Yuxuan and Yao, Jing and Lian, Defu and Xie, Xing},\n    title = {Recommender AI Agent: Integrating Large Language Models for Interactive Recommendations},\n    year = {2025},\n    publisher = {Association for Computing Machinery},\n    address = {New York, NY, USA},\n    issn = {1046-8188},\n    url = {https://doi.org/10.1145/3731446},\n    doi = {10.1145/3731446},\n    note = {Just Accepted},\n    journal = {ACM Trans. Inf. Syst.},\n    month = apr,\n    keywords = {Conversational Recommendation, Large Language Models, Interactive Agents}\n}\n```\n\n#### Knowledge_Plugin:\n```\n@misc{yao2023knowledgepluginsenhancinglarge,\n      title={Knowledge Plugins: Enhancing Large Language Models for Domain-Specific Recommendations}, \n      author={Jing Yao and Wei Xu and Jianxun Lian and Xiting Wang and Xiaoyuan Yi and Xing Xie},\n      year={2023},\n      eprint={2311.10779},\n      archivePrefix={arXiv},\n      primaryClass={cs.IR},\n      url={https://arxiv.org/abs/2311.10779}, \n}\n```\n\n#### RecExplainer:\n```\n@inproceedings{10.1145/3637528.3671802,\n    author = {Lei, Yuxuan and Lian, Jianxun and Yao, Jing and Huang, Xu and Lian, Defu and Xie, Xing},\n    title = {RecExplainer: Aligning Large Language Models for Explaining Recommendation Models},\n    year = {2024},\n    isbn = {9798400704901},\n    publisher = {Association for Computing Machinery},\n    address = {New York, NY, USA},\n    url = {https://doi.org/10.1145/3637528.3671802},\n    doi = {10.1145/3637528.3671802},\n    booktitle = {Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},\n    pages = {1530–1541},\n    numpages = {12},\n    keywords = {large language models, model explainability, recommender systems},\n    location = {Barcelona, Spain},\n    series = {KDD '24}\n}\n```\n\n#### RecLM-cgen:\n```\n@article{liao2025avoid,\n    title={Avoid Recommending Out-of-Domain Items: Constrained Generative Recommendation with LLMs}, \n    author={Liao, Hao and Lu, Wensheng and Lian, Jianxun and Wu, Mingqi and Wang, Shuo and Zhang, Yong and Huang, Yitian and Zhou, Mingyang and Xie, Xing},\n    journal={arXiv preprint arXiv:2505.03336}\n    year={2025},\n}\n```\n\n#### RecLM-emb:\n```\n@inproceedings{10.1145/3589335.3651468,\n    author = {Lei, Yuxuan and Lian, Jianxun and Yao, Jing and Wu, Mingqi and Lian, Defu and Xie, Xing},\n    title = {Aligning Language Models for Versatile Text-based Item Retrieval},\n    year = {2024},\n    isbn = {9798400701726},\n    publisher = {Association for Computing Machinery},\n    address = {New York, NY, USA},\n    url = {https://doi.org/10.1145/3589335.3651468},\n    doi = {10.1145/3589335.3651468},\n    booktitle = {Companion Proceedings of the ACM Web Conference 2024},\n    pages = {935–938},\n    numpages = {4},\n    keywords = {item retrieval, search and recommendation, text embedding},\n    location = {Singapore, Singapore},\n    series = {WWW '24}\n}\n```\n\n#### RecLM-gen:\n```\n@inproceedings{lu-etal-2024-aligning,\n    title = \"Aligning Large Language Models for Controllable Recommendations\",\n    author = \"Lu, Wensheng  and Lian, Jianxun  and Zhang, Wei  and Li, Guanghua  and Zhou, Mingyang  and Liao, Hao  and Xie, Xing\",\n    editor = \"Ku, Lun-Wei  and Martins, Andre  and Srikumar, Vivek\",\n    booktitle = \"Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)\",\n    month = aug,\n    year = \"2024\",\n    address = \"Bangkok, Thailand\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://aclanthology.org/2024.acl-long.443/\",\n    doi = \"10.18653/v1/2024.acl-long.443\",\n    pages = \"8159--8172\",\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2FRecAI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2FRecAI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2FRecAI/lists"}