欢迎光临
我们一直在努力

【开源发布】FinchBot (雀翎) — 当 AI 说“让我想办法“,而不是“我不会“(已获Gitee官方推荐)

玄同 765

大语言模型 (LLM) 开发工程师 | 中国传媒大学 · 数字媒体技术(智能交互与游戏设计)

CSDN · 个人主页 | GitHub · Follow


关于作者

  • 深耕领域:大语言模型开发 / RAG 知识库 / AI Agent 落地 / 模型微调
  • 技术栈:Python | RAG (LangChain / Dify + Milvus) | FastAPI + Docker
  • 工程能力:专注模型工程化部署、知识库构建与优化,擅长全流程解决方案

「让 AI 交互更智能,让技术落地更高效」 欢迎技术探讨与项目合作,解锁大模型与智能交互的无限可能!


FinchBot (雀翎) — 当 AI 说"让我想办法"而不是"我不会"

FinchBot Logo

基于 LangChain v1.2 与 LangGraph v1.0 构建 具备持久记忆、动态提示词、自主能力扩展

🎉 Gitee 官方推荐项目 — FinchBot 已获得 Gitee 官方推荐!

项目地址:GitHub – FinchBot | Gitee – FinchBot 文档:FinchBot 文档 问题反馈:GitHub Issues


摘要

想象这样一个对话:

用户:“帮我分析这个 SQLite 数据库” 传统 AI:“抱歉,我没有数据库操作的能力,无法完成这个任务。” FinchBot:[思考:我还没有数据库工具…] “让我配置一下数据库工具。” [调用 configure_mcp 添加 SQLite MCP] [新工具已加载:query_sqlite, list_tables…] “好了!现在可以分析你的数据库了。数据库包含 3 张表…”

这就是 FinchBot 的核心差异:遇到能力边界时,不是"放弃",而是"想办法"。

基于 LangChain v1.2 和 LangGraph v1.0,FinchBot 赋予智能体真正的自主性:

  • 能力自扩展 — Agent 遇到能力边界时,可使用内置工具配置 MCP、创建技能
  • 任务自调度 — Agent 可自主设定后台任务、定时执行,不阻塞对话
  • 记忆自管理 — Agent 可自主记忆、检索、遗忘,Agentic RAG + 加权 RRF 混合检索,智能召回
  • 行为自进化 — Agent 和用户都可自主修改提示词,持续迭代优化行为

  • 能力边界问题

    用户请求传统 AI 回应FinchBot 回应
    “分析这个数据库” “我没有数据库工具” 自主配置 SQLite MCP,然后分析
    “学会做某事” “等开发者添加功能” 通过 skill-creator 自主创建技能
    “帮我监控 24 小时” “我只能在你问的时候响应” 创建定时任务,自主监控
    “处理这个大文件” 阻塞对话,用户等待 后台执行,用户继续
    “记住我的偏好” “下次对话就忘了” 持久记忆,Agentic RAG + 加权 RRF 混合检索
    “调整你的行为” “提示词是固定的” 动态修改提示词,热加载

    系统架构

    核心理念:FinchBot 智能体不只是响应 — 它们自主执行、自主规划、自主扩展。

    自主性金字塔

    #mermaid-svg-c5bWTSHEj8llhT6o{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-c5bWTSHEj8llhT6o .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-c5bWTSHEj8llhT6o .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-c5bWTSHEj8llhT6o .error-icon{fill:#552222;}#mermaid-svg-c5bWTSHEj8llhT6o .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-c5bWTSHEj8llhT6o .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-c5bWTSHEj8llhT6o .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-c5bWTSHEj8llhT6o .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-c5bWTSHEj8llhT6o .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-c5bWTSHEj8llhT6o .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-c5bWTSHEj8llhT6o .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-c5bWTSHEj8llhT6o .marker{fill:#333333;stroke:#333333;}#mermaid-svg-c5bWTSHEj8llhT6o .marker.cross{stroke:#333333;}#mermaid-svg-c5bWTSHEj8llhT6o svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-c5bWTSHEj8llhT6o p{margin:0;}#mermaid-svg-c5bWTSHEj8llhT6o .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-c5bWTSHEj8llhT6o .cluster-label text{fill:#333;}#mermaid-svg-c5bWTSHEj8llhT6o .cluster-label span{color:#333;}#mermaid-svg-c5bWTSHEj8llhT6o .cluster-label span p{background-color:transparent;}#mermaid-svg-c5bWTSHEj8llhT6o .label text,#mermaid-svg-c5bWTSHEj8llhT6o span{fill:#333;color:#333;}#mermaid-svg-c5bWTSHEj8llhT6o .node rect,#mermaid-svg-c5bWTSHEj8llhT6o .node circle,#mermaid-svg-c5bWTSHEj8llhT6o .node ellipse,#mermaid-svg-c5bWTSHEj8llhT6o .node polygon,#mermaid-svg-c5bWTSHEj8llhT6o .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-c5bWTSHEj8llhT6o .rough-node .label text,#mermaid-svg-c5bWTSHEj8llhT6o .node .label text,#mermaid-svg-c5bWTSHEj8llhT6o .image-shape .label,#mermaid-svg-c5bWTSHEj8llhT6o .icon-shape .label{text-anchor:middle;}#mermaid-svg-c5bWTSHEj8llhT6o .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-c5bWTSHEj8llhT6o .rough-node .label,#mermaid-svg-c5bWTSHEj8llhT6o .node .label,#mermaid-svg-c5bWTSHEj8llhT6o .image-shape .label,#mermaid-svg-c5bWTSHEj8llhT6o .icon-shape .label{text-align:center;}#mermaid-svg-c5bWTSHEj8llhT6o .node.clickable{cursor:pointer;}#mermaid-svg-c5bWTSHEj8llhT6o .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-c5bWTSHEj8llhT6o .arrowheadPath{fill:#333333;}#mermaid-svg-c5bWTSHEj8llhT6o .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-c5bWTSHEj8llhT6o .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-c5bWTSHEj8llhT6o .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-c5bWTSHEj8llhT6o .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-c5bWTSHEj8llhT6o .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-c5bWTSHEj8llhT6o .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-c5bWTSHEj8llhT6o .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-c5bWTSHEj8llhT6o .cluster text{fill:#333;}#mermaid-svg-c5bWTSHEj8llhT6o .cluster span{color:#333;}#mermaid-svg-c5bWTSHEj8llhT6o div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-c5bWTSHEj8llhT6o .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-c5bWTSHEj8llhT6o rect.text{fill:none;stroke-width:0;}#mermaid-svg-c5bWTSHEj8llhT6o .icon-shape,#mermaid-svg-c5bWTSHEj8llhT6o .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-c5bWTSHEj8llhT6o .icon-shape p,#mermaid-svg-c5bWTSHEj8llhT6o .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-c5bWTSHEj8llhT6o .icon-shape rect,#mermaid-svg-c5bWTSHEj8llhT6o .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-c5bWTSHEj8llhT6o .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-c5bWTSHEj8llhT6o .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-c5bWTSHEj8llhT6o :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

    响应层 – 响应用户请求

    对话系统

    工具调用

    上下文记忆

    执行层 – 自主执行任务

    后台任务

    异步处理

    非阻塞

    规划层 – 自主创建计划

    定时任务

    心跳监控

    自动触发

    扩展层 – 自主扩展能力

    MCP 自动配置

    技能创建

    动态加载

    层级能力实现方式用户价值
    响应层 响应用户请求 对话系统 + 工具调用 基础交互
    执行层 自主执行任务 后台任务系统 对话不阻塞
    规划层 自主创建计划 定时任务 + 心跳服务 自动化执行
    扩展层 自主扩展能力 MCP 配置 + 技能创建 无限扩展

    整体架构

    #mermaid-svg-eN6Zag1W1wLuFBGz{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-eN6Zag1W1wLuFBGz .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-eN6Zag1W1wLuFBGz .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-eN6Zag1W1wLuFBGz .error-icon{fill:#552222;}#mermaid-svg-eN6Zag1W1wLuFBGz .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-eN6Zag1W1wLuFBGz .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-eN6Zag1W1wLuFBGz .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-eN6Zag1W1wLuFBGz .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-eN6Zag1W1wLuFBGz .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-eN6Zag1W1wLuFBGz .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-eN6Zag1W1wLuFBGz .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-eN6Zag1W1wLuFBGz .marker{fill:#333333;stroke:#333333;}#mermaid-svg-eN6Zag1W1wLuFBGz .marker.cross{stroke:#333333;}#mermaid-svg-eN6Zag1W1wLuFBGz svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-eN6Zag1W1wLuFBGz p{margin:0;}#mermaid-svg-eN6Zag1W1wLuFBGz .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-eN6Zag1W1wLuFBGz .cluster-label text{fill:#333;}#mermaid-svg-eN6Zag1W1wLuFBGz .cluster-label span{color:#333;}#mermaid-svg-eN6Zag1W1wLuFBGz .cluster-label span p{background-color:transparent;}#mermaid-svg-eN6Zag1W1wLuFBGz .label text,#mermaid-svg-eN6Zag1W1wLuFBGz span{fill:#333;color:#333;}#mermaid-svg-eN6Zag1W1wLuFBGz .node rect,#mermaid-svg-eN6Zag1W1wLuFBGz .node circle,#mermaid-svg-eN6Zag1W1wLuFBGz .node ellipse,#mermaid-svg-eN6Zag1W1wLuFBGz .node polygon,#mermaid-svg-eN6Zag1W1wLuFBGz .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-eN6Zag1W1wLuFBGz .rough-node .label text,#mermaid-svg-eN6Zag1W1wLuFBGz .node .label text,#mermaid-svg-eN6Zag1W1wLuFBGz .image-shape .label,#mermaid-svg-eN6Zag1W1wLuFBGz .icon-shape .label{text-anchor:middle;}#mermaid-svg-eN6Zag1W1wLuFBGz .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-eN6Zag1W1wLuFBGz .rough-node .label,#mermaid-svg-eN6Zag1W1wLuFBGz .node .label,#mermaid-svg-eN6Zag1W1wLuFBGz .image-shape .label,#mermaid-svg-eN6Zag1W1wLuFBGz .icon-shape .label{text-align:center;}#mermaid-svg-eN6Zag1W1wLuFBGz .node.clickable{cursor:pointer;}#mermaid-svg-eN6Zag1W1wLuFBGz .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-eN6Zag1W1wLuFBGz .arrowheadPath{fill:#333333;}#mermaid-svg-eN6Zag1W1wLuFBGz .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-eN6Zag1W1wLuFBGz .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-eN6Zag1W1wLuFBGz .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-eN6Zag1W1wLuFBGz .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-eN6Zag1W1wLuFBGz .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-eN6Zag1W1wLuFBGz .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-eN6Zag1W1wLuFBGz .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-eN6Zag1W1wLuFBGz .cluster text{fill:#333;}#mermaid-svg-eN6Zag1W1wLuFBGz .cluster span{color:#333;}#mermaid-svg-eN6Zag1W1wLuFBGz div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-eN6Zag1W1wLuFBGz .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-eN6Zag1W1wLuFBGz rect.text{fill:none;stroke-width:0;}#mermaid-svg-eN6Zag1W1wLuFBGz .icon-shape,#mermaid-svg-eN6Zag1W1wLuFBGz .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-eN6Zag1W1wLuFBGz .icon-shape p,#mermaid-svg-eN6Zag1W1wLuFBGz .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-eN6Zag1W1wLuFBGz .icon-shape rect,#mermaid-svg-eN6Zag1W1wLuFBGz .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-eN6Zag1W1wLuFBGz .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-eN6Zag1W1wLuFBGz .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-eN6Zag1W1wLuFBGz :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-eN6Zag1W1wLuFBGz .uiLayer>*{fill:#ffebee!important;stroke:#c62828!important;stroke-width:2px!important;color:#b71c1c!important;}#mermaid-svg-eN6Zag1W1wLuFBGz .uiLayer span{fill:#ffebee!important;stroke:#c62828!important;stroke-width:2px!important;color:#b71c1c!important;}#mermaid-svg-eN6Zag1W1wLuFBGz .uiLayer tspan{fill:#b71c1c!important;}#mermaid-svg-eN6Zag1W1wLuFBGz .coreLayer>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-eN6Zag1W1wLuFBGz .coreLayer span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-eN6Zag1W1wLuFBGz .coreLayer tspan{fill:#0d47a1!important;}#mermaid-svg-eN6Zag1W1wLuFBGz .infraLayer>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-eN6Zag1W1wLuFBGz .infraLayer span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-eN6Zag1W1wLuFBGz .infraLayer tspan{fill:#1b5e20!important;}

    基础设施层

    Agent 核心层

    用户交互层

    CLI 界面

    多平台通道Discord/钉钉/飞书/微信/邮件

    LangGraph Agent决策引擎

    ContextBuilder上下文构建

    ToolRegistry24 内置工具 + MCP

    MemoryManager双层记忆

    双层存储SQLite + VectorStore

    LLM 提供商OpenAI/Anthropic/DeepSeek

    数据流

    LLM

    工具

    MemoryManager

    Agent

    AgentFactory

    MessageBus

    通道

    用户

    LLM

    工具

    MemoryManager

    Agent

    AgentFactory

    MessageBus

    通道

    用户

    #mermaid-svg-2iKJC2sNJd85WjO5{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-2iKJC2sNJd85WjO5 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-2iKJC2sNJd85WjO5 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-2iKJC2sNJd85WjO5 .error-icon{fill:#552222;}#mermaid-svg-2iKJC2sNJd85WjO5 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-2iKJC2sNJd85WjO5 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-2iKJC2sNJd85WjO5 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-2iKJC2sNJd85WjO5 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-2iKJC2sNJd85WjO5 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-2iKJC2sNJd85WjO5 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-2iKJC2sNJd85WjO5 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-2iKJC2sNJd85WjO5 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-2iKJC2sNJd85WjO5 .marker.cross{stroke:#333333;}#mermaid-svg-2iKJC2sNJd85WjO5 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-2iKJC2sNJd85WjO5 p{margin:0;}#mermaid-svg-2iKJC2sNJd85WjO5 .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-2iKJC2sNJd85WjO5 text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-2iKJC2sNJd85WjO5 .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-2iKJC2sNJd85WjO5 .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-2iKJC2sNJd85WjO5 .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-2iKJC2sNJd85WjO5 .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-2iKJC2sNJd85WjO5 #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-2iKJC2sNJd85WjO5 .sequenceNumber{fill:white;}#mermaid-svg-2iKJC2sNJd85WjO5 #sequencenumber{fill:#333;}#mermaid-svg-2iKJC2sNJd85WjO5 #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-2iKJC2sNJd85WjO5 .messageText{fill:#333;stroke:none;}#mermaid-svg-2iKJC2sNJd85WjO5 .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-2iKJC2sNJd85WjO5 .labelText,#mermaid-svg-2iKJC2sNJd85WjO5 .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-2iKJC2sNJd85WjO5 .loopText,#mermaid-svg-2iKJC2sNJd85WjO5 .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-2iKJC2sNJd85WjO5 .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-2iKJC2sNJd85WjO5 .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-2iKJC2sNJd85WjO5 .noteText,#mermaid-svg-2iKJC2sNJd85WjO5 .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-2iKJC2sNJd85WjO5 .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-2iKJC2sNJd85WjO5 .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-2iKJC2sNJd85WjO5 .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-2iKJC2sNJd85WjO5 .actorPopupMenu{position:absolute;}#mermaid-svg-2iKJC2sNJd85WjO5 .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-2iKJC2sNJd85WjO5 .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-2iKJC2sNJd85WjO5 .actor-man circle,#mermaid-svg-2iKJC2sNJd85WjO5 line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-2iKJC2sNJd85WjO5 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

    构建上下文

    alt

    [需要工具调用]

    发送消息

    1

    InboundMessage

    2

    获取/创建 Agent

    3

    返回编译后的 Agent

    4

    召回相关记忆

    5

    返回上下文

    6

    发送请求

    7

    流式响应

    8

    执行工具

    9

    返回结果

    10

    继续处理

    11

    最终响应

    12

    存储新记忆

    13

    OutboundMessage

    14

    路由到通道

    15

    显示响应

    16

    安全机制

    智能体自主 ≠ 智能体乱来。 FinchBot 实现了多重安全机制:

    安全机制状态作用
    路径限制 ✅ 已实现 文件操作限定在 workspace 目录内
    Shell 命令黑名单 ✅ 已实现 阻止 rm -rf、format、shutdown 等危险命令
    工具注册机制 ✅ 已实现 只有注册的工具可被调用

    理念:给智能体解决问题的自由,但在明确的边界内。


    核心组件

    1. 能力自扩展:内置工具 + MCP 配置 + 技能创建

    FinchBot 提供三层能力扩展机制,让智能体遇到能力边界时可以自主扩展。

    三层扩展机制

    #mermaid-svg-EGygGB2DTGDQuT3N{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-EGygGB2DTGDQuT3N .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-EGygGB2DTGDQuT3N .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-EGygGB2DTGDQuT3N .error-icon{fill:#552222;}#mermaid-svg-EGygGB2DTGDQuT3N .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-EGygGB2DTGDQuT3N .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-EGygGB2DTGDQuT3N .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-EGygGB2DTGDQuT3N .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-EGygGB2DTGDQuT3N .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-EGygGB2DTGDQuT3N .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-EGygGB2DTGDQuT3N .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-EGygGB2DTGDQuT3N .marker{fill:#333333;stroke:#333333;}#mermaid-svg-EGygGB2DTGDQuT3N .marker.cross{stroke:#333333;}#mermaid-svg-EGygGB2DTGDQuT3N svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-EGygGB2DTGDQuT3N p{margin:0;}#mermaid-svg-EGygGB2DTGDQuT3N .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-EGygGB2DTGDQuT3N .cluster-label text{fill:#333;}#mermaid-svg-EGygGB2DTGDQuT3N .cluster-label span{color:#333;}#mermaid-svg-EGygGB2DTGDQuT3N .cluster-label span p{background-color:transparent;}#mermaid-svg-EGygGB2DTGDQuT3N .label text,#mermaid-svg-EGygGB2DTGDQuT3N span{fill:#333;color:#333;}#mermaid-svg-EGygGB2DTGDQuT3N .node rect,#mermaid-svg-EGygGB2DTGDQuT3N .node circle,#mermaid-svg-EGygGB2DTGDQuT3N .node ellipse,#mermaid-svg-EGygGB2DTGDQuT3N .node polygon,#mermaid-svg-EGygGB2DTGDQuT3N .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-EGygGB2DTGDQuT3N .rough-node .label text,#mermaid-svg-EGygGB2DTGDQuT3N .node .label text,#mermaid-svg-EGygGB2DTGDQuT3N .image-shape .label,#mermaid-svg-EGygGB2DTGDQuT3N .icon-shape .label{text-anchor:middle;}#mermaid-svg-EGygGB2DTGDQuT3N .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-EGygGB2DTGDQuT3N .rough-node .label,#mermaid-svg-EGygGB2DTGDQuT3N .node .label,#mermaid-svg-EGygGB2DTGDQuT3N .image-shape .label,#mermaid-svg-EGygGB2DTGDQuT3N .icon-shape .label{text-align:center;}#mermaid-svg-EGygGB2DTGDQuT3N .node.clickable{cursor:pointer;}#mermaid-svg-EGygGB2DTGDQuT3N .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-EGygGB2DTGDQuT3N .arrowheadPath{fill:#333333;}#mermaid-svg-EGygGB2DTGDQuT3N .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-EGygGB2DTGDQuT3N .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-EGygGB2DTGDQuT3N .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-EGygGB2DTGDQuT3N .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-EGygGB2DTGDQuT3N .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-EGygGB2DTGDQuT3N .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-EGygGB2DTGDQuT3N .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-EGygGB2DTGDQuT3N .cluster text{fill:#333;}#mermaid-svg-EGygGB2DTGDQuT3N .cluster span{color:#333;}#mermaid-svg-EGygGB2DTGDQuT3N div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-EGygGB2DTGDQuT3N .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-EGygGB2DTGDQuT3N rect.text{fill:none;stroke-width:0;}#mermaid-svg-EGygGB2DTGDQuT3N .icon-shape,#mermaid-svg-EGygGB2DTGDQuT3N .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-EGygGB2DTGDQuT3N .icon-shape p,#mermaid-svg-EGygGB2DTGDQuT3N .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-EGygGB2DTGDQuT3N .icon-shape rect,#mermaid-svg-EGygGB2DTGDQuT3N .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-EGygGB2DTGDQuT3N .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-EGygGB2DTGDQuT3N .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-EGygGB2DTGDQuT3N :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-EGygGB2DTGDQuT3N .layer1>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-EGygGB2DTGDQuT3N .layer1 span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-EGygGB2DTGDQuT3N .layer1 tspan{fill:#1b5e20!important;}#mermaid-svg-EGygGB2DTGDQuT3N .layer2>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-EGygGB2DTGDQuT3N .layer2 span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-EGygGB2DTGDQuT3N .layer2 tspan{fill:#0d47a1!important;}#mermaid-svg-EGygGB2DTGDQuT3N .layer3>*{fill:#fff9c4!important;stroke:#f9a825!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-EGygGB2DTGDQuT3N .layer3 span{fill:#fff9c4!important;stroke:#f9a825!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-EGygGB2DTGDQuT3N .layer3 tspan{fill:#f57f17!important;}

    第一层内置工具开箱即用

    第二层MCP 配置Agent 自主配置

    第三层技能创建Agent 自主创建

    层级方式自主性说明
    第一层 内置工具 开箱即用 24 个内置工具,无需配置即可使用
    第二层 MCP 配置 Agent 自主配置 通过 configure_mcp 动态添加外部能力
    第三层 技能创建 Agent 自主创建 通过 skill-creator 创建新技能
    内置工具
    类别工具功能
    文件操作 read_file 读取本地文件
    write_file 写入本地文件
    edit_file 编辑文件内容
    list_dir 列出目录内容
    网络能力 web_search 联网搜索 (Tavily/Brave/DDG)
    web_extract 网页内容提取
    记忆管理 remember 主动存储记忆
    recall 检索记忆
    forget 删除/归档记忆
    系统控制 exec 安全执行 Shell 命令
    session_title 管理会话标题
    配置管理 configure_mcp 动态配置 MCP 服务器(支持启用/禁用/添加/更新/删除/列出)
    refresh_capabilities 刷新能力描述文件
    get_capabilities 获取当前能力描述
    get_mcp_config_path 获取 MCP 配置路径
    后台任务 start_background_task 启动后台任务
    check_task_status 检查任务状态
    get_task_result 获取任务结果
    cancel_task 取消任务
    定时任务 create_cron 创建定时任务
    list_crons 列出所有定时任务
    delete_cron 删除定时任务
    toggle_cron 启用/禁用定时任务
    run_cron_now 立即执行定时任务
    网页搜索

    web_search 工具采用三引擎降级设计,确保始终可用:

    #mermaid-svg-8VkbTeMZSaNwBpYX{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-8VkbTeMZSaNwBpYX .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-8VkbTeMZSaNwBpYX .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-8VkbTeMZSaNwBpYX .error-icon{fill:#552222;}#mermaid-svg-8VkbTeMZSaNwBpYX .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-8VkbTeMZSaNwBpYX .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-8VkbTeMZSaNwBpYX .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-8VkbTeMZSaNwBpYX .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-8VkbTeMZSaNwBpYX .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-8VkbTeMZSaNwBpYX .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-8VkbTeMZSaNwBpYX .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-8VkbTeMZSaNwBpYX .marker{fill:#333333;stroke:#333333;}#mermaid-svg-8VkbTeMZSaNwBpYX .marker.cross{stroke:#333333;}#mermaid-svg-8VkbTeMZSaNwBpYX svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-8VkbTeMZSaNwBpYX p{margin:0;}#mermaid-svg-8VkbTeMZSaNwBpYX .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-8VkbTeMZSaNwBpYX .cluster-label text{fill:#333;}#mermaid-svg-8VkbTeMZSaNwBpYX .cluster-label span{color:#333;}#mermaid-svg-8VkbTeMZSaNwBpYX .cluster-label span p{background-color:transparent;}#mermaid-svg-8VkbTeMZSaNwBpYX .label text,#mermaid-svg-8VkbTeMZSaNwBpYX span{fill:#333;color:#333;}#mermaid-svg-8VkbTeMZSaNwBpYX .node rect,#mermaid-svg-8VkbTeMZSaNwBpYX .node circle,#mermaid-svg-8VkbTeMZSaNwBpYX .node ellipse,#mermaid-svg-8VkbTeMZSaNwBpYX .node polygon,#mermaid-svg-8VkbTeMZSaNwBpYX .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-8VkbTeMZSaNwBpYX .rough-node .label text,#mermaid-svg-8VkbTeMZSaNwBpYX .node .label text,#mermaid-svg-8VkbTeMZSaNwBpYX .image-shape .label,#mermaid-svg-8VkbTeMZSaNwBpYX .icon-shape .label{text-anchor:middle;}#mermaid-svg-8VkbTeMZSaNwBpYX .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-8VkbTeMZSaNwBpYX .rough-node .label,#mermaid-svg-8VkbTeMZSaNwBpYX .node .label,#mermaid-svg-8VkbTeMZSaNwBpYX .image-shape .label,#mermaid-svg-8VkbTeMZSaNwBpYX .icon-shape .label{text-align:center;}#mermaid-svg-8VkbTeMZSaNwBpYX .node.clickable{cursor:pointer;}#mermaid-svg-8VkbTeMZSaNwBpYX .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-8VkbTeMZSaNwBpYX .arrowheadPath{fill:#333333;}#mermaid-svg-8VkbTeMZSaNwBpYX .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-8VkbTeMZSaNwBpYX .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-8VkbTeMZSaNwBpYX .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-8VkbTeMZSaNwBpYX .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-8VkbTeMZSaNwBpYX .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-8VkbTeMZSaNwBpYX .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-8VkbTeMZSaNwBpYX .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-8VkbTeMZSaNwBpYX .cluster text{fill:#333;}#mermaid-svg-8VkbTeMZSaNwBpYX .cluster span{color:#333;}#mermaid-svg-8VkbTeMZSaNwBpYX div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-8VkbTeMZSaNwBpYX .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-8VkbTeMZSaNwBpYX rect.text{fill:none;stroke-width:0;}#mermaid-svg-8VkbTeMZSaNwBpYX .icon-shape,#mermaid-svg-8VkbTeMZSaNwBpYX .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-8VkbTeMZSaNwBpYX .icon-shape p,#mermaid-svg-8VkbTeMZSaNwBpYX .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-8VkbTeMZSaNwBpYX .icon-shape rect,#mermaid-svg-8VkbTeMZSaNwBpYX .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-8VkbTeMZSaNwBpYX .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-8VkbTeMZSaNwBpYX .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-8VkbTeMZSaNwBpYX :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-8VkbTeMZSaNwBpYX .check>*{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-8VkbTeMZSaNwBpYX .check span{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-8VkbTeMZSaNwBpYX .check tspan{fill:#f57f17!important;}#mermaid-svg-8VkbTeMZSaNwBpYX .engine>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-8VkbTeMZSaNwBpYX .engine span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-8VkbTeMZSaNwBpYX .engine tspan{fill:#1b5e20!important;}#mermaid-svg-8VkbTeMZSaNwBpYX .fallback>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-8VkbTeMZSaNwBpYX .fallback span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-8VkbTeMZSaNwBpYX .fallback tspan{fill:#0d47a1!important;}

    网页搜索请求

    TAVILY_API_KEY已设置?

    Tavily质量最佳AI 优化

    BRAVE_API_KEY已设置?

    Brave Search隐私友好免费额度大

    DuckDuckGo零配置始终可用

    优先级引擎API Key特点
    1 Tavily 需要 质量最佳,专为 AI 优化,深度搜索
    2 Brave Search 需要 免费额度大,隐私友好
    3 DuckDuckGo 无需 始终可用,零配置
    会话管理

    session_title 工具让会话命名变得智能:

    操作方式说明示例
    自动生成 对话 2-3 轮后,AI 自动根据内容生成标题 “Python 异步编程讨论”
    Agent 修改 告诉 Agent “把会话标题改成 XXX” Agent 调用工具自动修改
    手动重命名 在会话管理器中按 r 键重命名 用户手动输入新标题
    MCP 配置

    智能体可通过 configure_mcp 工具自主管理 MCP 服务器:

    操作说明
    add 添加新 MCP 服务器
    update 更新现有服务器配置
    remove 删除 MCP 服务器
    enable 启用已禁用的 MCP 服务器
    disable 暂时禁用 MCP 服务器
    list 列出所有已配置的服务器

    动态能力更新:

    #mermaid-svg-hsK4YoJe0Z58Mkuu{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-hsK4YoJe0Z58Mkuu .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-hsK4YoJe0Z58Mkuu .error-icon{fill:#552222;}#mermaid-svg-hsK4YoJe0Z58Mkuu .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-hsK4YoJe0Z58Mkuu .marker{fill:#333333;stroke:#333333;}#mermaid-svg-hsK4YoJe0Z58Mkuu .marker.cross{stroke:#333333;}#mermaid-svg-hsK4YoJe0Z58Mkuu svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-hsK4YoJe0Z58Mkuu p{margin:0;}#mermaid-svg-hsK4YoJe0Z58Mkuu .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-hsK4YoJe0Z58Mkuu .cluster-label text{fill:#333;}#mermaid-svg-hsK4YoJe0Z58Mkuu .cluster-label span{color:#333;}#mermaid-svg-hsK4YoJe0Z58Mkuu .cluster-label span p{background-color:transparent;}#mermaid-svg-hsK4YoJe0Z58Mkuu .label text,#mermaid-svg-hsK4YoJe0Z58Mkuu span{fill:#333;color:#333;}#mermaid-svg-hsK4YoJe0Z58Mkuu .node rect,#mermaid-svg-hsK4YoJe0Z58Mkuu .node circle,#mermaid-svg-hsK4YoJe0Z58Mkuu .node ellipse,#mermaid-svg-hsK4YoJe0Z58Mkuu .node polygon,#mermaid-svg-hsK4YoJe0Z58Mkuu .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-hsK4YoJe0Z58Mkuu .rough-node .label text,#mermaid-svg-hsK4YoJe0Z58Mkuu .node .label text,#mermaid-svg-hsK4YoJe0Z58Mkuu .image-shape .label,#mermaid-svg-hsK4YoJe0Z58Mkuu .icon-shape .label{text-anchor:middle;}#mermaid-svg-hsK4YoJe0Z58Mkuu .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-hsK4YoJe0Z58Mkuu .rough-node .label,#mermaid-svg-hsK4YoJe0Z58Mkuu .node .label,#mermaid-svg-hsK4YoJe0Z58Mkuu .image-shape .label,#mermaid-svg-hsK4YoJe0Z58Mkuu .icon-shape .label{text-align:center;}#mermaid-svg-hsK4YoJe0Z58Mkuu .node.clickable{cursor:pointer;}#mermaid-svg-hsK4YoJe0Z58Mkuu .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-hsK4YoJe0Z58Mkuu .arrowheadPath{fill:#333333;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-hsK4YoJe0Z58Mkuu .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-hsK4YoJe0Z58Mkuu .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-hsK4YoJe0Z58Mkuu .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-hsK4YoJe0Z58Mkuu .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-hsK4YoJe0Z58Mkuu .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-hsK4YoJe0Z58Mkuu .cluster text{fill:#333;}#mermaid-svg-hsK4YoJe0Z58Mkuu .cluster span{color:#333;}#mermaid-svg-hsK4YoJe0Z58Mkuu div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-hsK4YoJe0Z58Mkuu .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-hsK4YoJe0Z58Mkuu rect.text{fill:none;stroke-width:0;}#mermaid-svg-hsK4YoJe0Z58Mkuu .icon-shape,#mermaid-svg-hsK4YoJe0Z58Mkuu .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-hsK4YoJe0Z58Mkuu .icon-shape p,#mermaid-svg-hsK4YoJe0Z58Mkuu .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-hsK4YoJe0Z58Mkuu .icon-shape rect,#mermaid-svg-hsK4YoJe0Z58Mkuu .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-hsK4YoJe0Z58Mkuu .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-hsK4YoJe0Z58Mkuu .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-hsK4YoJe0Z58Mkuu :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-hsK4YoJe0Z58Mkuu .config>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-hsK4YoJe0Z58Mkuu .config span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-hsK4YoJe0Z58Mkuu .config tspan{fill:#1b5e20!important;}#mermaid-svg-hsK4YoJe0Z58Mkuu .system>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-hsK4YoJe0Z58Mkuu .system span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-hsK4YoJe0Z58Mkuu .system tspan{fill:#0d47a1!important;}#mermaid-svg-hsK4YoJe0Z58Mkuu .prompt>*{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-hsK4YoJe0Z58Mkuu .prompt span{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-hsK4YoJe0Z58Mkuu .prompt tspan{fill:#f57f17!important;}

    MCP 配置configure_mcp

    refresh_capabilities

    CapabilitiesBuilder重新生成

    CAPABILITIES.md

    下次对话自动加载

    技能创建

    FinchBot 内置 skill-creator 技能,智能体可自主创建新技能:

    用户: 帮我创建一个翻译技能,可以把中文翻译成英文

    Agent: 好的,我来为你创建翻译技能…
    [调用 skill-creator 技能]
    ✅ 已创建 skills/translator/SKILL.md
    现在你可以直接使用翻译功能了!

    无需手动创建文件、无需编写代码,一句话就能扩展 Agent 能力!

    技能文件结构

    skills/
    ├── skill-creator/ # 技能创建器(内置)- 开箱即用的核心
    │ └── SKILL.md
    ├── summarize/ # 智能总结(内置)
    │ └── SKILL.md
    ├── weather/ # 天气查询(内置)
    │ └── SKILL.md
    └── my-custom-skill/ # Agent 自动创建或用户自定义
    └── SKILL.md

    设计亮点
    特性说明
    Agent 自动创建 告诉 Agent 需求,自动生成技能文件
    双层技能源 工作区技能优先,内置技能兜底
    依赖检查 自动检查 CLI 工具和环境变量
    缓存失效检测 基于文件修改时间,智能缓存
    渐进式加载 常驻技能优先,按需加载其他

    2. 任务自调度:后台任务 + 定时任务 + 心跳服务

    FinchBot 实现了三层任务调度机制,让智能体能够自主执行、规划和监控任务。

    三层调度机制

    #mermaid-svg-HHGndV7mYU66SwyP{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-HHGndV7mYU66SwyP .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-HHGndV7mYU66SwyP .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-HHGndV7mYU66SwyP .error-icon{fill:#552222;}#mermaid-svg-HHGndV7mYU66SwyP .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-HHGndV7mYU66SwyP .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-HHGndV7mYU66SwyP .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-HHGndV7mYU66SwyP .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-HHGndV7mYU66SwyP .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-HHGndV7mYU66SwyP .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-HHGndV7mYU66SwyP .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-HHGndV7mYU66SwyP .marker{fill:#333333;stroke:#333333;}#mermaid-svg-HHGndV7mYU66SwyP .marker.cross{stroke:#333333;}#mermaid-svg-HHGndV7mYU66SwyP svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-HHGndV7mYU66SwyP p{margin:0;}#mermaid-svg-HHGndV7mYU66SwyP .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-HHGndV7mYU66SwyP .cluster-label text{fill:#333;}#mermaid-svg-HHGndV7mYU66SwyP .cluster-label span{color:#333;}#mermaid-svg-HHGndV7mYU66SwyP .cluster-label span p{background-color:transparent;}#mermaid-svg-HHGndV7mYU66SwyP .label text,#mermaid-svg-HHGndV7mYU66SwyP span{fill:#333;color:#333;}#mermaid-svg-HHGndV7mYU66SwyP .node rect,#mermaid-svg-HHGndV7mYU66SwyP .node circle,#mermaid-svg-HHGndV7mYU66SwyP .node ellipse,#mermaid-svg-HHGndV7mYU66SwyP .node polygon,#mermaid-svg-HHGndV7mYU66SwyP .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-HHGndV7mYU66SwyP .rough-node .label text,#mermaid-svg-HHGndV7mYU66SwyP .node .label text,#mermaid-svg-HHGndV7mYU66SwyP .image-shape .label,#mermaid-svg-HHGndV7mYU66SwyP .icon-shape .label{text-anchor:middle;}#mermaid-svg-HHGndV7mYU66SwyP .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-HHGndV7mYU66SwyP .rough-node .label,#mermaid-svg-HHGndV7mYU66SwyP .node .label,#mermaid-svg-HHGndV7mYU66SwyP .image-shape .label,#mermaid-svg-HHGndV7mYU66SwyP .icon-shape .label{text-align:center;}#mermaid-svg-HHGndV7mYU66SwyP .node.clickable{cursor:pointer;}#mermaid-svg-HHGndV7mYU66SwyP .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-HHGndV7mYU66SwyP .arrowheadPath{fill:#333333;}#mermaid-svg-HHGndV7mYU66SwyP .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-HHGndV7mYU66SwyP .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-HHGndV7mYU66SwyP .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-HHGndV7mYU66SwyP .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-HHGndV7mYU66SwyP .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-HHGndV7mYU66SwyP .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-HHGndV7mYU66SwyP .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-HHGndV7mYU66SwyP .cluster text{fill:#333;}#mermaid-svg-HHGndV7mYU66SwyP .cluster span{color:#333;}#mermaid-svg-HHGndV7mYU66SwyP div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-HHGndV7mYU66SwyP .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-HHGndV7mYU66SwyP rect.text{fill:none;stroke-width:0;}#mermaid-svg-HHGndV7mYU66SwyP .icon-shape,#mermaid-svg-HHGndV7mYU66SwyP .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-HHGndV7mYU66SwyP .icon-shape p,#mermaid-svg-HHGndV7mYU66SwyP .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-HHGndV7mYU66SwyP .icon-shape rect,#mermaid-svg-HHGndV7mYU66SwyP .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-HHGndV7mYU66SwyP .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-HHGndV7mYU66SwyP .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-HHGndV7mYU66SwyP :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-HHGndV7mYU66SwyP .layer1>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-HHGndV7mYU66SwyP .layer1 span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-HHGndV7mYU66SwyP .layer1 tspan{fill:#1b5e20!important;}#mermaid-svg-HHGndV7mYU66SwyP .layer2>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-HHGndV7mYU66SwyP .layer2 span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-HHGndV7mYU66SwyP .layer2 tspan{fill:#0d47a1!important;}#mermaid-svg-HHGndV7mYU66SwyP .layer3>*{fill:#fff9c4!important;stroke:#f9a825!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-HHGndV7mYU66SwyP .layer3 span{fill:#fff9c4!important;stroke:#f9a825!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-HHGndV7mYU66SwyP .layer3 tspan{fill:#f57f17!important;}

    执行层 – 后台任务

    异步执行

    非阻塞

    结果获取

    规划层 – 定时任务

    Cron 调度

    周期执行

    自动重试

    监控层 – 心跳服务

    自主唤醒

    定期检查

    主动通知

    层级功能特点使用场景
    执行层 后台任务 异步执行,不阻塞对话 长时间运行的任务
    规划层 定时任务 周期执行,自动化运行 定期提醒、定时报告
    监控层 心跳服务 主动检查,自主唤醒 条件监控、状态追踪
    后台任务

    FinchBot 实现了四工具模式用于异步任务执行:

    工具功能智能体自主性
    start_background_task 启动后台任务 智能体自主判断是否需要后台执行
    check_task_status 检查任务状态 智能体自主决定何时检查
    get_task_result 获取任务结果 智能体自主决定何时获取结果
    cancel_task 取消任务 智能体自主决定是否取消

    子智能体

    后台任务系统

    智能体

    用户

    子智能体

    后台任务系统

    智能体

    用户

    #mermaid-svg-n1npFqzMyqOtmhji{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-n1npFqzMyqOtmhji .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-n1npFqzMyqOtmhji .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-n1npFqzMyqOtmhji .error-icon{fill:#552222;}#mermaid-svg-n1npFqzMyqOtmhji .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-n1npFqzMyqOtmhji .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-n1npFqzMyqOtmhji .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-n1npFqzMyqOtmhji .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-n1npFqzMyqOtmhji .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-n1npFqzMyqOtmhji .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-n1npFqzMyqOtmhji .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-n1npFqzMyqOtmhji .marker{fill:#333333;stroke:#333333;}#mermaid-svg-n1npFqzMyqOtmhji .marker.cross{stroke:#333333;}#mermaid-svg-n1npFqzMyqOtmhji svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-n1npFqzMyqOtmhji p{margin:0;}#mermaid-svg-n1npFqzMyqOtmhji .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-n1npFqzMyqOtmhji text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-n1npFqzMyqOtmhji .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-n1npFqzMyqOtmhji .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-n1npFqzMyqOtmhji .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-n1npFqzMyqOtmhji .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-n1npFqzMyqOtmhji #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-n1npFqzMyqOtmhji .sequenceNumber{fill:white;}#mermaid-svg-n1npFqzMyqOtmhji #sequencenumber{fill:#333;}#mermaid-svg-n1npFqzMyqOtmhji #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-n1npFqzMyqOtmhji .messageText{fill:#333;stroke:none;}#mermaid-svg-n1npFqzMyqOtmhji .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-n1npFqzMyqOtmhji .labelText,#mermaid-svg-n1npFqzMyqOtmhji .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-n1npFqzMyqOtmhji .loopText,#mermaid-svg-n1npFqzMyqOtmhji .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-n1npFqzMyqOtmhji .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-n1npFqzMyqOtmhji .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-n1npFqzMyqOtmhji .noteText,#mermaid-svg-n1npFqzMyqOtmhji .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-n1npFqzMyqOtmhji .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-n1npFqzMyqOtmhji .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-n1npFqzMyqOtmhji .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-n1npFqzMyqOtmhji .actorPopupMenu{position:absolute;}#mermaid-svg-n1npFqzMyqOtmhji .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-n1npFqzMyqOtmhji .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-n1npFqzMyqOtmhji .actor-man circle,#mermaid-svg-n1npFqzMyqOtmhji line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-n1npFqzMyqOtmhji :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

    用户继续对话…

    执行长任务

    start_background_task

    创建独立智能体

    返回 job_id

    任务已启动 (ID: xxx)

    其他问题

    正常回复

    任务进度?

    check_task_status

    running

    仍在执行…

    任务完成

    获取结果

    get_task_result

    返回结果

    展示任务结果

    定时任务

    FinchBot 的定时任务系统让智能体能够自主创建和管理周期性任务:

    #mermaid-svg-9Z6xbuMsJhVFMTJF{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-9Z6xbuMsJhVFMTJF .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-9Z6xbuMsJhVFMTJF .error-icon{fill:#552222;}#mermaid-svg-9Z6xbuMsJhVFMTJF .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-9Z6xbuMsJhVFMTJF .marker{fill:#333333;stroke:#333333;}#mermaid-svg-9Z6xbuMsJhVFMTJF .marker.cross{stroke:#333333;}#mermaid-svg-9Z6xbuMsJhVFMTJF svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-9Z6xbuMsJhVFMTJF p{margin:0;}#mermaid-svg-9Z6xbuMsJhVFMTJF .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-9Z6xbuMsJhVFMTJF .cluster-label text{fill:#333;}#mermaid-svg-9Z6xbuMsJhVFMTJF .cluster-label span{color:#333;}#mermaid-svg-9Z6xbuMsJhVFMTJF .cluster-label span p{background-color:transparent;}#mermaid-svg-9Z6xbuMsJhVFMTJF .label text,#mermaid-svg-9Z6xbuMsJhVFMTJF span{fill:#333;color:#333;}#mermaid-svg-9Z6xbuMsJhVFMTJF .node rect,#mermaid-svg-9Z6xbuMsJhVFMTJF .node circle,#mermaid-svg-9Z6xbuMsJhVFMTJF .node ellipse,#mermaid-svg-9Z6xbuMsJhVFMTJF .node polygon,#mermaid-svg-9Z6xbuMsJhVFMTJF .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-9Z6xbuMsJhVFMTJF .rough-node .label text,#mermaid-svg-9Z6xbuMsJhVFMTJF .node .label text,#mermaid-svg-9Z6xbuMsJhVFMTJF .image-shape .label,#mermaid-svg-9Z6xbuMsJhVFMTJF .icon-shape .label{text-anchor:middle;}#mermaid-svg-9Z6xbuMsJhVFMTJF .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-9Z6xbuMsJhVFMTJF .rough-node .label,#mermaid-svg-9Z6xbuMsJhVFMTJF .node .label,#mermaid-svg-9Z6xbuMsJhVFMTJF .image-shape .label,#mermaid-svg-9Z6xbuMsJhVFMTJF .icon-shape .label{text-align:center;}#mermaid-svg-9Z6xbuMsJhVFMTJF .node.clickable{cursor:pointer;}#mermaid-svg-9Z6xbuMsJhVFMTJF .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-9Z6xbuMsJhVFMTJF .arrowheadPath{fill:#333333;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-9Z6xbuMsJhVFMTJF .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-9Z6xbuMsJhVFMTJF .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-9Z6xbuMsJhVFMTJF .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-9Z6xbuMsJhVFMTJF .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-9Z6xbuMsJhVFMTJF .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-9Z6xbuMsJhVFMTJF .cluster text{fill:#333;}#mermaid-svg-9Z6xbuMsJhVFMTJF .cluster span{color:#333;}#mermaid-svg-9Z6xbuMsJhVFMTJF div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-9Z6xbuMsJhVFMTJF .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-9Z6xbuMsJhVFMTJF rect.text{fill:none;stroke-width:0;}#mermaid-svg-9Z6xbuMsJhVFMTJF .icon-shape,#mermaid-svg-9Z6xbuMsJhVFMTJF .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-9Z6xbuMsJhVFMTJF .icon-shape p,#mermaid-svg-9Z6xbuMsJhVFMTJF .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-9Z6xbuMsJhVFMTJF .icon-shape rect,#mermaid-svg-9Z6xbuMsJhVFMTJF .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-9Z6xbuMsJhVFMTJF .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-9Z6xbuMsJhVFMTJF .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-9Z6xbuMsJhVFMTJF :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-9Z6xbuMsJhVFMTJF .agent>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-9Z6xbuMsJhVFMTJF .agent span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-9Z6xbuMsJhVFMTJF .agent tspan{fill:#0d47a1!important;}#mermaid-svg-9Z6xbuMsJhVFMTJF .system>*{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-9Z6xbuMsJhVFMTJF .system span{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-9Z6xbuMsJhVFMTJF .system tspan{fill:#f57f17!important;}#mermaid-svg-9Z6xbuMsJhVFMTJF .action>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-9Z6xbuMsJhVFMTJF .action span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-9Z6xbuMsJhVFMTJF .action tspan{fill:#1b5e20!important;}

    触发

    完成

    失败

    智能体自主创建任务

    Cron 调度器

    执行任务

    通知用户

    自动重试

    核心特性:

    特性说明
    Cron 表达式 支持标准 Cron 语法,灵活配置执行时间
    持久化存储 任务配置保存在 SQLite,重启后自动恢复
    自动重试 任务失败时自动重试,确保可靠性
    状态追踪 记录每次执行结果,便于审计和调试

    常用 Cron 表达式:

    表达式说明
    0 9 * * * 每天上午 9:00
    0 */2 * * * 每 2 小时
    30 18 * * 1-5 工作日下午 6:30
    0 0 1 * * 每月 1 日午夜
    0 0 * * 0 每周日午夜

    使用示例:

    用户: 每天早上 9 点提醒我查看邮件

    Agent: 好的,我来创建一个定时任务…
    [调用 create_cron 工具]
    ✅ 已创建定时任务
    – 触发时间: 每天 09:00
    – 任务内容: 提醒查看邮件
    – 下次执行: 明天 09:00

    心跳服务

    心跳服务让 Agent 能够定期"醒来"检查是否有待处理任务,实现真正的自主运行。

    #mermaid-svg-me8rVV3WOeB8YliF{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-me8rVV3WOeB8YliF .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-me8rVV3WOeB8YliF .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-me8rVV3WOeB8YliF .error-icon{fill:#552222;}#mermaid-svg-me8rVV3WOeB8YliF .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-me8rVV3WOeB8YliF .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-me8rVV3WOeB8YliF .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-me8rVV3WOeB8YliF .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-me8rVV3WOeB8YliF .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-me8rVV3WOeB8YliF .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-me8rVV3WOeB8YliF .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-me8rVV3WOeB8YliF .marker{fill:#333333;stroke:#333333;}#mermaid-svg-me8rVV3WOeB8YliF .marker.cross{stroke:#333333;}#mermaid-svg-me8rVV3WOeB8YliF svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-me8rVV3WOeB8YliF p{margin:0;}#mermaid-svg-me8rVV3WOeB8YliF .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-me8rVV3WOeB8YliF .cluster-label text{fill:#333;}#mermaid-svg-me8rVV3WOeB8YliF .cluster-label span{color:#333;}#mermaid-svg-me8rVV3WOeB8YliF .cluster-label span p{background-color:transparent;}#mermaid-svg-me8rVV3WOeB8YliF .label text,#mermaid-svg-me8rVV3WOeB8YliF span{fill:#333;color:#333;}#mermaid-svg-me8rVV3WOeB8YliF .node rect,#mermaid-svg-me8rVV3WOeB8YliF .node circle,#mermaid-svg-me8rVV3WOeB8YliF .node ellipse,#mermaid-svg-me8rVV3WOeB8YliF .node polygon,#mermaid-svg-me8rVV3WOeB8YliF .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-me8rVV3WOeB8YliF .rough-node .label text,#mermaid-svg-me8rVV3WOeB8YliF .node .label text,#mermaid-svg-me8rVV3WOeB8YliF .image-shape .label,#mermaid-svg-me8rVV3WOeB8YliF .icon-shape .label{text-anchor:middle;}#mermaid-svg-me8rVV3WOeB8YliF .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-me8rVV3WOeB8YliF .rough-node .label,#mermaid-svg-me8rVV3WOeB8YliF .node .label,#mermaid-svg-me8rVV3WOeB8YliF .image-shape .label,#mermaid-svg-me8rVV3WOeB8YliF .icon-shape .label{text-align:center;}#mermaid-svg-me8rVV3WOeB8YliF .node.clickable{cursor:pointer;}#mermaid-svg-me8rVV3WOeB8YliF .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-me8rVV3WOeB8YliF .arrowheadPath{fill:#333333;}#mermaid-svg-me8rVV3WOeB8YliF .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-me8rVV3WOeB8YliF .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-me8rVV3WOeB8YliF .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-me8rVV3WOeB8YliF .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-me8rVV3WOeB8YliF .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-me8rVV3WOeB8YliF .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-me8rVV3WOeB8YliF .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-me8rVV3WOeB8YliF .cluster text{fill:#333;}#mermaid-svg-me8rVV3WOeB8YliF .cluster span{color:#333;}#mermaid-svg-me8rVV3WOeB8YliF div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-me8rVV3WOeB8YliF .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-me8rVV3WOeB8YliF rect.text{fill:none;stroke-width:0;}#mermaid-svg-me8rVV3WOeB8YliF .icon-shape,#mermaid-svg-me8rVV3WOeB8YliF .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-me8rVV3WOeB8YliF .icon-shape p,#mermaid-svg-me8rVV3WOeB8YliF .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-me8rVV3WOeB8YliF .icon-shape rect,#mermaid-svg-me8rVV3WOeB8YliF .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-me8rVV3WOeB8YliF .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-me8rVV3WOeB8YliF .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-me8rVV3WOeB8YliF :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-me8rVV3WOeB8YliF .trigger>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-me8rVV3WOeB8YliF .trigger span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-me8rVV3WOeB8YliF .trigger tspan{fill:#0d47a1!important;}#mermaid-svg-me8rVV3WOeB8YliF .decision>*{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-me8rVV3WOeB8YliF .decision span{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-me8rVV3WOeB8YliF .decision tspan{fill:#f57f17!important;}#mermaid-svg-me8rVV3WOeB8YliF .action>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-me8rVV3WOeB8YliF .action span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-me8rVV3WOeB8YliF .action tspan{fill:#1b5e20!important;}

    唤醒

    有任务

    run

    skip

    定时器默认 30 分钟

    检查 HEARTBEAT.md

    LLM 决策

    执行任务

    继续等待

    核心特性:

    特性说明
    自主唤醒 无需用户触发,Agent 定期主动检查
    LLM 决策 通过 LLM 智能判断是否需要执行任务
    灵活配置 可自定义检查间隔(默认 30 分钟)
    会话绑定 随 chat 会话启动和停止

    工作流程:

  • Agent 在对话时自动启动心跳服务
  • 每隔指定时间检查 HEARTBEAT.md 文件
  • 如果有内容,通过 LLM 决定是否执行
  • LLM 返回 run 则执行任务,返回 skip 则等待下次检查
  • 使用示例:

    用户: 帮我监控股票价格,跌破 100 元时通知我

    Agent: 好的,我会在 HEARTBEAT.md 中记录这个任务…
    心跳服务会定期检查股票价格
    当条件满足时会主动通知你

    3. 记忆自管理:Agentic RAG + 加权 RRF 混合检索

    FinchBot 实现了先进的双层记忆架构,让智能体能够自主记忆、检索和遗忘。

    Agentic RAG 优势
    对比维度传统 RAGAgentic RAG (FinchBot)
    检索触发 固定流程 Agent 自主决策
    检索策略 单一向量检索 混合检索 + 权重动态调整
    记忆管理 被动存储 主动 remember/recall/forget
    分类能力 自动分类 + 重要性评分
    更新机制 全量重建 增量同步
    记忆工具

    智能体可通过三个核心工具自主管理记忆:

    工具功能使用场景
    remember 主动存储记忆 用户偏好、重要信息、上下文
    recall 检索记忆 查找历史信息、回忆上下文
    forget 删除/归档记忆 过期信息、错误记忆、隐私清理

    使用示例:

    用户: 记住我喜欢用中文交流

    Agent: 好的,我会记住这个偏好。
    [调用 remember 工具]
    ✅ 已存储:用户偏好 – 语言:中文

    用户: 我之前说过什么语言偏好?

    Agent: [调用 recall 工具]
    你之前告诉我喜欢用中文交流。

    双层存储架构

    #mermaid-svg-d5hDIcglwX9lsvJt{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-d5hDIcglwX9lsvJt .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-d5hDIcglwX9lsvJt .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-d5hDIcglwX9lsvJt .error-icon{fill:#552222;}#mermaid-svg-d5hDIcglwX9lsvJt .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-d5hDIcglwX9lsvJt .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-d5hDIcglwX9lsvJt .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-d5hDIcglwX9lsvJt .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-d5hDIcglwX9lsvJt .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-d5hDIcglwX9lsvJt .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-d5hDIcglwX9lsvJt .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-d5hDIcglwX9lsvJt .marker{fill:#333333;stroke:#333333;}#mermaid-svg-d5hDIcglwX9lsvJt .marker.cross{stroke:#333333;}#mermaid-svg-d5hDIcglwX9lsvJt svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-d5hDIcglwX9lsvJt p{margin:0;}#mermaid-svg-d5hDIcglwX9lsvJt .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-d5hDIcglwX9lsvJt .cluster-label text{fill:#333;}#mermaid-svg-d5hDIcglwX9lsvJt .cluster-label span{color:#333;}#mermaid-svg-d5hDIcglwX9lsvJt .cluster-label span p{background-color:transparent;}#mermaid-svg-d5hDIcglwX9lsvJt .label text,#mermaid-svg-d5hDIcglwX9lsvJt span{fill:#333;color:#333;}#mermaid-svg-d5hDIcglwX9lsvJt .node rect,#mermaid-svg-d5hDIcglwX9lsvJt .node circle,#mermaid-svg-d5hDIcglwX9lsvJt .node ellipse,#mermaid-svg-d5hDIcglwX9lsvJt .node polygon,#mermaid-svg-d5hDIcglwX9lsvJt .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-d5hDIcglwX9lsvJt .rough-node .label text,#mermaid-svg-d5hDIcglwX9lsvJt .node .label text,#mermaid-svg-d5hDIcglwX9lsvJt .image-shape .label,#mermaid-svg-d5hDIcglwX9lsvJt .icon-shape .label{text-anchor:middle;}#mermaid-svg-d5hDIcglwX9lsvJt .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-d5hDIcglwX9lsvJt .rough-node .label,#mermaid-svg-d5hDIcglwX9lsvJt .node .label,#mermaid-svg-d5hDIcglwX9lsvJt .image-shape .label,#mermaid-svg-d5hDIcglwX9lsvJt .icon-shape .label{text-align:center;}#mermaid-svg-d5hDIcglwX9lsvJt .node.clickable{cursor:pointer;}#mermaid-svg-d5hDIcglwX9lsvJt .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-d5hDIcglwX9lsvJt .arrowheadPath{fill:#333333;}#mermaid-svg-d5hDIcglwX9lsvJt .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-d5hDIcglwX9lsvJt .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-d5hDIcglwX9lsvJt .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-d5hDIcglwX9lsvJt .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-d5hDIcglwX9lsvJt .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-d5hDIcglwX9lsvJt .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-d5hDIcglwX9lsvJt .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-d5hDIcglwX9lsvJt .cluster text{fill:#333;}#mermaid-svg-d5hDIcglwX9lsvJt .cluster span{color:#333;}#mermaid-svg-d5hDIcglwX9lsvJt div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-d5hDIcglwX9lsvJt .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-d5hDIcglwX9lsvJt rect.text{fill:none;stroke-width:0;}#mermaid-svg-d5hDIcglwX9lsvJt .icon-shape,#mermaid-svg-d5hDIcglwX9lsvJt .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-d5hDIcglwX9lsvJt .icon-shape p,#mermaid-svg-d5hDIcglwX9lsvJt .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-d5hDIcglwX9lsvJt .icon-shape rect,#mermaid-svg-d5hDIcglwX9lsvJt .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-d5hDIcglwX9lsvJt .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-d5hDIcglwX9lsvJt .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-d5hDIcglwX9lsvJt :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-d5hDIcglwX9lsvJt .businessLayer>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-d5hDIcglwX9lsvJt .businessLayer span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-d5hDIcglwX9lsvJt .businessLayer tspan{fill:#0d47a1!important;}#mermaid-svg-d5hDIcglwX9lsvJt .serviceLayer>*{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-d5hDIcglwX9lsvJt .serviceLayer span{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-d5hDIcglwX9lsvJt .serviceLayer tspan{fill:#f57f17!important;}#mermaid-svg-d5hDIcglwX9lsvJt .storageLayer>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-d5hDIcglwX9lsvJt .storageLayer span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-d5hDIcglwX9lsvJt .storageLayer tspan{fill:#1b5e20!important;}

    双层存储

    服务层

    业务层

    第二层:向量存储

    第一层:结构化存储

    RRF 融合

    MemoryManagerremember/recall/forget

    RetrievalService混合检索 + RRF 融合

    ClassificationService自动分类

    ImportanceScorer重要性评分

    EmbeddingServiceFastEmbed 本地嵌入

    SQLiteStore真相源 · 精确查询

    VectorStoreChromaDB · 语义检索

    DataSyncManager增量同步

    检索结果

    混合检索策略

    FinchBot 采用加权 RRF (Weighted Reciprocal Rank Fusion) 策略:

    优势说明
    无需归一化 仅基于排名位置计算,无需了解向量或 BM25 分数分布
    抗异常值 对单个检索器的异常结果不敏感,更稳定
    共识优先 奖励多个检索器都认可的文档,而非单一异常
    权重可控 可根据查询类型动态调整关键词/语义检索权重

    查询类型自适应权重:

    class QueryType(StrEnum):
    """查询类型,决定检索权重(关键词权重 / 语义权重)"""
    KEYWORD_ONLY = "keyword_only" # 纯关键词 (1.0/0.0)
    SEMANTIC_ONLY = "semantic_only" # 纯语义 (0.0/1.0)
    FACTUAL = "factual" # 事实型 (0.8/0.2)
    CONCEPTUAL = "conceptual" # 概念型 (0.2/0.8)
    COMPLEX = "complex" # 复杂型 (0.5/0.5)
    AMBIGUOUS = "ambiguous" # 歧义型 (0.3/0.7)

    RRF 公式:

    RRF(d) = Σ (weight_r / (k + rank_r(d)))

    其中:
    – d 是文档
    – k 是平滑常数(通常为 60)
    – rank_r(d) 是文档 d 在检索器 r 中的排名
    – weight_r 是检索器 r 的权重

    设计亮点
    特性说明
    自主决策 Agent 根据查询内容选择合适的检索权重
    动态调整 事实型查询偏向关键词,概念型查询偏向语义
    迭代验证 如果结果不满意,可以调整策略重试
    可解释性 每个检索决策都有明确的权重依据

    4. 行为自进化:动态提示词系统

    FinchBot 的提示词系统采用文件系统 + 模块化组装的设计,让智能体和用户都能自主修改行为。

    动态提示词优势
    传统方式FinchBot 方式
    提示词硬编码在代码中 提示词存储在文件系统中
    修改需要重新部署 修改后下次对话自动生效
    用户无法自定义 用户可通过编辑文件自定义
    Agent 无法调整自身行为 Agent 可自主优化提示词
    Bootstrap 文件系统

    ~/.finchbot/
    ├── config.json # 主配置文件
    └── workspace/
    ├── bootstrap/ # Bootstrap 文件目录
    │ ├── SYSTEM.md # 角色设定(身份、职责、约束)
    │ ├── MEMORY_GUIDE.md # 记忆使用指南(何时存储/检索)
    │ ├── SOUL.md # 灵魂设定(性格、语气、风格)
    │ └── AGENT_CONFIG.md # Agent 配置(模型参数、行为选项)
    ├── config/ # 配置目录
    │ └── mcp.json # MCP 服务器配置
    ├── generated/ # 自动生成文件
    │ ├── TOOLS.md # 工具文档(自动生成)
    │ └── CAPABILITIES.md # 能力信息(自动生成)
    ├── skills/ # 自定义技能
    ├── memory/ # 记忆存储
    └── sessions/ # 会话数据

    Bootstrap 文件说明:

    文件作用示例内容
    SYSTEM.md 定义 Agent 的身份和职责 “你是一个智能助手,擅长…”
    MEMORY_GUIDE.md 指导 Agent 如何使用记忆 “用户偏好应存储在长期记忆中…”
    SOUL.md 定义 Agent 的性格特征 “你的回复应该简洁、友好…”
    AGENT_CONFIG.md Agent 行为配置 默认语言、响应风格等
    提示词构建流程

    #mermaid-svg-W3tb2rtEUXMSsT0U{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-W3tb2rtEUXMSsT0U .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-W3tb2rtEUXMSsT0U .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-W3tb2rtEUXMSsT0U .error-icon{fill:#552222;}#mermaid-svg-W3tb2rtEUXMSsT0U .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-W3tb2rtEUXMSsT0U .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-W3tb2rtEUXMSsT0U .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-W3tb2rtEUXMSsT0U .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-W3tb2rtEUXMSsT0U .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-W3tb2rtEUXMSsT0U .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-W3tb2rtEUXMSsT0U .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-W3tb2rtEUXMSsT0U .marker{fill:#333333;stroke:#333333;}#mermaid-svg-W3tb2rtEUXMSsT0U .marker.cross{stroke:#333333;}#mermaid-svg-W3tb2rtEUXMSsT0U svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-W3tb2rtEUXMSsT0U p{margin:0;}#mermaid-svg-W3tb2rtEUXMSsT0U .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-W3tb2rtEUXMSsT0U .cluster-label text{fill:#333;}#mermaid-svg-W3tb2rtEUXMSsT0U .cluster-label span{color:#333;}#mermaid-svg-W3tb2rtEUXMSsT0U .cluster-label span p{background-color:transparent;}#mermaid-svg-W3tb2rtEUXMSsT0U .label text,#mermaid-svg-W3tb2rtEUXMSsT0U span{fill:#333;color:#333;}#mermaid-svg-W3tb2rtEUXMSsT0U .node rect,#mermaid-svg-W3tb2rtEUXMSsT0U .node circle,#mermaid-svg-W3tb2rtEUXMSsT0U .node ellipse,#mermaid-svg-W3tb2rtEUXMSsT0U .node polygon,#mermaid-svg-W3tb2rtEUXMSsT0U .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-W3tb2rtEUXMSsT0U .rough-node .label text,#mermaid-svg-W3tb2rtEUXMSsT0U .node .label text,#mermaid-svg-W3tb2rtEUXMSsT0U .image-shape .label,#mermaid-svg-W3tb2rtEUXMSsT0U .icon-shape .label{text-anchor:middle;}#mermaid-svg-W3tb2rtEUXMSsT0U .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-W3tb2rtEUXMSsT0U .rough-node .label,#mermaid-svg-W3tb2rtEUXMSsT0U .node .label,#mermaid-svg-W3tb2rtEUXMSsT0U .image-shape .label,#mermaid-svg-W3tb2rtEUXMSsT0U .icon-shape .label{text-align:center;}#mermaid-svg-W3tb2rtEUXMSsT0U .node.clickable{cursor:pointer;}#mermaid-svg-W3tb2rtEUXMSsT0U .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-W3tb2rtEUXMSsT0U .arrowheadPath{fill:#333333;}#mermaid-svg-W3tb2rtEUXMSsT0U .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-W3tb2rtEUXMSsT0U .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-W3tb2rtEUXMSsT0U .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-W3tb2rtEUXMSsT0U .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-W3tb2rtEUXMSsT0U .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-W3tb2rtEUXMSsT0U .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-W3tb2rtEUXMSsT0U .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-W3tb2rtEUXMSsT0U .cluster text{fill:#333;}#mermaid-svg-W3tb2rtEUXMSsT0U .cluster span{color:#333;}#mermaid-svg-W3tb2rtEUXMSsT0U div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-W3tb2rtEUXMSsT0U .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-W3tb2rtEUXMSsT0U rect.text{fill:none;stroke-width:0;}#mermaid-svg-W3tb2rtEUXMSsT0U .icon-shape,#mermaid-svg-W3tb2rtEUXMSsT0U .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-W3tb2rtEUXMSsT0U .icon-shape p,#mermaid-svg-W3tb2rtEUXMSsT0U .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-W3tb2rtEUXMSsT0U .icon-shape rect,#mermaid-svg-W3tb2rtEUXMSsT0U .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-W3tb2rtEUXMSsT0U .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-W3tb2rtEUXMSsT0U .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-W3tb2rtEUXMSsT0U :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-W3tb2rtEUXMSsT0U .startEnd>*{fill:#ffebee!important;stroke:#c62828!important;stroke-width:2px!important;color:#b71c1c!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .startEnd span{fill:#ffebee!important;stroke:#c62828!important;stroke-width:2px!important;color:#b71c1c!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .startEnd tspan{fill:#b71c1c!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .process>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .process span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .process tspan{fill:#0d47a1!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .file>*{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .file span{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .file tspan{fill:#f57f17!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .output>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .output span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-W3tb2rtEUXMSsT0U .output tspan{fill:#1b5e20!important;}

    Agent 启动

    ContextBuilder上下文构建器

    加载 Bootstrap 文件

    SYSTEM.md

    MEMORY_GUIDE.md

    SOUL.md

    AGENT_CONFIG.md

    加载常驻技能

    SkillsLoader技能加载器

    生成能力信息

    CapabilitiesBuilder能力构建器

    CAPABILITIES.md

    组装提示词

    注入运行时信息时间/平台/Python版本

    完整系统提示

    发送给 LLM

    能力信息自动生成

    CapabilitiesBuilder 会自动生成能力说明,让 Agent "知道"自己的能力:

    #mermaid-svg-dMKY5cd7ooAa8IAH{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-dMKY5cd7ooAa8IAH .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-dMKY5cd7ooAa8IAH .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-dMKY5cd7ooAa8IAH .error-icon{fill:#552222;}#mermaid-svg-dMKY5cd7ooAa8IAH .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-dMKY5cd7ooAa8IAH .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-dMKY5cd7ooAa8IAH .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-dMKY5cd7ooAa8IAH .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-dMKY5cd7ooAa8IAH .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-dMKY5cd7ooAa8IAH .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-dMKY5cd7ooAa8IAH .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-dMKY5cd7ooAa8IAH .marker{fill:#333333;stroke:#333333;}#mermaid-svg-dMKY5cd7ooAa8IAH .marker.cross{stroke:#333333;}#mermaid-svg-dMKY5cd7ooAa8IAH svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-dMKY5cd7ooAa8IAH p{margin:0;}#mermaid-svg-dMKY5cd7ooAa8IAH .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-dMKY5cd7ooAa8IAH .cluster-label text{fill:#333;}#mermaid-svg-dMKY5cd7ooAa8IAH .cluster-label span{color:#333;}#mermaid-svg-dMKY5cd7ooAa8IAH .cluster-label span p{background-color:transparent;}#mermaid-svg-dMKY5cd7ooAa8IAH .label text,#mermaid-svg-dMKY5cd7ooAa8IAH span{fill:#333;color:#333;}#mermaid-svg-dMKY5cd7ooAa8IAH .node rect,#mermaid-svg-dMKY5cd7ooAa8IAH .node circle,#mermaid-svg-dMKY5cd7ooAa8IAH .node ellipse,#mermaid-svg-dMKY5cd7ooAa8IAH .node polygon,#mermaid-svg-dMKY5cd7ooAa8IAH .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-dMKY5cd7ooAa8IAH .rough-node .label text,#mermaid-svg-dMKY5cd7ooAa8IAH .node .label text,#mermaid-svg-dMKY5cd7ooAa8IAH .image-shape .label,#mermaid-svg-dMKY5cd7ooAa8IAH .icon-shape .label{text-anchor:middle;}#mermaid-svg-dMKY5cd7ooAa8IAH .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-dMKY5cd7ooAa8IAH .rough-node .label,#mermaid-svg-dMKY5cd7ooAa8IAH .node .label,#mermaid-svg-dMKY5cd7ooAa8IAH .image-shape .label,#mermaid-svg-dMKY5cd7ooAa8IAH .icon-shape .label{text-align:center;}#mermaid-svg-dMKY5cd7ooAa8IAH .node.clickable{cursor:pointer;}#mermaid-svg-dMKY5cd7ooAa8IAH .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-dMKY5cd7ooAa8IAH .arrowheadPath{fill:#333333;}#mermaid-svg-dMKY5cd7ooAa8IAH .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-dMKY5cd7ooAa8IAH .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-dMKY5cd7ooAa8IAH .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-dMKY5cd7ooAa8IAH .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-dMKY5cd7ooAa8IAH .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-dMKY5cd7ooAa8IAH .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-dMKY5cd7ooAa8IAH .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-dMKY5cd7ooAa8IAH .cluster text{fill:#333;}#mermaid-svg-dMKY5cd7ooAa8IAH .cluster span{color:#333;}#mermaid-svg-dMKY5cd7ooAa8IAH div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-dMKY5cd7ooAa8IAH .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-dMKY5cd7ooAa8IAH rect.text{fill:none;stroke-width:0;}#mermaid-svg-dMKY5cd7ooAa8IAH .icon-shape,#mermaid-svg-dMKY5cd7ooAa8IAH .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-dMKY5cd7ooAa8IAH .icon-shape p,#mermaid-svg-dMKY5cd7ooAa8IAH .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-dMKY5cd7ooAa8IAH .icon-shape rect,#mermaid-svg-dMKY5cd7ooAa8IAH .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-dMKY5cd7ooAa8IAH .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-dMKY5cd7ooAa8IAH .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-dMKY5cd7ooAa8IAH :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-dMKY5cd7ooAa8IAH .config>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-dMKY5cd7ooAa8IAH .config span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-dMKY5cd7ooAa8IAH .config tspan{fill:#0d47a1!important;}#mermaid-svg-dMKY5cd7ooAa8IAH .build>*{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-dMKY5cd7ooAa8IAH .build span{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-dMKY5cd7ooAa8IAH .build tspan{fill:#f57f17!important;}#mermaid-svg-dMKY5cd7ooAa8IAH .output>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-dMKY5cd7ooAa8IAH .output span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-dMKY5cd7ooAa8IAH .output tspan{fill:#1b5e20!important;}

    MCP 配置

    CapabilitiesBuilder

    工具列表

    通道配置

    CAPABILITIES.md能力说明

    扩展指南如何添加 MCP/技能

    生成的 CAPABILITIES.md 包含:

  • MCP 服务器状态 — 已配置的服务器列表、启用/禁用状态
  • MCP 工具列表 — 按服务器分组的可用工具
  • 通道配置 — LangBot 连接状态
  • 扩展指南 — 如何添加新的 MCP 服务器和技能
  • 热加载机制

    Agent

    ContextBuilder

    文件系统

    用户

    Agent

    ContextBuilder

    文件系统

    用户

    #mermaid-svg-L5R6PZmCOIKeLBxx{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-L5R6PZmCOIKeLBxx .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-L5R6PZmCOIKeLBxx .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-L5R6PZmCOIKeLBxx .error-icon{fill:#552222;}#mermaid-svg-L5R6PZmCOIKeLBxx .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-L5R6PZmCOIKeLBxx .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-L5R6PZmCOIKeLBxx .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-L5R6PZmCOIKeLBxx .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-L5R6PZmCOIKeLBxx .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-L5R6PZmCOIKeLBxx .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-L5R6PZmCOIKeLBxx .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-L5R6PZmCOIKeLBxx .marker{fill:#333333;stroke:#333333;}#mermaid-svg-L5R6PZmCOIKeLBxx .marker.cross{stroke:#333333;}#mermaid-svg-L5R6PZmCOIKeLBxx svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-L5R6PZmCOIKeLBxx p{margin:0;}#mermaid-svg-L5R6PZmCOIKeLBxx .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-L5R6PZmCOIKeLBxx text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-L5R6PZmCOIKeLBxx .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-L5R6PZmCOIKeLBxx .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-L5R6PZmCOIKeLBxx .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-L5R6PZmCOIKeLBxx .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-L5R6PZmCOIKeLBxx #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-L5R6PZmCOIKeLBxx .sequenceNumber{fill:white;}#mermaid-svg-L5R6PZmCOIKeLBxx #sequencenumber{fill:#333;}#mermaid-svg-L5R6PZmCOIKeLBxx #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-L5R6PZmCOIKeLBxx .messageText{fill:#333;stroke:none;}#mermaid-svg-L5R6PZmCOIKeLBxx .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-L5R6PZmCOIKeLBxx .labelText,#mermaid-svg-L5R6PZmCOIKeLBxx .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-L5R6PZmCOIKeLBxx .loopText,#mermaid-svg-L5R6PZmCOIKeLBxx .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-L5R6PZmCOIKeLBxx .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-L5R6PZmCOIKeLBxx .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-L5R6PZmCOIKeLBxx .noteText,#mermaid-svg-L5R6PZmCOIKeLBxx .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-L5R6PZmCOIKeLBxx .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-L5R6PZmCOIKeLBxx .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-L5R6PZmCOIKeLBxx .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-L5R6PZmCOIKeLBxx .actorPopupMenu{position:absolute;}#mermaid-svg-L5R6PZmCOIKeLBxx .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-L5R6PZmCOIKeLBxx .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-L5R6PZmCOIKeLBxx .actor-man circle,#mermaid-svg-L5R6PZmCOIKeLBxx line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-L5R6PZmCOIKeLBxx :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

    文件修改时间更新

    发现文件已更新

    编辑 SYSTEM.md

    发送新消息

    构建系统提示

    检查文件修改时间

    重新加载 Bootstrap

    返回新提示词

    使用新行为响应

    核心特性:

    特性说明
    用户可定制 编辑 Bootstrap 文件即可自定义 Agent 行为
    Agent 可调整 Agent 可通过 write_file 工具修改自身提示词
    立即生效 修改后下次对话自动加载,无需重启服务
    智能缓存 基于文件修改时间的缓存机制,避免重复构建
    使用示例

    用户自定义 Agent 性格:

    # 编辑 SOUL.md 文件
    echo "你是一个幽默风趣的助手,喜欢用比喻来解释复杂概念。" > ~/.finchbot/workspace/bootstrap/SOUL.md

    # 下次对话立即生效

    Agent 自主优化提示词:

    用户: 你回复太啰嗦了,简洁一点

    Agent: 好的,我会调整我的回复风格。
    [调用 write_file 工具更新 SOUL.md]
    ✅ 已更新我的行为配置,以后会更简洁。

    5. 通道系统:多平台消息支持

    FinchBot 集成 LangBot 实现生产级多平台消息支持。

    LangBot 集成

    为什么选择 LangBot?

    • 15k+ GitHub Stars,活跃维护
    • 支持 12+ 平台:QQ、微信、企业微信、飞书、钉钉、Discord、Telegram、Slack、LINE、KOOK、Satori
    • 内置 WebUI,可视化配置
    • 插件生态,支持 MCP 等扩展

    #mermaid-svg-uiDRkHPONJFhrum3{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-uiDRkHPONJFhrum3 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-uiDRkHPONJFhrum3 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-uiDRkHPONJFhrum3 .error-icon{fill:#552222;}#mermaid-svg-uiDRkHPONJFhrum3 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-uiDRkHPONJFhrum3 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-uiDRkHPONJFhrum3 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-uiDRkHPONJFhrum3 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-uiDRkHPONJFhrum3 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-uiDRkHPONJFhrum3 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-uiDRkHPONJFhrum3 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-uiDRkHPONJFhrum3 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-uiDRkHPONJFhrum3 .marker.cross{stroke:#333333;}#mermaid-svg-uiDRkHPONJFhrum3 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-uiDRkHPONJFhrum3 p{margin:0;}#mermaid-svg-uiDRkHPONJFhrum3 .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-uiDRkHPONJFhrum3 .cluster-label text{fill:#333;}#mermaid-svg-uiDRkHPONJFhrum3 .cluster-label span{color:#333;}#mermaid-svg-uiDRkHPONJFhrum3 .cluster-label span p{background-color:transparent;}#mermaid-svg-uiDRkHPONJFhrum3 .label text,#mermaid-svg-uiDRkHPONJFhrum3 span{fill:#333;color:#333;}#mermaid-svg-uiDRkHPONJFhrum3 .node rect,#mermaid-svg-uiDRkHPONJFhrum3 .node circle,#mermaid-svg-uiDRkHPONJFhrum3 .node ellipse,#mermaid-svg-uiDRkHPONJFhrum3 .node polygon,#mermaid-svg-uiDRkHPONJFhrum3 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-uiDRkHPONJFhrum3 .rough-node .label text,#mermaid-svg-uiDRkHPONJFhrum3 .node .label text,#mermaid-svg-uiDRkHPONJFhrum3 .image-shape .label,#mermaid-svg-uiDRkHPONJFhrum3 .icon-shape .label{text-anchor:middle;}#mermaid-svg-uiDRkHPONJFhrum3 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-uiDRkHPONJFhrum3 .rough-node .label,#mermaid-svg-uiDRkHPONJFhrum3 .node .label,#mermaid-svg-uiDRkHPONJFhrum3 .image-shape .label,#mermaid-svg-uiDRkHPONJFhrum3 .icon-shape .label{text-align:center;}#mermaid-svg-uiDRkHPONJFhrum3 .node.clickable{cursor:pointer;}#mermaid-svg-uiDRkHPONJFhrum3 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-uiDRkHPONJFhrum3 .arrowheadPath{fill:#333333;}#mermaid-svg-uiDRkHPONJFhrum3 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-uiDRkHPONJFhrum3 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-uiDRkHPONJFhrum3 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-uiDRkHPONJFhrum3 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-uiDRkHPONJFhrum3 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-uiDRkHPONJFhrum3 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-uiDRkHPONJFhrum3 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-uiDRkHPONJFhrum3 .cluster text{fill:#333;}#mermaid-svg-uiDRkHPONJFhrum3 .cluster span{color:#333;}#mermaid-svg-uiDRkHPONJFhrum3 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-uiDRkHPONJFhrum3 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-uiDRkHPONJFhrum3 rect.text{fill:none;stroke-width:0;}#mermaid-svg-uiDRkHPONJFhrum3 .icon-shape,#mermaid-svg-uiDRkHPONJFhrum3 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-uiDRkHPONJFhrum3 .icon-shape p,#mermaid-svg-uiDRkHPONJFhrum3 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-uiDRkHPONJFhrum3 .icon-shape rect,#mermaid-svg-uiDRkHPONJFhrum3 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-uiDRkHPONJFhrum3 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-uiDRkHPONJFhrum3 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-uiDRkHPONJFhrum3 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}#mermaid-svg-uiDRkHPONJFhrum3 .bus>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-uiDRkHPONJFhrum3 .bus span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;color:#0d47a1!important;}#mermaid-svg-uiDRkHPONJFhrum3 .bus tspan{fill:#0d47a1!important;}#mermaid-svg-uiDRkHPONJFhrum3 .manager>*{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-uiDRkHPONJFhrum3 .manager span{fill:#fff9c4!important;stroke:#fbc02d!important;stroke-width:2px!important;color:#f57f17!important;}#mermaid-svg-uiDRkHPONJFhrum3 .manager tspan{fill:#f57f17!important;}#mermaid-svg-uiDRkHPONJFhrum3 .channel>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-uiDRkHPONJFhrum3 .channel span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;color:#1b5e20!important;}#mermaid-svg-uiDRkHPONJFhrum3 .channel tspan{fill:#1b5e20!important;}

    支持平台

    QQ

    微信

    飞书

    钉钉

    Discord

    Telegram

    Slack

    FinchBotAgent 核心

    LangBot平台层

    # 安装 LangBot
    uvx langbot

    # 访问 WebUI http://localhost:5300
    # 配置你的平台并连接到 FinchBot

    更多详情请参阅 LangBot 文档。


    链接

    • 项目地址:GitHub – FinchBot | Gitee – FinchBot
    • 文档:FinchBot 文档
    • 问题反馈:GitHub Issues

    如果对你有帮助,请给个 Star⭐,支持一下!

    赞(0)
    未经允许不得转载:171主机测评 » 【开源发布】FinchBot (雀翎) — 当 AI 说“让我想办法“,而不是“我不会“(已获Gitee官方推荐)
    分享到: 更多 (0)

    评论 抢沙发

    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址