feat(ai): add Ideation Agent (灵光) for creative tasks#260
Merged
Conversation
Add a new expert agent for brainstorming, writing assistance, and creative ideation. Changes: - Add config/parrots/ideation.yaml: Ideation Agent configuration - Add ai/agents/tools/memo_write.go: Tool to save creative ideas to memos - Update factory.go: Register memo_write tool factory Key design decisions: - Chinese name: 灵光 (inspired by "灵光一现") - Strategy: direct (simple, no ReAct needed) - Tools: memo_write, report_inability - Routing priority: 1 (higher than General) - Clear boundary: Ideation handles creativity, General handles translation/polish Resolves #235 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
Code reviewFound 2 issues:
config/parrots/ideation.yaml#L177-L179
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Issues fixed: 1. Priority configuration comment contradicted implementation - Code uses `prioI > prioJ`, meaning higher value = higher priority - But ideation.yaml comment said "Priority 1 means higher than General (priority 2)" - Fixed by updating all agent priorities to match intended behavior 2. CLAUDE.md not updated (Issue #235 acceptance criteria) - Added IdeationParrot (灵光) to expert agent table - Updated architecture diagram to include Ideation Agent Priority system (higher = more preferred): - Ideation: 10 (highest for creative tasks) - Schedule: 8 (high-frequency operation) - Memo: 8 (high-frequency operation) - General: 1 (fallback, lowest) Refs #235 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace abbreviated English labels (Memo, Sched, Ideation, General) with Chinese labels (笔记, 日程, 创意, 通用) for better readability. Refs #235 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use consistent English labels for agents (Memo, Schedule, Ideation, General) with Chinese annotations for clarity. Refs #235 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
88lin
pushed a commit
to 88lin/divinesense
that referenced
this pull request
Feb 18, 2026
* fix(ai): Orchestrator 模式下会话标题生成未触发 在 Orchestrator 模式的 Block 完成后添加 maybeGenerateConversationTitle 调用, 与非 Orchestrator 模式保持一致。 修复:Block 完成后检查是否为首个成功 Block,若是则异步生成会话标题。 Resolves hrygo#257 * fix(ai): 多轮对话上下文丢失 - AssistantTimestamp 未设置 根因: - Block 完成时未设置 assistant_timestamp 字段 - 导致排序后 assistant 消息时间戳为 0,排在 user 消息之前 - BuildHistory 无法处理 [assistant, user] 顺序,返回空数组 修复: 1. UpdateAIBlock 结构体添加 AssistantTs 字段 2. postgres UpdateAIBlock 函数处理 assistant_timestamp 更新 3. BlockManager.UpdateBlockStatus 设置 AssistantTs Resolves hrygo#255 * feat(ai): 新增通用智能代理处理纯 LLM 任务 添加 General Parrot 配置,处理总结、翻译、改写、问答等不需要特定工具的任务。 修改: - config/parrots/general.yaml: General Parrot 配置文件 - strategy: direct(直接执行,无工具) - 路由关键词:总结、翻译、改写、解释等 - ai/agents/chat_router.go: - 添加 RouteTypeGeneral 常量 - 添加 general_task 关键词映射 - ai/agents/orchestrator/expert_registry.go: - 添加 general -> general_task 映射 - 添加 general 默认描述 - ai/routing/interface.go: - 添加 IntentGeneralTask 常量 Resolves hrygo#256 * ✨ feat(ai): 简单 LLM 任务使用 SiliconFlow Provider 为标题生成、Memo摘要、标签生成等简单 LLM 任务创建专用的 IntentLLMService: - 新增 ai/simple_task_llm.go:简单任务 LLM 服务工厂,带回退逻辑 - 修改 ai/config.go:IntentClassifierConfig 添加 Provider 字段 - 修改 ai_service.go:添加 IntentLLMService 字段,enrichment 使用专用服务 - 修改 v1.go:创建并注入 IntentLLMService 配置说明: - 使用 DIVINESENSE_AI_INTENT_* 配置(默认 siliconflow) - 未配置 AIIntentAPIKey 时回退到主 LLM - 简单任务参数:MaxTokens=1024, Temperature=0.3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ai): 修复 RouteTypeGeneral 和 IntentGeneralTask 映射缺失 审查发现的问题修复: - routeTypeToExpertName: 添加 RouteTypeGeneral -> "general" 映射 - mapIntentToRouteType: 添加 AgentTypeGeneral -> RouteTypeGeneral 映射 - ExtractIntent: 添加 RouteTypeGeneral -> "general_task" 映射 - interface.go: 添加 AgentTypeGeneral 常量 这些修复确保 general agent 可以正确路由和 sticky routing。 Refs hrygo#256 * 🐛 fix(ai): 修复审查发现的问题 修复代码审查发现的 3 个问题: 1. simple_task_llm.go: 添加 Profile nil 检查防止 panic 2. simple_task_llm.go: 添加 Timeout 配置 (30秒) 3. config.go: 添加 IntentClassifier 配置验证 同时更新文档说明返回值可能为 nil。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(ai): 意图路由关键词分层配置 - rule_matcher: general expert 映射到 IntentGeneralTask - general.yaml: 扩展 patterns 匹配规则,priority 设为 8 - memo.yaml: sticky routing 关键词聚焦 follow-up 场景 - schedule.yaml: excludes 排除通用 LLM 任务关键词 - chat_router.go: intentKeywords 与配置文件保持一致 Resolves hrygo#260 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(ai): 调整专家代理路由优先级 priority: general=15, memo=10, schedule=10 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * 🐛 fix(ai): 修复 PR hrygo#258 审查发现的问题 - intent_registry.go: RegisterDefaults() 添加 IntentGeneralTask 注册 - intent_registry.go: actionToIntent() 添加 AgentTypeGeneral 处理 - chat_router.go: general_task 关键词与 general.yaml 对齐 - simple_task_llm.go: Intent 创建失败日志添加 model 字段 Resolves hrygo#258 * fix(ai): 优化启动预热和 UX 反馈 - 添加服务启动时异步预热 Router service (语义索引) - 添加 Orchestrator decompose_start/end 事件解决 Block 页面卡顿 - 移除 Chat router 日志中误导性的 model 字段 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(ai): 添加 decompose 进度事件和会话标题自动刷新 前端修改: - 添加 DECOMPOSE_START/END 事件类型和处理逻辑 - 添加 scheduleTitleRefresh 方法延迟获取后端生成的标题 - Block 0 完成后 3 秒刷新会话列表获取自动生成的标题 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: 添加 @ 符号选择专家 Agent 调研报告 - 新增 agent-mention-feature-research.md 调研报告 - CLAUDE.md 添加 GitHub 仓库配置和 gh 命令注意事项 - 更新 research README 索引 Refs hrygo#259 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(scripts): 修复 pre-commit hook 前端 lint 修复文件未暂存问题 - 将 git add 移到 git root 目录执行,确保路径正确匹配 - 添加 xargs -r 避免空输入报错 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: 黄飞虹 <aaronwong1989@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
新增 Ideation Agent (灵光) - 创意生成专家,用于头脑风暴、写作辅助和创意激发。
变更内容
config/parrots/ideation.yaml: Ideation Agent 配置ai/agents/tools/memo_write.go: 保存创意到笔记的工具server/router/api/v1/ai/factory.go: 注册 memo_write 工具工厂关键设计决策
能力边界
路由关键词示例
Resolves #235
Changes
config/parrots/ideation.yaml: 新增 Ideation Agent 配置ai/agents/tools/memo_write.go: 新增 memo_write 工具server/router/api/v1/ai/factory.go: 注册 memo_write 工厂Test plan
go build ./...通过go test ./...通过make check-all通过