[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Forethought-Technologies--AutoChain":3,"tool-Forethought-Technologies--AutoChain":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},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,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",152630,2,"2026-04-12T23:33:54",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":88,"forks":89,"last_commit_at":90,"license":91,"difficulty_score":32,"env_os":92,"env_gpu":92,"env_ram":92,"env_deps":93,"category_tags":99,"github_topics":76,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":100,"updated_at":101,"faqs":102,"releases":128},7075,"Forethought-Technologies\u002FAutoChain","AutoChain","AutoChain: Build lightweight, extensible, and testable LLM Agents","AutoChain 是一个专为构建轻量级、可扩展且易于测试的大语言模型（LLM）智能体而设计的开源框架。它旨在解决当前开发自定义生成式智能体时面临的两大痛点：一是现有工具往往过于厚重，针对特定场景定制复杂且困难；二是缺乏高效的评估手段，开发者通常只能依靠昂贵且重复的人工测试来验证效果。\n\nAutoChain 汲取了 LangChain 和 AutoGPT 的理念，但刻意减少了抽象层级，最多仅保留两层结构，让熟悉 LangChain 的开发者能轻松上手。其核心亮点在于简化了提示词（Prompt）的迭代过程，支持可视化输出调试，并首创了基于模拟对话的自动化多轮评估机制。这意味着开发者可以快速在不同用户场景下自动测试智能体的表现，有效避免“修复一个场景却导致其他场景退化”的问题。此外，它还原生支持 OpenAI 函数调用及自定义工具扩展，并具备简洁的记忆追踪功能。\n\n这款工具非常适合希望快速原型开发、频繁迭代提示词或需要严谨评估流程的 AI 开发者与研究人員。如果你正在寻找一个比现有框架更轻便、更透明，且能显著降低智能体开发与测试成本的解决方案，AutoChain 将是一个理想的选择。","# AutoChain\n\nLarge language models (LLMs) have shown huge success in different text generation tasks and\nenable developers to build generative agents based on objectives expressed in natural language.\n\nHowever, most generative agents require heavy customization for specific purposes, and\nsupporting different use cases can sometimes be overwhelming using existing tools\nand frameworks. As a result, it is still very challenging to build a custom generative agent.\n\nIn addition, evaluating such generative agents, which is usually done by manually trying different\nscenarios, is a very manual, repetitive, and expensive task.\n\nAutoChain takes inspiration from LangChain and AutoGPT and aims to solve\nboth problems by providing a lightweight and extensible framework\nfor developers to build their own agents using LLMs with custom tools and\n[automatically evaluating](#workflow-evaluation) different user scenarios with simulated\nconversations. Experienced user of LangChain would find AutoChain is easy to navigate since\nthey share similar but simpler concepts.\n\nThe goal is to enable rapid iteration on generative agents, both by simplifying agent customization\nand evaluation.\n\nIf you have any questions, please feel free to reach out to Yi Lu \u003Cyi.lu@forethought.ai>\n\n## Features\n\n- 🚀 lightweight and extensible generative agent pipeline.\n- 🔗 agent that can use different custom tools and\n  support OpenAI [function calling](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fgpt\u002Ffunction-calling)\n- 💾 simple memory tracking for conversation history and tools' outputs\n- 🤖 automated agent multi-turn conversation evaluation with simulated conversations\n\n## Setup\n\nQuick install\n\n```shell\npip install autochain\n```\n\nOr install from source after cloning this repository\n\n```shell\ncd autochain\npyenv virtualenv 3.10.11 venv\npyenv local venv\n\npip install .\n```\n\nSet `PYTHONPATH` and `OPENAI_API_KEY`\n\n```shell\nexport OPENAI_API_KEY=\nexport PYTHONPATH=`pwd`\n```\n\nRun your first conversation with agent interactively\n\n```shell\npython autochain\u002Fworkflows_evaluation\u002Fconversational_agent_eval\u002Fgenerate_ads_test.py -i\n```\n\n## How does AutoChain simplify building agents?\n\nAutoChain aims to provide a lightweight framework and simplifies the agent building process in a\nfew\nways, as compared to existing frameworks\n\n1. Easy prompt update  \n   Engineering and iterating over prompts is a crucial part of building generative\n   agent. AutoChain makes it very easy to update prompts and visualize prompt\n   outputs. Run with `-v` flag to output verbose prompt and outputs in console.\n2. Up to 2 layers of abstraction  \n   As part of enabling rapid iteration, AutoChain chooses to remove most of the\n   abstraction layers from alternative frameworks\n3. Automated multi-turn evaluation  \n   Evaluation is the most painful and undefined part of building generative agents. Updating the\n   agent to better perform in one scenario often causes regression in other use cases. AutoChain\n   provides a testing framework to automatically evaluate agent's ability under different\n   user scenarios.\n\n## Example usage\n\nIf you have experience with LangChain, you already know 80% of the AutoChain interfaces.\n\nAutoChain aims to make building custom generative agents as straightforward as possible, with as\nlittle abstractions as possible.\n\nThe most basic example uses the default chain and `ConversationalAgent`:\n\n```python\nfrom autochain.chain.chain import Chain\nfrom autochain.memory.buffer_memory import BufferMemory\nfrom autochain.models.chat_openai import ChatOpenAI\nfrom autochain.agent.conversational_agent.conversational_agent import ConversationalAgent\n\nllm = ChatOpenAI(temperature=0)\nmemory = BufferMemory()\nagent = ConversationalAgent.from_llm_and_tools(llm=llm)\nchain = Chain(agent=agent, memory=memory)\n\nprint(chain.run(\"Write me a poem about AI\")['message'])\n```\n\nJust like in LangChain, you can add a list of tools to the agent\n\n```python\ntools = [\n    Tool(\n        name=\"Get weather\",\n        func=lambda *args, **kwargs: \"Today is a sunny day\",\n        description=\"\"\"This function returns the weather information\"\"\"\n    )\n]\n\nmemory = BufferMemory()\nagent = ConversationalAgent.from_llm_and_tools(llm=llm, tools=tools)\nchain = Chain(agent=agent, memory=memory)\nprint(chain.run(\"What is the weather today\")['message'])\n```\n\nAutoChain also added support\nfor [function calling](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fgpt\u002Ffunction-calling)\nin OpenAI models. Behind the scenes, it turns the function spec into OpenAI format without explicit\ninstruction, so you can keep following the same `Tool` interface you are familiar with.\n\n```python\nllm = ChatOpenAI(temperature=0)\nagent = OpenAIFunctionsAgent.from_llm_and_tools(llm=llm, tools=tools)\n```\n\nSee [more examples](.\u002Fdocs\u002Fexamples.md) under `autochain\u002Fexamples` and [workflow\nevaluation](.\u002Fdocs\u002Fworkflow-evaluation.md) test cases which can also be run interactively.\n\nRead more about detailed [components overview](.\u002Fdocs\u002Fcomponents_overview.md)\n\n## Workflow Evaluation\n\nIt is notoriously hard to evaluate generative agents in LangChain or AutoGPT. An agent's behavior\nis nondeterministic and susceptible to small changes to the prompt or model. As such, it is\nhard to know what effects an update to the agent will have on all relevant use cases.\n\nThe current path for\nevaluation is running the agent through a large number of preset queries and evaluate the\ngenerated responses. However, that is limited to single turn conversation, general and not\nspecific to tasks and expensive to verify.\n\nTo facilitate agent evaluation, AutoChain introduces the workflow evaluation framework. This\nframework runs conversations between a generative agent and LLM-simulated test users. The test\nusers incorporate various user contexts and desired conversation outcomes, which enables easy\naddition of test cases for new user scenarios and fast evaluation. The framework leverages LLMs to\nevaluate whether a given multi-turn conversation has achieved the intended outcome.\n\nRead more about our [evaluation strategy](.\u002Fdocs\u002Fworkflow-evaluation.md).\n\n### How to run workflow evaluations\n\nYou can either run your tests in interactive mode, or run the full suite of test cases at once.\n`autochain\u002Fworkflows_evaluation\u002Fconversational_agent_eval\u002Fgenerate_ads_test.py` contains a few\nexample test cases.\n\nTo run all the cases defined in a test file:\n\n```shell\npython autochain\u002Fworkflows_evaluation\u002Fconversational_agent_eval\u002Fgenerate_ads_test.py\n```\n\nTo run your tests interactively `-i`:\n\n```shell\npython autochain\u002Fworkflows_evaluation\u002Fconversational_agent_eval\u002Fgenerate_ads_test.py -i\n```\n\nLooking for more details on how AutoChain works? See\nour [components overview](.\u002Fdocs\u002Fcomponents_overview.md)\n","# AutoChain\n\n大型语言模型（LLMs）在各类文本生成任务中取得了巨大成功，使开发者能够基于自然语言表达的目标构建生成式智能体。\n\n然而，大多数生成式智能体需要针对特定用途进行大量定制，而使用现有工具和框架来支持不同的应用场景有时会显得力不从心。因此，构建自定义的生成式智能体仍然极具挑战性。\n\n此外，对这类生成式智能体的评估通常依赖于人工尝试不同场景，这一过程既繁琐又重复，成本高昂。\n\nAutoChain 受 LangChain 和 AutoGPT 的启发，旨在通过提供一个轻量级且可扩展的框架来解决上述两个问题：开发者可以利用 LLM 和自定义工具构建自己的智能体，并通过模拟对话[自动评估](#workflow-evaluation)不同的用户场景。熟悉 LangChain 的用户会发现 AutoChain 非常易于上手，因为两者共享相似但更为简单的概念。\n\n我们的目标是通过简化智能体的定制与评估流程，实现生成式智能体的快速迭代。\n\n如有任何疑问，请随时联系 Yi Lu \u003Cyi.lu@forethought.ai>。\n\n## 功能特性\n\n- 🚀 轻量级且可扩展的生成式智能体流水线。\n- 🔗 支持使用不同自定义工具的智能体，并兼容 OpenAI 的 [函数调用](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fgpt\u002Ffunction-calling) 功能。\n- 💾 简单的内存跟踪机制，用于记录对话历史和工具输出。\n- 🤖 自动化多轮对话评估，通过模拟对话进行测试。\n\n## 安装与设置\n\n### 快速安装\n\n```shell\npip install autochain\n```\n\n### 从源码安装\n\n克隆本仓库后，执行以下命令：\n\n```shell\ncd autochain\npyenv virtualenv 3.10.11 venv\npyenv local venv\n\npip install .\n```\n\n设置 `PYTHONPATH` 和 `OPENAI_API_KEY`：\n\n```shell\nexport OPENAI_API_KEY=\nexport PYTHONPATH=`pwd`\n```\n\n运行你的第一个交互式对话：\n\n```shell\npython autochain\u002Fworkflows_evaluation\u002Fconversational_agent_eval\u002Fgenerate_ads_test.py -i\n```\n\n## AutoChain 如何简化智能体构建？\n\n相比现有框架，AutoChain 致力于提供一个轻量级的框架，从以下几个方面简化智能体的构建流程：\n\n1. **便捷的提示词更新**  \n   提示词的设计与迭代是构建生成式智能体的关键环节。AutoChain 让更新提示词变得非常简单，并能直观地查看提示词及其输出结果。只需添加 `-v` 标志，即可在控制台中输出详细的提示词及结果信息。\n   \n2. **最多两层抽象**  \n   为了支持快速迭代，AutoChain 选择去除其他框架中的大部分抽象层。\n   \n3. **自动化多轮评估**  \n   评估是构建生成式智能体过程中最为棘手且缺乏明确标准的环节。往往为优化某一场景的表现而对智能体进行调整，却可能导致其他场景性能下降。AutoChain 提供了一个测试框架，能够自动评估智能体在不同用户场景下的表现。\n\n## 使用示例\n\n如果你有使用 LangChain 的经验，那么你已经掌握了 AutoChain 约 80% 的接口。\n\nAutoChain 致力于以尽可能少的抽象层次，让自定义生成式智能体的构建过程尽可能简单明了。最基础的示例使用默认链和 `ConversationalAgent`：\n\n```python\nfrom autochain.chain.chain import Chain\nfrom autochain.memory.buffer_memory import BufferMemory\nfrom autochain.models.chat_openai import ChatOpenAI\nfrom autochain.agent.conversational_agent.conversational_agent import ConversationalAgent\n\nllm = ChatOpenAI(temperature=0)\nmemory = BufferMemory()\nagent = ConversationalAgent.from_llm_and_tools(llm=llm)\nchain = Chain(agent=agent, memory=memory)\n\nprint(chain.run(\"给我写一首关于人工智能的诗\")['message'])\n```\n\n与 LangChain 类似，你也可以向智能体添加工具列表：\n\n```python\ntools = [\n    Tool(\n        name=\"获取天气\",\n        func=lambda *args, **kwargs: \"今天是个晴天\",\n        description=\"\"\"此函数返回天气信息\"\"\"\n    )\n]\n\nmemory = BufferMemory()\nagent = ConversationalAgent.from_llm_and_tools(llm=llm, tools=tools)\nchain = Chain(agent=agent, memory=memory)\nprint(chain.run(\"今天天气怎么样？\")['message'])\n```\n\nAutoChain 还新增了对 OpenAI 模型中 [函数调用](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fgpt\u002Ffunction-calling) 功能的支持。在后台，它会将函数规范转换为 OpenAI 格式，无需显式指令，因此你可以继续沿用熟悉的 `Tool` 接口。\n\n```python\nllm = ChatOpenAI(temperature=0)\nagent = OpenAIFunctionsAgent.from_llm_and_tools(llm=llm, tools=tools)\n```\n\n更多示例请参见 `autochain\u002Fexamples` 目录下的[示例文档](.\u002Fdocs\u002Fexamples.md)，以及可交互运行的[工作流评估](.\u002Fdocs\u002Fworkflow-evaluation.md)测试案例。\n\n欲了解更详细的信息，请阅读[组件概览](.\u002Fdocs\u002Fcomponents_overview.md)。\n\n## 工作流评估\n\n在 LangChain 或 AutoGPT 中，评估生成式智能体一直是一项极具挑战性的任务。智能体的行为具有非确定性，容易受到提示词或模型微小变化的影响。因此，很难准确判断对智能体的任何更新会对所有相关场景产生何种影响。\n\n目前常用的评估方法是让智能体处理大量预设查询，并对生成的响应进行人工评估。然而，这种方法仅限于单轮对话，且过于笼统，无法针对具体任务进行评估，同时验证成本较高。\n\n为便于智能体评估，AutoChain 引入了工作流评估框架。该框架通过生成式智能体与由 LLM 模拟的测试用户之间的对话来进行评估。这些测试用户包含了多种用户背景和期望的对话结果，从而能够轻松添加针对新用户场景的测试用例，并快速完成评估。该框架借助 LLM 来判断给定的多轮对话是否达到了预期效果。\n\n更多关于我们[评估策略](.\u002Fdocs\u002Fworkflow-evaluation.md)的信息，请参阅。\n\n### 如何运行工作流评估？\n\n你可以选择以交互模式运行测试，也可以一次性运行完整的测试套件。`autochain\u002Fworkflows_evaluation\u002Fconversational_agent_eval\u002Fgenerate_ads_test.py` 文件中包含了一些示例测试用例。\n\n要运行测试文件中定义的所有案例：\n\n```shell\npython autochain\u002Fworkflows_evaluation\u002Fconversational_agent_eval\u002Fgenerate_ads_test.py\n```\n\n若希望以交互模式运行测试，只需添加 `-i` 参数：\n\n```shell\npython autochain\u002Fworkflows_evaluation\u002Fconversational_agent_eval\u002Fgenerate_ads_test.py -i\n```\n\n想了解更多关于 AutoChain 的工作原理吗？请参阅我们的[组件概览](.\u002Fdocs\u002Fcomponents_overview.md)。","# AutoChain 快速上手指南\n\nAutoChain 是一个轻量级且可扩展的生成式 Agent 框架，灵感来源于 LangChain 和 AutoGPT。它旨在简化基于大语言模型（LLM）的自定义 Agent 构建流程，并提供自动化的多轮对话评估功能，帮助开发者快速迭代和验证 Agent 表现。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n- **操作系统**：Linux, macOS 或 Windows (WSL 推荐)\n- **Python 版本**：推荐 Python 3.10+ (官方示例使用 3.10.11)\n- **前置依赖**：\n  - `pip` 包管理工具\n  - `pyenv` (可选，用于管理 Python 虚拟环境)\n  - **OpenAI API Key**：必须拥有有效的 OpenAI API 密钥才能运行模型\n\n## 安装步骤\n\n您可以选择通过 PyPI 直接安装，或从源码安装以获取最新功能。\n\n### 方式一：快速安装（推荐）\n\n```shell\npip install autochain\n```\n\n### 方式二：从源码安装\n\n如果您需要修改源码或体验最新特性，可以克隆仓库并安装：\n\n```shell\ngit clone \u003Crepository_url>\ncd autochain\npyenv virtualenv 3.10.11 venv\npyenv local venv\n\npip install .\n```\n\n### 配置环境变量\n\n安装完成后，需设置 OpenAI API 密钥和 Python 路径：\n\n```shell\nexport OPENAI_API_KEY=your_sk_key_here\nexport PYTHONPATH=`pwd`\n```\n\n> **注意**：请将 `your_sk_key_here` 替换为您实际的 OpenAI API Key。\n\n## 基本使用\n\nAutoChain 的接口设计与 LangChain 高度相似但更加精简。以下是两个最基础的使用场景。\n\n### 1. 运行最简单的对话 Agent\n\n创建一个基础的对话链，让 Agent 根据指令生成内容：\n\n```python\nfrom autochain.chain.chain import Chain\nfrom autochain.memory.buffer_memory import BufferMemory\nfrom autochain.models.chat_openai import ChatOpenAI\nfrom autochain.agent.conversational_agent.conversational_agent import ConversationalAgent\n\nllm = ChatOpenAI(temperature=0)\nmemory = BufferMemory()\nagent = ConversationalAgent.from_llm_and_tools(llm=llm)\nchain = Chain(agent=agent, memory=memory)\n\nprint(chain.run(\"Write me a poem about AI\")['message'])\n```\n\n### 2. 添加自定义工具 (Tools)\n\n您可以轻松地为 Agent 绑定自定义工具，使其能够执行特定任务（如查询天气）：\n\n```python\nfrom autochain.tools.base import Tool\n\ntools = [\n    Tool(\n        name=\"Get weather\",\n        func=lambda *args, **kwargs: \"Today is a sunny day\",\n        description=\"\"\"This function returns the weather information\"\"\"\n    )\n]\n\nmemory = BufferMemory()\n# 将 tools 列表传入 agent\nagent = ConversationalAgent.from_llm_and_tools(llm=llm, tools=tools)\nchain = Chain(agent=agent, memory=memory)\n\nprint(chain.run(\"What is the weather today\")['message'])\n```\n\n### 3. 支持 OpenAI Function Calling\n\nAutoChain 原生支持 OpenAI 的 Function Calling 功能。您无需更改工具定义格式，框架会自动将其转换为 OpenAI 所需的格式：\n\n```python\nfrom autochain.agent.openai_functions_agent.openai_functions_agent import OpenAIFunctionsAgent\n\nllm = ChatOpenAI(temperature=0)\nagent = OpenAIFunctionsAgent.from_llm_and_tools(llm=llm, tools=tools)\n```\n\n### 4. 交互式运行测试\n\n安装完成后，您可以立即运行官方提供的示例脚本，体验交互式对话或工作流评估：\n\n```shell\npython autochain\u002Fworkflows_evaluation\u002Fconversational_agent_eval\u002Fgenerate_ads_test.py -i\n```\n\n添加 `-i` 参数可进入交互模式，方便调试和观察 Prompt 输出（也可使用 `-v` 参数查看详细日志）。","某电商初创团队正致力于开发一个能自动处理售后咨询并调用内部订单系统的智能客服 Agent。\n\n### 没有 AutoChain 时\n- **框架过于臃肿**：引入大型框架导致项目依赖复杂，仅为了简单的意图识别和工具调用就需要配置多层抽象，开发启动慢。\n- **提示词迭代困难**：调整 Agent 的行为逻辑需要反复修改 Prompt，但缺乏直观的可视化输出，开发者难以快速定位是提示词问题还是模型问题。\n- **测试成本高昂**：每次更新功能后，必须人工模拟各种用户对话场景进行回归测试，耗时费力且容易遗漏边缘情况，导致上线信心不足。\n\n### 使用 AutoChain 后\n- **轻量级快速构建**：AutoChain 提供极简的管道设计，去除了冗余的抽象层，开发人员仅需几行代码即可集成自定义订单查询工具并跑通流程。\n- **可视化调试高效**：通过开启详细日志模式，AutoChain 能直接在控制台展示完整的 Prompt 输入与模型输出，让提示词优化过程变得透明且可控。\n- **自动化场景评估**：利用内置的模拟对话评估框架，团队可自动运行多轮测试用例，瞬间验证新策略在不同售后场景下的表现，有效防止功能回退。\n\nAutoChain 通过轻量化架构与自动化评估机制，将生成式 Agent 的开发迭代周期从数天缩短至数小时。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FForethought-Technologies_AutoChain_78003dd1.png","Forethought-Technologies","Forethought AI","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FForethought-Technologies_6c72a464.png","",null,"https:\u002F\u002Fengineering.forethought.ai\u002F","https:\u002F\u002Fgithub.com\u002FForethought-Technologies",[80,84],{"name":81,"color":82,"percentage":83},"Python","#3572A5",99.9,{"name":85,"color":86,"percentage":87},"Makefile","#427819",0.1,1876,105,"2026-04-12T09:36:22","MIT","未说明",{"notes":94,"python":95,"dependencies":96},"该工具是一个轻量级框架，主要依赖 OpenAI API 进行大模型调用，README 中未提及本地 GPU、显存或特定深度学习库（如 PyTorch\u002FTensorFlow）的需求。安装示例中使用了 pyenv 来管理 Python 3.10.11 虚拟环境。运行前需设置 OPENAI_API_KEY 环境变量。","3.10.11",[97,98],"autochain","OpenAI API (function calling support)",[35,14,13],"2026-03-27T02:49:30.150509","2026-04-13T17:41:37.550485",[103,108,113,118,123],{"id":104,"question_zh":105,"answer_zh":106,"source_url":107},31833,"如何在 AutoChain 中配置 Azure OpenAI 部署？","AutoChain 已支持 Azure 部署。在使用 `ChatOpenAI` 或其他模型类时，需要传递 `deployment_id` 和 `model` 参数。例如：\n```python\nChatOpenAI(\n  model_name=\"xxx\",\n  deployment_id=\"xxx\",\n  model=\"xxx\",\n)\n```\n维护者已通过 PR #98 完成了该功能的集成支持。","https:\u002F\u002Fgithub.com\u002FForethought-Technologies\u002FAutoChain\u002Fissues\u002F95",{"id":109,"question_zh":110,"answer_zh":111,"source_url":112},31834,"使用 HuggingFace 模型时为什么报错提示需要 OPENAI_API_KEY？","这是因为默认的 `AgentOutputParser` 会尝试调用 OpenAI 来修正模型返回的 JSON 格式（代码位置：`autochain\u002Fagent\u002Fstructs.py#L68-L78`）。\n解决方案：\n1. 临时方案：修改输出解析器（Output Parser），移除其中调用 OpenAI 进行修正的代码。\n2. 长期方案：等待维护者创建不包含此修正逻辑的新输出解析器。\n注意：直接使用如 `distilgpt2` 等小型开源模型生成的回复质量可能不佳，往往无法生成符合要求的 JSON 结构。","https:\u002F\u002Fgithub.com\u002FForethought-Technologies\u002FAutoChain\u002Fissues\u002F125",{"id":114,"question_zh":115,"answer_zh":116,"source_url":117},31835,"AutoChain 适合用于生产环境吗？","AutoChain 的设计初衷是便于实验和提供灵活性，官方仓库目前不计划提供复杂的生产级工程支持。\n但是，该项目采用宽松的 MIT 许可证，欢迎用户根据自己的用例添加所需的生产环境适配代码（wirings）自行使用。","https:\u002F\u002Fgithub.com\u002FForethought-Technologies\u002FAutoChain\u002Fissues\u002F119",{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},31836,"PyPI 上的版本与 GitHub 源码不一致怎么办？","维护者已意识到版本不同步的问题（例如 PyPI 缺少 `openai_functions_agent`）。目前已发布新版本（如 0.0.5）以同步最新代码。建议通过 `pip install --upgrade autochain` 更新到最新版本，或关注 GitHub Releases 获取后续版本标签。","https:\u002F\u002Fgithub.com\u002FForethought-Technologies\u002FAutoChain\u002Fissues\u002F111",{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},31837,"使用 ConversationalAgent 时，代理在请求用户澄清后直接退出，如何让用户输入继续对话？","这通常发生在工作流评估期间。代理内部有一个检查机制（`should_answer`），用于验证问题是否已解决。如果检测到需要澄清或用户确认解决，代理会停止规划下一步。\n解决方法：禁用 `should_answer` 检查。禁用后，代理默认不会自动停止，你可以通过设置最大对话轮数（k）来控制评估过程，从而允许用户在运行时插入回答并让代理继续执行。","https:\u002F\u002Fgithub.com\u002FForethought-Technologies\u002FAutoChain\u002Fissues\u002F110",[]]