Skip to content

Grok with tavily#19

Open
yuhxuiao wants to merge 27 commits intoGuDaStudio:grok-with-tavilyfrom
yuhxuiao:grok-with-tavily
Open

Grok with tavily#19
yuhxuiao wants to merge 27 commits intoGuDaStudio:grok-with-tavilyfrom
yuhxuiao:grok-with-tavily

Conversation

@yuhxuiao
Copy link

No description provided.

GuDaStudio and others added 26 commits February 4, 2026 14:23
…arkdown自动重试与递增waitFor策略;新增FIRECRAWL_API_URL和FIRECRAWL_API_KEY环境变量配置;搜索prompt优化及时间上下文始终注入;同步更新README。
…,Firecrawl占70%配额、Tavily占30%;新增extra_sources参数控制额外信源数量(默认20,设0禁用);单信源失败不影响其他结果;utils新增format_extra_sources格式化函数,按来源分组并去重URL。
…度评估→查询分解→策略规划→工具选择→执行排序六阶段结构化思考;complexity level自适应控制所需阶段数(L1仅需3阶段,L2需5阶段,L3全部6阶段);支持session跨调用状态追踪、phase revision覆写及计划完成时自动汇总executable_plan;新建planning.py独立模块含7个Pydantic结构化产出模型与PlanningEngine状态管理引擎。
…earchTerm.term增加冗余同义词警告、purpose约束为单一sub-query ID禁止合并、round补充多轮语义说明;tool description Phase 3新增单一分解轴原则防止双轴交叉产生重叠矩阵;anti-patterns改为6组正反对照示例;phases_remaining按流程序输出替代字母序。
…tune 500);Phase 1说明追加unverified_terms识别指引;Phase 3追加前置规则要求将未验证术语转化为前置子查询,禁止从训练数据硬编码假定值。
…RL。将extra_sources参数默认值更新为10并优化Firecrawl计数计算。在GrokSearchProvider中实现异步URL描述与排序方法以提升结果相关性。
- New conversation.py: ConversationManager with session tracking, expiration, and history
- Modified grok.py: search() now accepts history parameter for multi-turn messages
- Modified server.py: web_search tool gains follow_up and conversation_id params
- Returns conversation_id for follow-up, tracks search_count per session
- Configurable via GROK_SESSION_TIMEOUT, GROK_MAX_SESSIONS, GROK_MAX_SEARCHES env vars
P0: Add .gitignore to prevent .env/cache/test artifacts from being tracked
P0: Add .env.example with placeholder values
P1: Fix extra_sources split - Tavily now gets fair share when both providers available
P1: Conditional time injection - only for time-sensitive queries
P1: Remove duplicate search_prompt from single-turn user message
- web_search: add follow_up/conversation_id params, actual dict return example
- get_sources: add actual JSON return example with Tavily sources
- web_fetch: document string return type
- web_map: add actual JSON return example
- Add 3 session config env vars (GROK_SESSION_TIMEOUT/MAX_SESSIONS/MAX_SEARCHES)
- Add notes about sources behavior (Grok inline citations vs Tavily structured URLs)
- web_search: removed follow_up/conversation_id params, returns conversation_id for optional followup
- search_followup: new tool for conversation-based follow-up questions
- search_reflect: new tool with reflection loop + cross-validation (hard budgets: max 3 reflections, 30s/round, 120s total)
- reflect.py: ReflectEngine with safety prompts (untrusted data handling)
- Unified error return structure: {error, message}
- README updated with new tool docs
P0: add skip_search_prompt to GrokSearchProvider.search()
P0: rewrite reflect.py with round_sessions for source traceability
P0: hard budget (asyncio.wait_for) on all search calls in reflect
P1: executor passes conversation_id to reuse sessions
P1: unified error returns (session_id/conversation_id/content/sources_count)
P1: sync docs/README_EN.md with new tools (8->10)
P2: .gitignore add test_new_tools_output.json
P2: remove test scripts from repo
- 架构图:扩展为6个工具(新增search_followup/search_reflect/search_planning)
- search_planning:从1行扩展为完整文档(参数表、6阶段说明、返回值示例)
- 新增「推荐工具链流程」章节(planning→search→followup→reflect→sources)
- FAQ新增:信源分离在第三方API的行为说明、search_planning零API调用说明
- 英文README:补齐5个缺失环境变量(FIRECRAWL_*、SESSION_*)
- server.py:增强web_search/search_reflect/search_planning的description
  - web_search:引导AI优先使用search_planning规划复杂查询
  - search_reflect:标注在工具链中的位置
  - search_planning:tool_selection阶段新增search_followup和search_reflect选项
@Nick-Hogo
Copy link
Collaborator

看了一下,修改的地方太多了,tavily后续会支持。
如果希望通过PR的话建议说明一下希望支持的功能,系统提示词等不必要的地方建议不要做太大的修改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants