Skip to content

实现类似 Airtable 的数据对话 Chatbot 全栈开发任务清单 #1015

@hotlong

Description

@hotlong

目标

开发一个支持自然语言与业务数据对话的 Chatbot,效果对标 Airtable Copilot,用户可用自然语言问业务数据,AI 能理解表结构、查数据、分析统计并结构化友好回复。

Airtable Copilot 对话 Demo

开发任务拆解

1. Tool Call Loop(AIService 核心增强,P0)

  • 实现完整的 LLM-Tool 调用链路:
    • AIService.chatWithTools: 自动注入 ToolRegistry 工具集合
    • LLM 返回 tool_calls 时,自动调用 ToolRegistry 的 handler 并将结果以 role:tool 消息追加
    • 回传给 LLM,实现���轮 tool-calling,最后生成最终回复
  • 支持最大循环轮数,防止死循环
  • 单元测试覆盖 tool call 循环、异常处理、边界场景

2. 平台级内置数据工具(Data Tool,P0)

  • query_records: 按条件查表
  • get_record: 单条详情
  • describe_object: 查询表结构
  • aggregate_data: 聚合/统计
  • list_objects: 列表所有表
  • 工具参数、权限校验、分页/限制
  • handler 实现对接元数据和数据服务

3. Agent Runtime(P1)

  • Agent 元数据加载/校验
  • Agent → system prompt 自动注入
  • Agent → model 参数,tools 自动注入 option
  • Agent.tools 结合 ToolRegistry 做映射
  • 上下文增强(自动结合用户当前表、视图、选中的数据记录)

4. Agent Chat API 路由(P1)

  • 新增 /api/v1/ai/agents/:agentName/chat 支持 context、Agent 选择
  • 支持上下文参数 objectName、recordId、viewName
  • 错误处理:Agent 未找到/不活跃/无权限

5. Data Tool 自动注册与插件化集成(P1)

  • 通过 ai:ready hook 自动注册内置数据工具
  • 支持多数据源/多租户 context

6. 数据对话 Agent 规格(P2)

  • data_chat Agent 说明书、role/instructions、工具声明
  • guardrails、maxToken、权限策略
  • 极简 UI 文案和答复格式建议

7. 完善单测集成测试(P2)

  • Agent、Tool、API 端到端测试
  • 异常与边界 case

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions