[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-JoshuaC215--agent-service-toolkit":3,"tool-JoshuaC215--agent-service-toolkit":64},[4,17,27,35,48,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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[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},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,43,44,45,15,46,26,13,47],"数据工具","视频","插件","其他","音频",{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":10,"last_commit_at":54,"category_tags":55,"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,46],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},2181,"OpenHands","OpenHands\u002FOpenHands","OpenHands 是一个专注于 AI 驱动开发的开源平台，旨在让智能体（Agent）像人类开发者一样理解、编写和调试代码。它解决了传统编程中重复性劳动多、环境配置复杂以及人机协作效率低等痛点，通过自动化流程显著提升开发速度。\n\n无论是希望提升编码效率的软件工程师、探索智能体技术的研究人员，还是需要快速原型验证的技术团队，都能从中受益。OpenHands 提供了灵活多样的使用方式：既可以通过命令行（CLI）或本地图形界面在个人电脑上轻松上手，体验类似 Devin 的流畅交互；也能利用其强大的 Python SDK 自定义智能体逻辑，甚至在云端大规模部署上千个智能体并行工作。\n\n其核心技术亮点在于模块化的软件智能体 SDK，这不仅构成了平台的引擎，还支持高度可组合的开发模式。此外，OpenHands 在 SWE-bench 基准测试中取得了 77.6% 的优异成绩，证明了其解决真实世界软件工程问题的能力。平台还具备完善的企业级功能，支持与 Slack、Jira 等工具集成，并提供细粒度的权限管理，适合从个人开发者到大型企业的各类用户场景。",70626,"2026-04-05T22:51:36",[26,15,13,45],{"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":78,"owner_location":79,"owner_email":80,"owner_twitter":78,"owner_website":81,"owner_url":82,"languages":83,"stars":88,"forks":89,"last_commit_at":90,"license":91,"difficulty_score":23,"env_os":92,"env_gpu":92,"env_ram":92,"env_deps":93,"category_tags":104,"github_topics":105,"view_count":10,"oss_zip_url":78,"oss_zip_packed_at":78,"status":16,"created_at":109,"updated_at":110,"faqs":111,"releases":141},845,"JoshuaC215\u002Fagent-service-toolkit","agent-service-toolkit","Full toolkit for running an AI agent service built with LangGraph, FastAPI and Streamlit","agent-service-toolkit 是一个基于 LangGraph、FastAPI 和 Streamlit 构建的完整 AI 智能体服务套件。它为开发者提供了一套从后端服务到前端交互界面的开箱即用模板，涵盖智能体定义、API 服务及用户聊天界面等核心组件。针对搭建 LangGraph 项目时环境配置繁琐、前后端对接困难等痛点，它通过标准化流程简化了从智能体定义到用户交互的全链路搭建工作。\n\n这套方案特别适合希望快速验证 AI 智能体想法的开发者，以及对 LangGraph 框架感兴趣的技术研究人员。技术上，它支持最新的 LangGraph v1.0 特性，包括人工介入流程、状态控制与长期记忆存储。此外，还实现了先进的 Token 级流式输出，支持语音交互，并集成了内容审核与 LangSmith 反馈机制。配合 Docker 支持，用户能够轻松部署自己的智能体服务，无需重复造轮子，即可体验完整的 AI 应用架构。","# 🧰 AI Agent Service Toolkit\n\n[![build status](https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Factions\u002Fworkflows\u002Ftest.yml) [![codecov](https:\u002F\u002Fcodecov.io\u002Fgithub\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fgraph\u002Fbadge.svg?token=5MTJSYWD05)](https:\u002F\u002Fcodecov.io\u002Fgithub\u002FJoshuaC215\u002Fagent-service-toolkit) [![Python Version](https:\u002F\u002Fimg.shields.io\u002Fpython\u002Frequired-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FJoshuaC215%2Fagent-service-toolkit%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)](https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fblob\u002Fmain\u002Fpyproject.toml)\n[![GitHub License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FJoshuaC215\u002Fagent-service-toolkit)](https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fblob\u002Fmain\u002FLICENSE) [![Streamlit App](https:\u002F\u002Fstatic.streamlit.io\u002Fbadges\u002Fstreamlit_badge_black_red.svg)](https:\u002F\u002Fagent-service-toolkit.streamlit.app\u002F)\n\nA full toolkit for running an AI agent service built with LangGraph, FastAPI and Streamlit.\n\nIt includes a [LangGraph](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002F) agent, a [FastAPI](https:\u002F\u002Ffastapi.tiangolo.com\u002F) service to serve it, a client to interact with the service, and a [Streamlit](https:\u002F\u002Fstreamlit.io\u002F) app that uses the client to provide a chat interface. Data structures and settings are built with [Pydantic](https:\u002F\u002Fgithub.com\u002Fpydantic\u002Fpydantic).\n\nThis project offers a template for you to easily build and run your own agents using the LangGraph framework. It demonstrates a complete setup from agent definition to user interface, making it easier to get started with LangGraph-based projects by providing a full, robust toolkit.\n\n**[🎥 Watch a video walkthrough of the repo and app](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=pdYVHw_YCNY)**\n\n## Overview\n\n### [Try the app!](https:\u002F\u002Fagent-service-toolkit.streamlit.app\u002F)\n\n\u003Ca href=\"https:\u002F\u002Fagent-service-toolkit.streamlit.app\u002F\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FJoshuaC215_agent-service-toolkit_readme_b74f02919670.png\" width=\"600\">\u003C\u002Fa>\n\n### Quickstart\n\nRun directly in python\n\n```sh\n# At least one LLM API key is required\necho 'OPENAI_API_KEY=your_openai_api_key' >> .env\n\n# uv is the recommended way to install agent-service-toolkit, but \"pip install .\" also works\n# For uv installation options, see: https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002Finstallation\u002F\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002F0.7.19\u002Finstall.sh | sh\n\n# Install dependencies. \"uv sync\" creates .venv automatically\nuv sync --frozen\nsource .venv\u002Fbin\u002Factivate\npython src\u002Frun_service.py\n\n# In another shell\nsource .venv\u002Fbin\u002Factivate\nstreamlit run src\u002Fstreamlit_app.py\n```\n\nRun with docker\n\n```sh\necho 'OPENAI_API_KEY=your_openai_api_key' >> .env\ndocker compose watch\n```\n\n### Architecture Diagram\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FJoshuaC215_agent-service-toolkit_readme_eacf85de4752.png\" width=\"600\">\n\n### Key Features\n\n1. **LangGraph Agent and latest features**: A customizable agent built using the LangGraph framework. Implements the latest LangGraph v1.0 features including human in the loop with `interrupt()`, flow control with `Command`, long-term memory with `Store`, and `langgraph-supervisor`.\n1. **FastAPI Service**: Serves the agent with both streaming and non-streaming endpoints.\n1. **Advanced Streaming**: A novel approach to support both token-based and message-based streaming.\n1. **Streamlit Interface**: Provides a user-friendly chat interface for interacting with the agent, including voice input and output.\n1. **Multiple Agent Support**: Run multiple agents in the service and call by URL path. Available agents and models are described in `\u002Finfo`\n1. **Asynchronous Design**: Utilizes async\u002Fawait for efficient handling of concurrent requests.\n1. **Content Moderation**: Implements Safeguard for content moderation (requires Groq API key).\n1. **RAG Agent**: A basic RAG agent implementation using ChromaDB - see [docs](docs\u002FRAG_Assistant.md).\n1. **Feedback Mechanism**: Includes a star-based feedback system integrated with LangSmith.\n1. **Docker Support**: Includes Dockerfiles and a docker compose file for easy development and deployment.\n1. **Testing**: Includes robust unit and integration tests for the full repo.\n\n### Key Files\n\nThe repository is structured as follows:\n\n- `src\u002Fagents\u002F`: Defines several agents with different capabilities\n- `src\u002Fschema\u002F`: Defines the protocol schema\n- `src\u002Fcore\u002F`: Core modules including LLM definition and settings\n- `src\u002Fservice\u002Fservice.py`: FastAPI service to serve the agents\n- `src\u002Fclient\u002Fclient.py`: Client to interact with the agent service\n- `src\u002Fstreamlit_app.py`: Streamlit app providing a chat interface\n- `tests\u002F`: Unit and integration tests\n\n## Setup and Usage\n\n1. Clone the repository:\n\n   ```sh\n   git clone https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit.git\n   cd agent-service-toolkit\n   ```\n\n2. Set up environment variables:\n   Create a `.env` file in the root directory. At least one LLM API key or configuration is required. See the [`.env.example` file](.\u002F.env.example) for a full list of available environment variables, including a variety of model provider API keys, header-based authentication, LangSmith tracing, testing and development modes, and OpenWeatherMap API key.\n\n3. You can now run the agent service and the Streamlit app locally, either with Docker or just using Python. The Docker setup is recommended for simpler environment setup and immediate reloading of the services when you make changes to your code.\n\n### Additional setup for specific AI providers\n\n- [Setting up Ollama](docs\u002FOllama.md)\n- [Setting up VertexAI](docs\u002FVertexAI.md)\n- [Setting up RAG with ChromaDB](docs\u002FRAG_Assistant.md)\n\n### Building or customizing your own agent\n\nTo customize the agent for your own use case:\n\n1. Add your new agent to the `src\u002Fagents` directory. You can copy `research_assistant.py` or `chatbot.py` and modify it to change the agent's behavior and tools.\n1. Import and add your new agent to the `agents` dictionary in `src\u002Fagents\u002Fagents.py`. Your agent can be called by `\u002F\u003Cyour_agent_name>\u002Finvoke` or `\u002F\u003Cyour_agent_name>\u002Fstream`.\n1. Adjust the Streamlit interface in `src\u002Fstreamlit_app.py` to match your agent's capabilities.\n\n\n### Handling Private Credential files\n\nIf your agents or chosen LLM require file-based credential files or certificates, the `privatecredentials\u002F` has been provided for your development convenience. All contents, excluding the `.gitkeep` files, are ignored by git and docker's build process. See [Working with File-based Credentials](docs\u002FFile_Based_Credentials.md) for suggested use.\n\n\n### Docker Setup\n\nThis project includes a Docker setup for easy development and deployment. The `compose.yaml` file defines three services: `postgres`, `agent_service` and `streamlit_app`. The `Dockerfile` for each service is in their respective directories.\n\nFor local development, we recommend using [docker compose watch](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002Ffile-watch\u002F). This feature allows for a smoother development experience by automatically updating your containers when changes are detected in your source code.\n\n1. Make sure you have Docker and Docker Compose (>= [v2.23.0](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002Frelease-notes\u002F#2230)) installed on your system.\n\n2. Create a `.env` file from the `.env.example`. At minimum, you need to provide an LLM API key (e.g., OPENAI_API_KEY).\n   ```sh\n   cp .env.example .env\n   # Edit .env to add your API keys\n   ```\n\n3. Build and launch the services in watch mode:\n\n   ```sh\n   docker compose watch\n   ```\n\n   This will automatically:\n   - Start a PostgreSQL database service that the agent service connects to\n   - Start the agent service with FastAPI\n   - Start the Streamlit app for the user interface\n\n4. The services will now automatically update when you make changes to your code:\n   - Changes in the relevant python files and directories will trigger updates for the relevant services.\n   - NOTE: If you make changes to the `pyproject.toml` or `uv.lock` files, you will need to rebuild the services by running `docker compose up --build`.\n\n5. Access the Streamlit app by navigating to `http:\u002F\u002Flocalhost:8501` in your web browser.\n\n6. The agent service API will be available at `http:\u002F\u002F0.0.0.0:8080`. You can also use the OpenAPI docs at `http:\u002F\u002F0.0.0.0:8080\u002Fredoc`.\n\n7. Use `docker compose down` to stop the services.\n\nThis setup allows you to develop and test your changes in real-time without manually restarting the services.\n\n### Building other apps on the AgentClient\n\nThe repo includes a generic `src\u002Fclient\u002Fclient.AgentClient` that can be used to interact with the agent service. This client is designed to be flexible and can be used to build other apps on top of the agent. It supports both synchronous and asynchronous invocations, and streaming and non-streaming requests.\n\nSee the `src\u002Frun_client.py` file for full examples of how to use the `AgentClient`. A quick example:\n\n```python\nfrom client import AgentClient\nclient = AgentClient()\n\nresponse = client.invoke(\"Tell me a brief joke?\")\nresponse.pretty_print()\n# ================================== Ai Message ==================================\n#\n# A man walked into a library and asked the librarian, \"Do you have any books on Pavlov's dogs and Schrödinger's cat?\"\n# The librarian replied, \"It rings a bell, but I'm not sure if it's here or not.\"\n\n```\n\n### Development with LangGraph Studio\n\nThe agent supports [LangGraph Studio](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002Fconcepts\u002Flanggraph_studio\u002F), the IDE for developing agents in LangGraph.\n\n`langgraph-cli[inmem]` is installed with `uv sync`. You can simply add your `.env` file to the root directory as described above, and then launch LangGraph Studio with `langgraph dev`. Customize `langgraph.json` as needed. See the [local quickstart](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002Fcloud\u002Fhow-tos\u002Fstudio\u002Fquick_start\u002F#local-development-server) to learn more.\n\n### Local development without Docker\n\nYou can also run the agent service and the Streamlit app locally without Docker, just using a Python virtual environment.\n\n1. Create a virtual environment and install dependencies:\n\n   ```sh\n   uv sync --frozen\n   source .venv\u002Fbin\u002Factivate\n   ```\n\n2. Run the FastAPI server:\n\n   ```sh\n   python src\u002Frun_service.py\n   ```\n\n3. In a separate terminal, run the Streamlit app:\n\n   ```sh\n   streamlit run src\u002Fstreamlit_app.py\n   ```\n\n4. Open your browser and navigate to the URL provided by Streamlit (usually `http:\u002F\u002Flocalhost:8501`).\n\n## Projects built with or inspired by agent-service-toolkit\n\nThe following are a few of the public projects that drew code or inspiration from this repo.\n\n- **[PolyRAG](https:\u002F\u002Fgithub.com\u002FQuentinFuxa\u002FPolyRAG)** - Extends agent-service-toolkit with RAG capabilities over both PostgreSQL databases and PDF documents.\n- **[alexrisch\u002Fagent-web-kit](https:\u002F\u002Fgithub.com\u002Falexrisch\u002Fagent-web-kit)** - A Next.JS frontend for agent-service-toolkit\n- **[raushan-in\u002Fdapa](https:\u002F\u002Fgithub.com\u002Fraushan-in\u002Fdapa)** - Digital Arrest Protection App (DAPA) enables users to report financial scams and frauds efficiently via a user-friendly platform.\n\n**Please create a pull request editing the README or open a discussion with any new ones to be added!** Would love to include more projects.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. Currently the tests need to be run using the local development without Docker setup. To run the tests for the agent service:\n\n1. Ensure you're in the project root directory and have activated your virtual environment.\n\n2. Install the development dependencies and pre-commit hooks:\n\n   ```sh\n   uv sync --frozen\n   pre-commit install\n   ```\n\n3. Run the tests using pytest:\n\n   ```sh\n   pytest\n   ```\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","# 🧰 AI Agent 服务工具包\n\n[![build status](https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Factions\u002Fworkflows\u002Ftest.yml) [![codecov](https:\u002F\u002Fcodecov.io\u002Fgithub\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fgraph\u002Fbadge.svg?token=5MTJSYWD05)](https:\u002F\u002Fcodecov.io\u002Fgithub\u002FJoshuaC215\u002Fagent-service-toolkit) [![Python Version](https:\u002F\u002Fimg.shields.io\u002Fpython\u002Frequired-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FJoshuaC215%2Fagent-service-toolkit%2Frefs%2Fheads%2Fmain%2Fpyproject.toml)](https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fblob\u002Fmain\u002Fpyproject.toml)\n[![GitHub License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FJoshuaC215\u002Fagent-service-toolkit)](https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fblob\u002Fmain\u002FLICENSE) [![Streamlit App](https:\u002F\u002Fstatic.streamlit.io\u002Fbadges\u002Fstreamlit_badge_black_red.svg)](https:\u002F\u002Fagent-service-toolkit.streamlit.app\u002F)\n\n一个用于运行 AI 代理服务的完整工具包，基于 LangGraph、FastAPI 和 Streamlit 构建。\n\n它包含一个 [LangGraph](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002F) 代理，一个用于托管它的 [FastAPI](https:\u002F\u002Ffastapi.tiangolo.com\u002F) 服务，一个用于与服务交互的客户端，以及一个使用客户端提供聊天界面的 [Streamlit](https:\u002F\u002Fstreamlit.io\u002F) 应用。数据结构和设置基于 [Pydantic](https:\u002F\u002Fgithub.com\u002Fpydantic\u002Fpydantic) 构建。\n\n本项目为您提供了一个模板，让您能够轻松构建和运行自己的代理，使用 LangGraph 框架。它展示了从代理定义到用户界面的完整设置，通过提供一个全面、强大的工具包，使开始基于 LangGraph 的项目变得更加容易。\n\n**[🎥 观看仓库和应用的视频指南](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=pdYVHw_YCNY)**\n\n## 概述\n\n### [尝试应用！](https:\u002F\u002Fagent-service-toolkit.streamlit.app\u002F)\n\n\u003Ca href=\"https:\u002F\u002Fagent-service-toolkit.streamlit.app\u002F\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FJoshuaC215_agent-service-toolkit_readme_b74f02919670.png\" width=\"600\">\u003C\u002Fa>\n\n### 快速开始\n\n直接在 Python 中运行\n\n```sh\n# 至少需要一个大语言模型 (LLM) API 密钥\necho 'OPENAI_API_KEY=your_openai_api_key' >> .env\n\n# uv 是安装 agent-service-toolkit 的推荐方式，但 \"pip install .\" 也可以工作\n# 关于 uv 安装选项，请参见：https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002Finstallation\u002F\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002F0.7.19\u002Finstall.sh | sh\n\n# 安装依赖。\"uv sync\" 会自动创建 .venv\nuv sync --frozen\nsource .venv\u002Fbin\u002Factivate\npython src\u002Frun_service.py\n\n# 在另一个终端窗口中\nsource .venv\u002Fbin\u002Factivate\nstreamlit run src\u002Fstreamlit_app.py\n```\n\n使用 Docker 运行\n\n```sh\necho 'OPENAI_API_KEY=your_openai_api_key' >> .env\ndocker compose watch\n```\n\n### 架构图\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FJoshuaC215_agent-service-toolkit_readme_eacf85de4752.png\" width=\"600\">\n\n### 主要功能\n\n1. **LangGraph 代理及最新特性**：使用 LangGraph 框架构建的自定义代理。实现了最新的 LangGraph v1.0 特性，包括带有 `interrupt()` 的人机协作循环、带有 `Command` 的流程控制、带有 `Store` 的长期记忆，以及 `langgraph-supervisor`。\n2. **FastAPI 服务**：提供流式和非流式端点来托管代理。\n3. **高级流式传输**：一种新颖的方法以支持基于 token 和基于消息的流式传输。\n4. **Streamlit 界面**：提供用户友好的聊天界面以与代理交互，包括语音输入和输出。\n5. **多代理支持**：在服务中运行多个代理并通过 URL 路径调用。可用代理和模型描述在 `\u002Finfo` 中。\n6. **异步设计**：利用 async\u002Fawait 高效处理并发请求。\n7. **内容审核**：实现 Safeguard 进行内容审核（需要 Groq API 密钥）。\n8. **检索增强生成 (RAG) 代理**：使用 ChromaDB 的基本 RAG 代理实现 - 见 [文档](docs\u002FRAG_Assistant.md)。\n9. **反馈机制**：包含集成 LangSmith 的基于星级的反馈系统。\n10. **Docker 支持**：包含 Dockerfile 和 docker compose 文件，便于开发和部署。\n11. **测试**：包含针对整个仓库的稳健单元测试和集成测试。\n\n### 关键文件\n\n仓库结构如下：\n\n- `src\u002Fagents\u002F`: 定义具有不同能力的多个代理\n- `src\u002Fschema\u002F`: 定义协议模式\n- `src\u002Fcore\u002F`: 核心模块，包括大语言模型 (LLM) 定义和设置\n- `src\u002Fservice\u002Fservice.py`: 用于托管代理的 FastAPI 服务\n- `src\u002Fclient\u002Fclient.py`: 用于与代理服务交互的客户端\n- `src\u002Fstreamlit_app.py`: 提供聊天界面的 Streamlit 应用\n- `tests\u002F`: 单元测试和集成测试\n\n## 设置与使用\n\n1. 克隆仓库：\n\n   ```sh\n   git clone https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit.git\n   cd agent-service-toolkit\n   ```\n\n2. 设置环境变量：\n   在根目录创建 `.env` 文件。至少需要一个大语言模型 (LLM) API 密钥或配置。查看 [`.env.example 文件`](.\u002F.env.example) 以获取可用环境变量的完整列表，包括各种模型提供商 API 密钥、基于头的认证、LangSmith 追踪、测试和开发模式以及 OpenWeatherMap API 密钥。\n\n3. 现在您可以在本地运行代理服务和 Streamlit 应用，使用 Docker 或仅使用 Python。推荐 Docker 设置，因为它可以简化环境设置，并在您修改代码时立即重新加载服务。\n\n### 特定 AI 提供商的额外设置\n\n- [设置 Ollama](docs\u002FOllama.md)\n- [设置 VertexAI](docs\u002FVertexAI.md)\n- [使用 ChromaDB 设置 RAG](docs\u002FRAG_Assistant.md)\n\n### 构建或自定义您的代理\n\n为了根据您的用例自定义代理：\n\n1. 将新代理添加到 `src\u002Fagents` 目录。您可以复制 `research_assistant.py` 或 `chatbot.py` 并修改它以更改代理的行为和工具。\n2. 导入并将新代理添加到 `src\u002Fagents\u002Fagents.py` 中的 `agents` 字典。您的代理可以通过 `\u002F\u003Cyour_agent_name>\u002Finvoke` 或 `\u002F\u003Cyour_agent_name>\u002Fstream` 调用。\n3. 调整 `src\u002Fstreamlit_app.py` 中的 Streamlit 界面以匹配您的代理能力。\n\n### 处理私有凭证文件\n\n如果您的代理或所选大语言模型 (LLM) 需要基于文件的凭证文件或证书，已提供 `privatecredentials\u002F` 以供您的开发便利。除 `.gitkeep` 文件外，所有内容都被 git 和 docker 的构建过程忽略。请参阅 [使用基于文件的凭证](docs\u002FFile_Based_Credentials.md) 了解建议用法。\n\n### Docker 配置\n\n本项目包含一个 Docker 配置，用于方便的开发和部署。`compose.yaml` 文件定义了三个服务：`postgres`、`agent_service` 和 `streamlit_app`。每个服务的 `Dockerfile` 位于其各自的目录中。\n\n对于本地开发，我们推荐使用 [docker compose watch](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002Ffile-watch\u002F)（一种文件监听功能）。此功能通过在检测到源代码更改时自动更新容器，提供更流畅的开发体验。\n\n1. 确保您的系统已安装 Docker 和 Docker Compose (>= [v2.23.0](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002Frelease-notes\u002F#2230))。\n\n2. 从 `.env.example` 创建 `.env` 文件。至少需要提供 LLM（大型语言模型）API 密钥（例如 OPENAI_API_KEY）。\n   ```sh\n   cp .env.example .env\n   # Edit .env to add your API keys\n   ```\n\n3. 以监听模式构建并启动服务：\n\n   ```sh\n   docker compose watch\n   ```\n\n   这将自动执行以下操作：\n   - 启动 PostgreSQL 数据库服务，代理服务将连接到此服务\n   - 使用 FastAPI 启动代理服务\n   - 启动用于用户界面的 Streamlit 应用\n\n4. 现在，当您修改代码时，服务将自动更新：\n   - 相关 python 文件和目录中的更改将触发相关服务的更新。\n   - 注意：如果您修改了 `pyproject.toml` 或 `uv.lock` 文件，则需要通过运行 `docker compose up --build` 重新构建服务。\n\n5. 在 Web 浏览器中导航至 `http:\u002F\u002Flocalhost:8501` 即可访问 Streamlit 应用。\n\n6. 代理服务 API 将在 `http:\u002F\u002F0.0.0.0:8080` 可用。您还可以在 `http:\u002F\u002F0.0.0.0:8080\u002Fredoc` 使用 OpenAPI 文档。\n\n7. 使用 `docker compose down` 停止服务。\n\n此设置允许您实时开发和测试更改，而无需手动重启服务。\n\n### 基于 AgentClient 构建其他应用\n\n仓库包含一个通用的 `src\u002Fclient\u002Fclient.AgentClient`（代理客户端），可用于与代理服务交互。此客户端设计灵活，可用于在代理之上构建其他应用。它支持同步和异步调用，以及流式和非流式请求。\n\n请参阅 `src\u002Frun_client.py` 文件以获取如何使用 `AgentClient` 的完整示例。快速示例如下：\n\n```python\nfrom client import AgentClient\nclient = AgentClient()\n\nresponse = client.invoke(\"Tell me a brief joke?\")\nresponse.pretty_print()\n# ================================== Ai Message ==================================\n#\n# A man walked into a library and asked the librarian, \"Do you have any books on Pavlov's dogs and Schrödinger's cat?\"\n# The librarian replied, \"It rings a bell, but I'm not sure if it's here or not.\"\n\n```\n\n### 使用 LangGraph Studio 进行开发\n\n该代理支持 [LangGraph Studio](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002Fconcepts\u002Flanggraph_studio\u002F)，这是为 LangGraph 开发代理的集成开发环境（IDE）。\n\n`langgraph-cli[inmem]` 随 `uv sync` 一起安装。您可以按照上述描述将 `.env` 文件添加到根目录，然后使用 `langgraph dev` 启动 LangGraph Studio。根据需要自定义 `langgraph.json`。请参阅 [本地快速入门](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002Fcloud\u002Fhow-tos\u002Fstudio\u002Fquick_start\u002F#local-development-server) 了解更多。\n\n### 不使用 Docker 的本地开发\n\n您也可以在不使用 Docker 的情况下，仅使用 Python 虚拟环境在本地运行代理服务和 Streamlit 应用。\n\n1. 创建虚拟环境并安装依赖项：\n\n   ```sh\n   uv sync --frozen\n   source .venv\u002Fbin\u002Factivate\n   ```\n\n2. 运行 FastAPI 服务器：\n\n   ```sh\n   python src\u002Frun_service.py\n   ```\n\n3. 在单独的终端中运行 Streamlit 应用：\n\n   ```sh\n   streamlit run src\u002Fstreamlit_app.py\n   ```\n\n4. 打开浏览器并导航到 Streamlit 提供的 URL（通常是 `http:\u002F\u002Flocalhost:8501`）。\n\n## 使用或受 agent-service-toolkit 启发的项目\n\n以下是几个从本仓库获取代码或灵感的一些公开项目。\n\n- **[PolyRAG](https:\u002F\u002Fgithub.com\u002FQuentinFuxa\u002FPolyRAG)** - 扩展了 agent-service-toolkit，使其具备对 PostgreSQL 数据库和 PDF 文档的 RAG 能力。\n- **[alexrisch\u002Fagent-web-kit](https:\u002F\u002Fgithub.com\u002Falexrisch\u002Fagent-web-kit)** - agent-service-toolkit 的 Next.JS 前端\n- **[raushan-in\u002Fdapa](https:\u002F\u002Fgithub.com\u002Fraushan-in\u002Fdapa)** - 数字逮捕保护应用 (DAPA) 允许用户通过用户友好的平台高效地报告金融诈骗和欺诈行为。\n\n**请创建拉取请求编辑 README 或发起讨论以添加任何新项目！我们很乐意纳入更多项目。**\n\n## 贡献\n\n欢迎贡献！请随时提交拉取请求。目前，测试需要使用不使用 Docker 配置的本地开发环境运行。要运行代理服务的测试：\n\n1. 确保您处于项目根目录并已激活虚拟环境。\n\n2. 安装开发依赖项和 pre-commit 钩子：\n\n   ```sh\n   uv sync --frozen\n   pre-commit install\n   ```\n\n3. 使用 pytest（测试框架）运行测试：\n\n   ```sh\n   pytest\n   ```\n\n## 许可证\n\n本项目采用 MIT 许可证 - 详见 LICENSE 文件。","# agent-service-toolkit 快速上手指南\n\n`agent-service-toolkit` 是一个基于 LangGraph、FastAPI 和 Streamlit 构建的完整 AI Agent 服务工具包。它提供了从 Agent 定义到用户界面的全套解决方案，支持流式响应、多 Agent 管理及 Docker 部署。\n\n## 1. 环境准备\n\n*   **操作系统**: Linux \u002F macOS \u002F Windows (WSL)\n*   **Python 版本**: 3.10+\n*   **依赖工具**:\n    *   `git`: 用于克隆仓库\n    *   `uv` (推荐): 高性能 Python 包管理工具（见安装步骤）\n    *   `docker` & `docker-compose` (可选): 用于容器化运行\n*   **网络建议**: 国内开发者若遇到拉取速度较慢，可配置 Git 代理或镜像源加速。\n\n## 2. 安装步骤\n\n### 方式一：本地 Python 环境运行\n\n1.  **克隆仓库**\n    ```sh\n    git clone https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit.git\n    cd agent-service-toolkit\n    ```\n\n2.  **安装 uv (如未安装)**\n    ```sh\n    curl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002F0.7.19\u002Finstall.sh | sh\n    ```\n\n3.  **配置环境变量**\n    创建 `.env` 文件并填入至少一个 LLM API Key（例如 OpenAI）：\n    ```sh\n    echo 'OPENAI_API_KEY=your_openai_api_key' >> .env\n    ```\n    > 提示：更多配置项请参考根目录下的 `.env.example` 文件。\n\n4.  **同步依赖**\n    ```sh\n    uv sync --frozen\n    source .venv\u002Fbin\u002Factivate\n    ```\n\n### 方式二：Docker 容器运行 (推荐)\n\n1.  **配置环境变量**\n    ```sh\n    cp .env.example .env\n    # 编辑 .env 文件添加 API Key\n    ```\n\n2.  **启动服务**\n    使用 `docker compose watch` 实现代码热更新：\n    ```sh\n    docker compose watch\n    ```\n\n## 3. 基本使用\n\n### 启动服务与界面\n\n如果你选择了本地 Python 环境，需要在两个终端窗口分别执行以下命令：\n\n**终端 1 (启动后端服务):**\n```sh\nsource .venv\u002Fbin\u002Factivate\npython src\u002Frun_service.py\n```\n\n**终端 2 (启动前端界面):**\n```sh\nsource .venv\u002Fbin\u002Factivate\nstreamlit run src\u002Fstreamlit_app.py\n```\n\n### 访问应用\n\n*   **Web 界面**: 打开浏览器访问 `http:\u002F\u002Flocalhost:8501`\n*   **API 接口**: 后端服务运行在 `http:\u002F\u002F0.0.0.0:8080`，文档地址为 `http:\u002F\u002F0.0.0.0:8080\u002Fredoc`\n\n### 客户端调用示例\n\n项目内置了 `AgentClient`，可用于构建其他应用：\n\n```python\nfrom client import AgentClient\nclient = AgentClient()\n\nresponse = client.invoke(\"Tell me a brief joke?\")\nresponse.pretty_print()\n```\n\n### 自定义 Agent\n\n如需添加自己的 Agent：\n1.  在 `src\u002Fagents\u002F` 目录下新建文件。\n2.  在 `src\u002Fagents\u002Fagents.py` 中注册新 Agent。\n3.  调整 `src\u002Fstreamlit_app.py` 以适配新 Agent 的功能。","某电商团队计划构建一个内部售后助手，需同时支持多轮对话、知识库检索及人工审核流程。\n\n### 没有 agent-service-toolkit 时\n- 团队需从零编写 FastAPI 后端与 Streamlit 前端，耗时数周才能打通基础链路。\n- 实现 Token 级流式输出和语音交互需深度定制代码，调试困难且稳定性差。\n- 缺乏标准化的 Agent 状态管理，导致多轮对话上下文丢失或记忆混乱。\n- 后续扩展新 Agent 类型时，需重复搭建整套服务架构，维护成本极高。\n\n### 使用 agent-service-toolkit 后\n- 直接复用其封装好的服务架构，一天内即可部署包含聊天界面的完整应用。\n- 内置的高级流式传输方案自动处理消息分片，语音输入输出配置简单可靠。\n- 利用 LangGraph 的 Store 和 interrupt 功能，轻松实现长期记忆存储与人工介入审核。\n- 通过 URL 路径即可调用不同 Agent，无需修改核心代码即可支持多任务并行。\n\n通过整合全栈组件，agent-service-toolkit 显著降低了 AI 应用落地的工程门槛。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FJoshuaC215_agent-service-toolkit_b74f0291.png","JoshuaC215","Joshua Carroll","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FJoshuaC215_1a430b67.jpg",null,"Oakland, CA","carroll.joshk@gmail.com","https:\u002F\u002Fjoshuacarroll.xyz\u002F","https:\u002F\u002Fgithub.com\u002FJoshuaC215",[84],{"name":85,"color":86,"percentage":87},"Python","#3572A5",100,4175,691,"2026-04-05T16:14:00","MIT","未说明",{"notes":94,"python":92,"dependencies":95},"至少需要一个 LLM API 密钥（如 OPENAI_API_KEY）；推荐使用 Docker Compose (>= v2.23.0) 进行开发部署；依赖管理建议使用 uv；支持 LangGraph Studio 调试；本地运行需激活虚拟环境。",[96,97,98,99,100,101,102,103],"LangGraph","FastAPI","Streamlit","Pydantic","ChromaDB","uv","pytest","langgraph-cli",[15],[106,107,108],"agents","langgraph","streamlit","2026-03-27T02:49:30.150509","2026-04-06T08:52:26.415858",[112,117,122,126,131,136],{"id":113,"question_zh":114,"answer_zh":115,"source_url":116},3632,"如何在项目中支持本地大模型（如 Qwen、DeepSeek）的工具调用？","需要选择支持工具调用的模型。可以在 Ollama 中按工具过滤模型，例如尝试使用 'MFDoom\u002Fdeepseek-r1-tool-calling:14b' 版本。注意某些蒸馏模型（如 DeepSeek R1 Distill）可能不支持工具调用 Agent。目前 Claude Sonnet 3.5 在工具调用方面的表现最佳。","https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fissues\u002F137",{"id":118,"question_zh":119,"answer_zh":120,"source_url":121},3633,"运行 Agents 时遇到 GeneratorExit 或中断错误如何解决？","这通常是因为流式传输中节点返回了没有 updates= 参数的 Command()。维护者已在 PR #211 中修复了该处理逻辑。请确保使用最新的 main 分支代码。此外，检查代码中是否存在将现有 AIMessage 作为内容传递给另一个 AIMessage 的逻辑错误。","https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fissues\u002F198",{"id":123,"question_zh":124,"answer_zh":125,"source_url":121},3634,"流式消息出现异常或部分元组未重组怎么办？","问题可能是流式消息中的 content 和 tool_calls 作为独立元组到达且未被重新组装。解决方案是添加逻辑将这些片段重构为正确的 AIMessage（跳过元数据元组）。相关修复已提交至 PR #216，建议应用此修复以解决 UI 显示问题。",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},3635,"Ollama 是否支持工具调用的流式响应？","此前 Ollama 确实存在缺失 onToolStart 事件导致无更新的问题。好消息是 Ollama 现已支持 ToolNode 流式传输。如果遇到流式响应不工作，建议更新 Ollama 版本或确认底层 LangChain 兼容性。","https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fissues\u002F105",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},3636,"如何扩展自定义消息类型或简化 Schema 设计？","建议向 ChatMessage 添加新的 'custom' 类型及可选字段 custom_data。可使用辅助函数 send_custom_message(data) 发送 LangChain 消息。序列化建议使用 .model_dump() 替代原有格式。具体实现工作已完成于 PR #72 和 #74。","https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fissues\u002F49",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},3637,"项目是否支持 pyproject.toml 配置？","是的，该功能已通过 PR #35 修复。现在可以放宽 pyproject.toml 中的版本限制要求，无需额外手动调整依赖管理配置。","https:\u002F\u002Fgithub.com\u002FJoshuaC215\u002Fagent-service-toolkit\u002Fissues\u002F13",[]]