[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-pipiku915--FinMem-LLM-StockTrading":3,"tool-pipiku915--FinMem-LLM-StockTrading":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},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",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},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",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},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",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":80,"owner_email":80,"owner_twitter":80,"owner_website":81,"owner_url":82,"languages":83,"stars":96,"forks":97,"last_commit_at":98,"license":99,"difficulty_score":100,"env_os":101,"env_gpu":102,"env_ram":103,"env_deps":104,"category_tags":111,"github_topics":80,"view_count":23,"oss_zip_url":80,"oss_zip_packed_at":80,"status":16,"created_at":112,"updated_at":113,"faqs":114,"releases":153},3274,"pipiku915\u002FFinMem-LLM-StockTrading","FinMem-LLM-StockTrading","FinMem: A Performance-Enhanced LLM Trading Agent with Layered Memory and Character Design","FinMem-LLM-StockTrading 是一个专为金融投资决策打造的大语言模型（LLM）智能体框架。它旨在解决传统 LLM 在处理复杂、多源金融数据时缺乏理性架构的痛点，帮助模型从单纯的知识问答转向具备目的性的自主交易决策。\n\n该工具通过模拟人类交易员的认知结构，构建了三大核心模块：角色画像（Profiling）、分层记忆（Memory）和决策制定（Decision-making）。其独特的技术亮点在于“分层记忆”机制，不仅能高效整合层级化的金融数据，还具备可调节的认知跨度，能够保留超越人类感知极限的关键历史信息，从而在波动剧烈的市场中做出更精准的反应。此外，系统支持自我进化专业知识，确保持续优化投资策略。\n\nFinMem-LLM-StockTrading 特别适合人工智能研究人员、量化金融开发者以及对构建自主金融代理感兴趣的技术团队使用。对于希望探索大模型在垂直领域深度应用，或需要高可解释性、实时可调优交易系统的专业人士来说，这是一个极具价值的开源参考方案。","# FINMEM: A Performance-Enhanced LLM Trading Agent with Layered Memory and Character Design\n\n[![Python 3.10](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.10-blue.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Frelease\u002Fpython-3100\u002F) [![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT) [![Black](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode%20style-black-000000.svg)](https:\u002F\u002Fgithub.com\u002Fambv\u002Fblack) [![arXiv](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-2311.13743-b31b1b.svg)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2311.13743)\n\n```text\n\"So we beat on, boats against the current, borne back ceaselessly into the past.\"\n                                        -- F. Scott Fitzgerald: The Great Gatsby\n```\n\nThis repo provides the Python source code for the paper:\n[FINMEM: A Performance-Enhanced Large Language Model Trading Agent with Layered Memory and Character Design](https:\u002F\u002Farxiv.org\u002Fabs\u002F2311.13743) [[PDF]](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2311.13743.pdf)\n\n```bibtex\n@misc{yu2023finmem,\n      title={FinMem: A Performance-Enhanced LLM Trading Agent with Layered Memory and Character Design}, \n      author={Yangyang Yu and Haohang Li and Zhi Chen and Yuechen Jiang and Yang Li and Denghui Zhang and Rong Liu and Jordan W. Suchow and Khaldoun Khashanah},\n      year={2023},\n      eprint={2311.13743},\n      archivePrefix={arXiv},\n      primaryClass={q-fin.CP}\n}\n```\n**📢 Update (Date: 01-16-2024)**\n\n🚀 We're excited to share that our work, \"FINMEM: A Performance-Enhanced LLM Trading Agent with Layered Memory and Character Design,\" has been selected for an extended abstract at the AAAI Spring Symposium on Human-Like Learning!\n\n**📢 Update (Date: 03-11-2024)**\n\n🚀 We're thrilled to announce that our paper, \"FINMEM: A Performance-Enhanced LLM Trading Agent with Layered Memory and Character Design\", has been accepted by ICLR Workshop LLM Agents!\n\n**📢 Update (Date: 06-16-2024)**\n\n🎉 Thank you to all the participants and organizers of the IJCAI2024 challenge, \"Financial Challenges in Large Language Models - FinLLM\". Our team, FinMem, was thrilled to contribute to Task 3: Single Stock Trading.\n\nAs the challenge wrapped up yesterday (06\u002F15\u002F2024), we reflect on the innovative approaches and insights gained throughout this journey. A total of 12 teams participated, each bringing unique perspectives and solutions to the forefront of financial AI and Large Language Models.\n\nWe invite the community to continue engaging with us as we look forward to further developments and collaborations in this exciting field.\n\n\nRecent advancements in Large Language Models (LLMs) have exhibited notable efficacy in question-answering (QA) tasks across diverse domains. Their prowess in integrating extensive web knowledge has fueled interest in developing LLM-based autonomous agents. While LLMs are efficient in decoding human instructions and deriving solutions by holistically processing historical inputs, transitioning to purpose-driven agents requires a supplementary rational architecture to process multi-source information, establish reasoning chains, and prioritize critical tasks. Addressing this, we introduce FinMem, a novel LLM-based agent framework devised for financial decision-making, encompassing three core modules: Profiling, to outline the agent's characteristics; Memory, with layered processing, to aid the agent in assimilating realistic hierarchical financial data; and Decision-making, to convert insights gained from memories into investment decisions. Notably, FinMem's memory module aligns closely with the cognitive structure of human traders, offering robust interpretability and real-time tuning. Its adjustable cognitive span allows for the retention of critical information beyond human perceptual limits, thereby enhancing trading outcomes. This framework enables the agent to self-evolve its professional knowledge, react agilely to new investment cues, and continuously refine trading decisions in the volatile financial environment. We first compare FinMem with various algorithmic agents on a scalable real-world financial dataset, underscoring its leading trading performance in stocks and funds. We then fine-tuned the agent's perceptual spans to achieve a significant trading performance. Collectively, FinMem presents a cutting-edge LLM agent framework for automated trading, boosting cumulative investment returns.\n\n![1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpipiku915_FinMem-LLM-StockTrading_readme_24f9af93fe30.png)\n![2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpipiku915_FinMem-LLM-StockTrading_readme_664b554c4964.png)\n![3](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpipiku915_FinMem-LLM-StockTrading_readme_adea91eaeba0.png)\n\n## Repository Structure\n\n```bash\nfinmem-docker\n├── LICENSE\n├── README.md\n├── config  -> Configurations for the program\n├── data  -> Data\n├── puppy  -> Source code\n├── run.py  -> Entry point of the program, see below for details\n├── run_examples.sh  -> Bash cmd for build the docker image and run the docker container\n```\n\n\n\n## Usage\n\n### Setting Environment Variables & Configurations for Different Models\n\nThe model can be run with LLMs on HuggingFace that can be deployed via [TGI](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftext-generation-inference) and has sufficient instruction following ability. As we will always use the `text-embedding-ada-002` as our embedding model, the `OPENAI_API_KEY` variable needs to be set in `.env` no matter what backbone LLM is used.\n\nIf the LLM is gated, the `HF_TOKEN` needs to be set in `.env`\n\n```bash\nOPENAI_API_KEY = \"\u003CYour OpenAI Key>\"\nHF_TOKEN = \"\u003CYour HF token>\"\n```\n\nand set the `config\u002Fconfig.toml`\n\n```bash\n[chat]\nmodel = \"tgi\"\nend_point = \"\u003Cset the your endpoint address>\"\ntokenization_model_name = \"\u003Cmodel name>\"\n...\n```\n\nTo run the OpenAI model, the configuration file should be set as\n\n```bash\nmodel = \"gpt-4\"\nend_point = \"https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fchat\u002Fcompletions\"\ntokenization_model_name = \"gpt-4\"\n```\n\nand with comment out `HF_TOKEN` in `.env`\n\n```bash\nOPENAI_API_KEY = \"\u003CYour OpenAI Key>\"\n# HF_TOKEN = \"\"\n```\n\n### Build Docker Image & Run the Container\n\nThe dockerfile is based on Python 3.10 at\n\n```bash\n.devcontainer\u002FDockerfile\n```\n\nTo build the docker image, run\n\n```bash\ndocker build -t test-finmem finmem\u002F.devcontainer\u002F. \n```\n\nTo start the container, run\n\n```bash\ndocker run -it --rm -v $(pwd):\u002Ffinmem test-finmem bash\n```\n\nThis will enter the root folder of the project.\n\n## Program\n\nThe program has two main functionalities:\n\n```bash\n Usage: run.py sim [OPTIONS]                                                                                                                \n                                                                                                                                            \n Start Simulation                                                                                                                           \n                                                                                                                                            \n╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ --market-data-path    -mdp      TEXT  The environment data pickle path [default: data\u002F06_input\u002Fsubset_symbols.pkl]                       │\n│ --start-time          -st       TEXT  The training or test start time [default: 2022-06-30 For Ticker 'TSLA']                                                               │\n│ --end-time            -et       TEXT  The training or test end time [default: 2022-10-11]                                                                 │\n│ --run-model           -rm       TEXT  Run mode: train or test [default: train]                                                           │\n│ --config-path         -cp       TEXT  config file path [default: config\u002Fconfig.toml]                                                     │\n│ --checkpoint-path     -ckp      TEXT  The checkpoint save path [default: data\u002F10_checkpoint_test]                                             │\n│ --result-path         -rp       TEXT  The result save path [default: data\u002F11_train_result]                                               │\n│ --trained-agent-path  -tap      TEXT  Only used in test mode, the path of trained agent [default: None. Can be changed to data\u002F05_train_model_output OR data\u002F06_train_checkpoint]                                  │\n│ --help                                Show this message and exit.                                                                        │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n                              \n```\n\nNotice our model has two modes: `train` and `test`. In the train mode, the information populate the agent's memory. In the test mode, the agent will use the information in the memory and new information to make decisions. When `test` mode is selected, the trained agent must be provided.\n\nWhen the program stopped due to exceptions(OpenAI API is not stable, etc.), the training\u002Ftesting process can be resumed with\n\n```bash\n                                                                                                                                            \n Usage: run.py sim-checkpoint [OPTIONS]                                                                                                     \n                                                                                                                                            \n Start Simulation from checkpoint                                                                                                           \n                                                                                                                                            \n╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ --checkpoint-path  -cp      TEXT  The checkpoint path [default: data\u002F06_train_checkpoint]                                                │\n│ --result-path      -rp      TEXT  The result save path [default: data\u002F05_train_model_output]                                             │\n│ --config-path      -ckp      TEXT  config file path [default: config\u002Ftsla_config.toml]                                                    │\n│ --run-model        -rm      TEXT  Run mode: train or test [default: train]                                                               │\n│ --help                            Show this message and exit.                                                                            │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n```\n## Star History\n\n[![Star History Chart](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpipiku915_FinMem-LLM-StockTrading_readme_fe9ea1ae9c7d.png)](https:\u002F\u002Fstar-history.com\u002F#pipiku915\u002FFinMem-LLM-StockTrading&Date)\n","# FINMEM：具有分层记忆与角色设计的性能增强型LLM交易代理\n\n[![Python 3.10](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.10-blue.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Frelease\u002Fpython-3100\u002F) [![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT) [![Black](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode%20style-black-000000.svg)](https:\u002F\u002Fgithub.com\u002Fambv\u002Fblack) [![arXiv](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-2311.13743-b31b1b.svg)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2311.13743)\n\n```text\n“于是我们继续奋力向前，逆水行舟，被不断地向后推，回到往昔。”\n                                        —— F·斯科特·菲茨杰拉德：《了不起的盖茨比》\n```\n\n本仓库提供了论文的Python源代码：\n[FINMEM：具有分层记忆与角色设计的性能增强型大型语言模型交易代理](https:\u002F\u002Farxiv.org\u002Fabs\u002F2311.13743) [[PDF]](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2311.13743.pdf)\n\n```bibtex\n@misc{yu2023finmem,\n      title={FinMem: A Performance-Enhanced LLM Trading Agent with Layered Memory and Character Design}, \n      author={Yangyang Yu and Haohang Li and Zhi Chen and Yuechen Jiang and Yang Li and Denghui Zhang and Rong Liu and Jordan W. Suchow and Khaldoun Khashanah},\n      year={2023},\n      eprint={2311.13743},\n      archivePrefix={arXiv},\n      primaryClass={q-fin.CP}\n}\n```\n**📢 更新（日期：2024年1月16日）**\n\n🚀 我们很高兴地宣布，我们的工作“FINMEM：具有分层记忆与角色设计的性能增强型LLM交易代理”已被AAAI春季人类学习研讨会选为扩展摘要！\n\n**📢 更新（日期：2024年3月11日）**\n\n🚀 我们非常激动地宣布，我们的论文“FINMEM：具有分层记忆与角色设计的性能增强型LLM交易代理”已被ICLR LLM代理研讨会接受！\n\n**📢 更新（日期：2024年6月16日）**\n\n🎉 感谢所有参与IJCAI2024挑战赛“大型语言模型中的金融挑战——FinLLM”的参与者和组织者。我们的团队FinMem非常荣幸能够参与任务3：单只股票交易。\n\n随着挑战赛于昨日（2024年6月15日）圆满结束，我们回顾了整个过程中所获得的创新方法和深刻见解。共有12支队伍参与其中，每支队伍都带来了独特的视角和解决方案，推动了金融AI与大型语言模型领域的前沿发展。\n\n我们诚挚邀请社区继续与我们互动，共同期待这一激动人心领域的进一步发展与合作。\n\n\n近年来，大型语言模型（LLMs）在跨领域问答（QA）任务中表现出显著的效果。其整合海量网络知识的能力激发了开发基于LLM的自主代理的兴趣。尽管LLMs能够高效地解析人类指令，并通过整体处理历史输入得出解决方案，但要将其转化为以目标为导向的代理，仍需补充一种合理的架构，以处理多源信息、构建推理链条并优先处理关键任务。为此，我们提出了FinMem，一个专为金融决策设计的新型LLM代理框架，包含三个核心模块：角色刻画模块，用于定义代理的特征；记忆模块，采用分层处理机制，帮助代理吸收真实的多层次金融数据；以及决策模块，将从记忆中获取的洞察转化为投资决策。值得注意的是，FinMem的记忆模块与人类交易员的认知结构高度契合，具备强大的可解释性和实时调优能力。其可调节的认知跨度使代理能够存储超出人类感知极限的关键信息，从而提升交易绩效。该框架使代理能够自我进化专业知识，敏捷响应新的投资信号，并在瞬息万变的金融市场环境中持续优化交易决策。我们首先在可扩展的真实世界金融数据集上将FinMem与多种算法型代理进行对比，证明其在股票和基金交易方面的领先表现。随后，我们对代理的认知跨度进行了微调，进一步提升了交易效果。总体而言，FinMem提供了一个用于自动化交易的尖端LLM代理框架，能够显著提高累计投资回报。\n\n![1](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpipiku915_FinMem-LLM-StockTrading_readme_24f9af93fe30.png)\n![2](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpipiku915_FinMem-LLM-StockTrading_readme_664b554c4964.png)\n![3](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpipiku915_FinMem-LLM-StockTrading_readme_adea91eaeba0.png)\n\n## 仓库结构\n\n```bash\nfinmem-docker\n├── LICENSE\n├── README.md\n├── config  -> 程序配置文件\n├── data  -> 数据\n├── puppy  -> 源代码\n├── run.py  -> 程序入口，详情见下文\n├── run_examples.sh  -> 用于构建Docker镜像并运行容器的Bash脚本\n```\n\n\n\n## 使用方法\n\n### 设置不同模型的环境变量及配置\n\n该模型可以使用HuggingFace上的LLM运行，这些LLM可通过[TGI](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftext-generation-inference)部署，并且具备足够的指令遵循能力。由于我们将始终使用`text-embedding-ada-002`作为嵌入模型，因此无论使用何种基础LLM，都需要在`.env`文件中设置`OPENAI_API_KEY`变量。\n\n如果LLM受到访问限制，则需要在`.env`文件中设置`HF_TOKEN`：\n\n```bash\nOPENAI_API_KEY = \"\u003C您的OpenAI密钥>\"\nHF_TOKEN = \"\u003C您的HF令牌>\"\n```\n\n同时在`config\u002Fconfig.toml`中进行如下设置：\n\n```bash\n[chat]\nmodel = \"tgi\"\nend_point = \"\u003C请设置您的端点地址>\"\ntokenization_model_name = \"\u003C模型名称>\"\n...\n```\n\n若要运行OpenAI模型，配置文件应设置为：\n\n```bash\nmodel = \"gpt-4\"\nend_point = \"https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fchat\u002Fcompletions\"\ntokenization_model_name = \"gpt-4\"\n```\n\n并注释掉`.env`文件中的`HF_TOKEN`：\n\n```bash\nOPENAI_API_KEY = \"\u003C您的OpenAI密钥>\"\n# HF_TOKEN = \"\"\n```\n\n### 构建Docker镜像并运行容器\n\nDockerfile基于Python 3.10，位于以下路径：\n\n```bash\n.devcontainer\u002FDockerfile\n```\n\n构建Docker镜像的命令如下：\n\n```bash\ndocker build -t test-finmem finmem\u002F.devcontainer\u002F.\n```\n\n启动容器的命令如下：\n\n```bash\ndocker run -it --rm -v $(pwd):\u002Ffinmem test-finmem bash\n```\n\n这将进入项目的根目录。\n\n## 程序\n\n该程序有两个主要功能：\n\n```bash\n 用法：run.py sim [选项]                                                                                                                \n                                                                                                                                            \n  启动模拟                                                                                                                           \n                                                                                                                                            \n╭─ 选项 ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ --market-data-path    -mdp      文本  环境数据 pickle 文件路径 [默认值：data\u002F06_input\u002Fsubset_symbols.pkl]                       │\n│ --start-time          -st       文本  训练或测试的开始时间 [默认值：2022-06-30，针对股票代码 'TSLA']                                                               │\n│ --end-time            -et       文本  训练或测试的结束时间 [默认值：2022-10-11]                                                                 │\n│ --run-model           -rm       文本  运行模式：train（训练）或 test（测试） [默认值：train]                                                           │\n│ --config-path         -cp       文本  配置文件路径 [默认值：config\u002Fconfig.toml]                                                     │\n│ --checkpoint-path     -ckp      文本  检查点保存路径 [默认值：data\u002F10_checkpoint_test]                                             │\n│ --result-path         -rp       文本  结果保存路径 [默认值：data\u002F11_train_result]                                               │\n│ --trained-agent-path  -tap      文本  仅在测试模式下使用，已训练智能体的路径 [默认值：无。可改为 data\u002F05_train_model_output 或 data\u002F06_train_checkpoint]                                  │\n│ --help                                显示此消息并退出。                                                                        │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n                              \n```\n\n请注意，我们的模型有两种模式：`train` 和 `test`。在训练模式下，信息会被填充到智能体的内存中。而在测试模式下，智能体会利用内存中的信息以及新的输入来做出决策。当选择测试模式时，必须提供已经训练好的智能体。\n\n如果程序因异常而中断（例如 OpenAI API 不稳定等），可以通过以下命令从检查点继续训练或测试过程：\n\n```bash\n                                                                                                                                            \n 用法：run.py sim-checkpoint [选项]                                                                                                     \n                                                                                                                                            \n  从检查点启动模拟                                                                                                           \n                                                                                                                                            \n╭─ 选项 ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ --checkpoint-path  -cp      文本  检查点路径 [默认值：data\u002F06_train_checkpoint]                                                │\n│ --result-path      -rp      文本  结果保存路径 [默认值：data\u002F05_train_model_output]                                             │\n│ --config-path      -ckp      文本  配置文件路径 [默认值：config\u002Ftsla_config.toml]                                                    │\n│ --run-model        -rm      文本  运行模式：train 或 test [默认值：train]                                                               │\n│ --help                            显示此消息并退出。                                                                            │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n```\n## 星标历史\n\n[![星标历史图表](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpipiku915_FinMem-LLM-StockTrading_readme_fe9ea1ae9c7d.png)](https:\u002F\u002Fstar-history.com\u002F#pipiku915\u002FFinMem-LLM-StockTrading&Date)","# FinMem-LLM-StockTrading 快速上手指南\n\nFinMem 是一个基于大语言模型（LLM）的金融交易智能体框架，通过分层记忆和角色设计增强交易决策能力。本指南帮助中国开发者快速部署并运行该工具。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux \u002F macOS (Windows 用户建议使用 WSL2 或 Docker Desktop)\n- **Python 版本**: 3.10 (必须)\n- **Docker**: 已安装并运行 (推荐方式)\n- **GPU**: 可选，若本地部署开源模型建议配备 NVIDIA GPU\n\n### 前置依赖与账号\n在开始之前，请确保拥有以下密钥：\n1. **OpenAI API Key**: 用于嵌入模型 (`text-embedding-ada-002`)，无论主模型如何选择均需配置。\n2. **Hugging Face Token** (可选): 仅当使用受保护的 Hugging Face 模型时需要。\n\n> **国内加速提示**: \n> - 访问 Hugging Face 受阻时，请使用镜像站 `hf-mirror.com` 或在代码中设置 `HF_ENDPOINT=https:\u002F\u002Fhf-mirror.com`。\n> - 拉取 Docker 镜像缓慢时，建议配置阿里云、腾讯云或网易云等国内 Docker 镜像加速器。\n\n## 安装步骤\n\n本项目推荐使用 Docker 容器化部署，以避免环境依赖冲突。\n\n### 1. 克隆项目\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fpipiku915\u002FFinMem-LLM-StockTrading.git\ncd FinMem-LLM-StockTrading\n```\n\n### 2. 配置环境变量\n在项目根目录创建 `.env` 文件，填入您的 API 密钥：\n\n```bash\nOPENAI_API_KEY = \"\u003CYour OpenAI Key>\"\n# 如果使用 gated HuggingFace 模型，取消下行注释并填入 Token\n# HF_TOKEN = \"\u003CYour HF token>\"\n```\n\n*注：若使用国内镜像加速 HuggingFace，可在 `.env` 或启动命令中额外添加 `HF_ENDPOINT=https:\u002F\u002Fhf-mirror.com`。*\n\n### 3. 配置模型参数\n编辑 `config\u002Fconfig.toml` 文件。\n\n**方案 A：使用 OpenAI 模型 (GPT-4)**\n```toml\n[chat]\nmodel = \"gpt-4\"\nend_point = \"https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fchat\u002Fcompletions\"\ntokenization_model_name = \"gpt-4\"\n```\n*注意：此时请确保 `.env` 中的 `HF_TOKEN` 已被注释。*\n\n**方案 B：使用 HuggingFace\u002FTGI 部署的本地模型**\n```toml\n[chat]\nmodel = \"tgi\"\nend_point = \"\u003C您的 TGI 服务地址>\"\ntokenization_model_name = \"\u003C模型名称>\"\n```\n\n### 4. 构建并运行 Docker 容器\n执行以下命令构建镜像并进入容器交互模式：\n\n```bash\n# 构建镜像\ndocker build -t test-finmem finmem\u002F.devcontainer\u002F. \n\n# 启动容器并挂载当前目录\ndocker run -it --rm -v $(pwd):\u002Ffinmem test-finmem bash\n```\n进入容器后，您将位于项目的根目录 `\u002Ffinmem`。\n\n## 基本使用\n\n程序入口为 `run.py`，支持 **训练 (train)** 和 **测试 (test)** 两种模式。\n\n### 1. 运行训练模式\n此模式将市场数据加载到智能体的记忆层中，构建交易策略基础。\n\n```bash\npython run.py sim \\\n  --market-data-path data\u002F06_input\u002Fsubset_symbols.pkl \\\n  --start-time 2022-06-30 \\\n  --end-time 2022-10-11 \\\n  --run-model train \\\n  --config-path config\u002Fconfig.toml \\\n  --checkpoint-path data\u002F10_checkpoint_test \\\n  --result-path data\u002F11_train_result\n```\n\n### 2. 运行测试模式\n此模式利用训练好的记忆和新数据进行实盘模拟决策。**必须指定已训练的智能体路径**。\n\n```bash\npython run.py sim \\\n  --market-data-path data\u002F06_input\u002Fsubset_symbols.pkl \\\n  --start-time 2022-06-30 \\\n  --end-time 2022-10-11 \\\n  --run-model test \\\n  --config-path config\u002Fconfig.toml \\\n  --trained-agent-path data\u002F05_train_model_output \\\n  --checkpoint-path data\u002F10_checkpoint_test \\\n  --result-path data\u002F11_train_result\n```\n\n### 3. 从断点恢复\n若因网络波动（如 OpenAI API 不稳定）导致中断，可使用以下命令从检查点继续：\n\n```bash\npython run.py sim-checkpoint \\\n  --checkpoint-path data\u002F06_train_checkpoint \\\n  --result-path data\u002F05_train_model_output \\\n  --config-path config\u002Ftsla_config.toml \\\n  --run-model train\n```\n\n> **提示**: 默认数据路径针对特斯拉 (TSLA) 股票示例。若要交易其他标的，请修改 `--market-data-path` 并提供相应的数据文件。","某量化初创团队的首席策略师正试图利用大语言模型构建自动化交易代理，以在波动剧烈的科技股板块中捕捉短线机会。\n\n### 没有 FinMem-LLM-StockTrading 时\n- **信息过载导致决策瘫痪**：面对海量的实时新闻、财报数据和历史 K 线，普通 LLM 难以区分主次，往往被噪音干扰而错过关键信号。\n- **缺乏连贯的交易人格**：模型每次决策都像“失忆”般重新开始，无法维持一致的风险偏好（如激进或保守），导致策略风格漂移。\n- **长周期记忆缺失**：无法有效关联数周前的宏观事件与当前的股价异动，推理链条断裂，难以形成深度的因果分析。\n- **黑盒操作难以信任**：决策过程缺乏可解释性，交易员不知道模型为何买卖，不敢将真金白银托付给不可控的代码。\n\n### 使用 FinMem-LLM-StockTrading 后\n- **分层记忆精准过滤**：FinMem-LLM-StockTrading 的分层记忆模块像人类交易员一样，自动将信息按重要性分级，迅速锁定影响股价的核心因子。\n- **角色化设定稳定风格**：通过\"Profiling\"模块定义明确的交易员人设，确保代理在任何市场环境下都严格遵循预设的风险控制纪律。\n- **超长认知跨度推理**：工具能保留并调用超出人类感知极限的历史数据，将过去的政策变化与今日行情逻辑串联，做出更具前瞻性的判断。\n- **决策透明可追溯**：每一笔交易建议都附带基于记忆层的推理路径，策略师可以清晰复盘代理的思考过程，大幅提升了人机协作的信任度。\n\nFinMem-LLM-StockTrading 通过模拟人类交易员的认知结构与记忆机制，将大语言模型从单纯的“问答机器”进化为具备专业直觉与持续进化能力的金融决策伙伴。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fpipiku915_FinMem-LLM-StockTrading_5418a186.png","pipiku915","Shirley Yu","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fpipiku915_a61b0c38.jpg","Cognitive Science,  Deep Learning, Multi-modal Learning, FinTech, Face Recognition, Bayesian Statistics, Data Science","Stevens Institute of Technology",null,"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fyangyang%EF%BC%88shirley%EF%BC%89-yu-88542174\u002F","https:\u002F\u002Fgithub.com\u002Fpipiku915",[84,88,92],{"name":85,"color":86,"percentage":87},"Python","#3572A5",98.1,{"name":89,"color":90,"percentage":91},"Shell","#89e051",1.5,{"name":93,"color":94,"percentage":95},"Dockerfile","#384d54",0.4,870,186,"2026-04-02T07:52:42","MIT",4,"Linux, macOS, Windows","未说明 (依赖具体使用的 LLM 后端，如通过 TGI 部署的模型通常需要 GPU)","未说明",{"notes":105,"python":106,"dependencies":107},"该项目推荐使用 Docker 运行。必须配置环境变量 OPENAI_API_KEY（用于嵌入模型），若使用受限的 HuggingFace 模型还需配置 HF_TOKEN。支持通过 TGI 部署的本地大模型或直接调用 OpenAI API (如 GPT-4)。程序包含训练和测试两种模式，支持从检查点恢复运行。","3.10",[108,109,110],"text-generation-inference (TGI)","OpenAI API (text-embedding-ada-002)","HuggingFace Transformers (隐含)",[26,15],"2026-03-27T02:49:30.150509","2026-04-06T07:14:18.132434",[115,120,125,130,135,140,145,149],{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},15030,"如何获取价格数据（price_data.parquet）？","您可以使用 `yfinance` 包从 Yahoo Finance 获取价格数据。项目已更新数据管道，请参照最新的 `00_download_yfinance.py` 脚本或 Docker 化版本来自动生成所需的 `.parquet` 文件。","https:\u002F\u002Fgithub.com\u002Fpipiku915\u002FFinMem-LLM-StockTrading\u002Fissues\u002F11",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},15031,"如何计算“买入并持有”（Buy and Hold）策略的累计收益率？","在单资产交易任务中，累计收益率仅取决于价格变化百分比，与初始现金数量无关。计算公式为：每日收益率 = log(p_i+1 \u002F p_i)。例如，若初始价格为 100 美元，最终价格为 110 美元，无论购买多少股，累计收益率均为 10%。无需设置初始现金金额，因为目标资产的权重固定为 1、-1 或 0。","https:\u002F\u002Fgithub.com\u002Fpipiku915\u002FFinMem-LLM-StockTrading\u002Fissues\u002F23",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},15032,"运行下载脚本时提示缺少中间文件（如 parsed_ark.csv, yf_data.parquet）怎么办？","这是因为旧版脚本路径或逻辑已过时。请使用主分支（main branch）中最新重构的数据管道和 Docker 化版本。新版代码包含了详细的数据处理说明，能够自动解决文件缺失和路径错误问题。","https:\u002F\u002Fgithub.com\u002Fpipiku915\u002FFinMem-LLM-StockTrading\u002Fissues\u002F6",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},15033,"如何使用提供的假样本数据（fake-sample-data）进行测试？","解压 zip 文件后，通常需要修复所有 Python 文件中的数据路径以指向样本数据位置。由于目前数据生成步骤存在较多 Bug 且文档说明模糊，建议直接使用维护者提供的 Docker 化版本或等待官方更新更清晰的数据集生成指南。","https:\u002F\u002Fgithub.com\u002Fpipiku915\u002FFinMem-LLM-StockTrading\u002Fissues\u002F14",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},15034,"如何将模型后端从 GPT-4 替换为开源大语言模型（如 Llama, Mixtral）？","请使用项目更新的 Docker 化版本。该版本支持部署任何兼容 Hugging Face Text Generation Inference (TGI) 的模型。您只需配置 TGI 即可运行开源模型，无需修改核心代码。参考链接：https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftext-generation-inference","https:\u002F\u002Fgithub.com\u002Fpipiku915\u002FFinMem-LLM-StockTrading\u002Fissues\u002F7",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},15035,"运行模拟时出现 KeyError: 'general' 配置文件错误如何解决？","这是由于代码库曾包含单股票和多股票两种配置，现已放弃多股票案例。请拉取最新的 Pull Request 获取更新后的 `config.toml` 文件，该文件采用了正确的格式。旧的配置文件格式已不再适用。","https:\u002F\u002Fgithub.com\u002Fpipiku915\u002FFinMem-LLM-StockTrading\u002Fissues\u002F3",{"id":146,"question_zh":147,"answer_zh":148,"source_url":144},15036,"项目中引用的宏观经济变量（如 ANDENO, PERMIT 等）在哪里获取？是否必须？","在最终论文版本中，这些宏观经济变量已被弃用，因为实验发现它们对单股票交易的贡献有限，通常不需要使用。如果您仍需获取，这些数据是公开的，可从 FRED 数据库下载：ANDENO (https:\u002F\u002Ffred.stlouisfed.org\u002Fseries\u002FANDENO), PERMIT (https:\u002F\u002Ffred.stlouisfed.org\u002Fseries\u002FPERMIT), ICSA 等。",{"id":150,"question_zh":151,"answer_zh":152,"source_url":144},15037,"文件 `data\u002F06_input\u002Fall_symbols.pkl` 是如何生成的？","此前存在文件名错误。请运行 `process_raw_data\u002Fgenerate_all_data.py` 和 `process_raw_data\u002Fgenerate_all_data_sub2.py` 这两个脚本。在 `generate_all_data_sub2.py` 的第 24 行，文件名已修正为 `'.\u002Fdata\u002F06_input\u002Fall_symbols.pkl'`，运行后即可生成该文件。",[]]