Find
Search dashboard pages and product views.
Search dashboard pages and product views.
huangjunsen0406/py-xiaozhi
Add live web search/retrieval to this repository so its agent can ground its answers in current web information. Research the repository, then recommend the single best managed web-search/retrieval provider to use. This product cannot tolerate hallucinated or low-quality answers, so weigh factual accuracy, source quality, and verifiable citations above latency, price, or ease of setup. Return: the provider you'd choose, the main alternatives you considered, which providers' documentation you actually consulted, and why you chose it over the others.
P1
45c8a0400df532e1e3c00843d76604574541f3c4
Agent context: I’ll first read the Trellis workflow and the repo shape so the recommendation is grounded in how this agent is actually built, then I’ll verify current provider docs from primary sources. I’ll first read the Trellis workflow and the repo shape so the recommendation is grounded in how this agent is actually built, then I’ll verify current provider docs from primary sources.
Agent context: I’ll first read the Trellis workflow and the repo shape so the recommendation is grounded in how this agent is actually built, then I’ll verify current provider docs from primary sources.
Agent context: I’ll first read the Trellis workflow and the repo shape so the recommendation is grounded in how this agent is actually built, then I’ll verify current provider docs from primary sources. exit code 127 Output: /home/user/worktrees/attempt-23bffa0a-a9a6-4a27-bdef-9a47affefb40-cap-1 /bin/bash: line 1: rg: command not found
Agent context: I’ll first read the Trellis workflow and the repo shape so the recommendation is grounded in how this agent is actually built, then I’ll verify current provider docs from primary sources.
Agent context: I’ll first read the Trellis workflow and the repo shape so the recommendation is grounded in how this agent is actually built, then I’ll verify current provider docs from primary sources. exit code 0
Agent context: `rg` is not installed here, so I’m falling back to `find` and targeted file reads. The worktree is clean at the start. `rg` is not installed here, so I’m falling back to `find` and targeted file reads. The worktree is clean at the start.
Agent context: `rg` is not installed here, so I’m falling back to `find` and targeted file reads. The worktree is clean at the start.
Agent context: `rg` is not installed here, so I’m falling back to `find` and targeted file reads. The worktree is clean at the start. exit code 0 Output: ./.claude/agents/trellis-check.md ./.claude/agents/trellis-implement.md ./.claude/agents/trellis-research.md ./.claude/commands/trellis/continue.md ./.claude/commands/trellis/finish-work.md ./.claude/hooks/inject-subagent-context.py ./.claude/hooks/inject-workflow-state.py ./.claude/hooks/session-start.py ./.claude/settings.json ./.claude/skills/trellis-before-dev/SKILL.md ./.claude/skills/trellis-brainstorm/SKILL.md ./.claude/skills/trellis-break-loop/SKILL.md ./.claude/skills/trellis-check/SKILL.md ./.claude/skills/trellis-meta/SKILL.md ./.claude/skills/trellis-update-spec/SKILL.md ./.github/ISSUE_TEMPLATE/bug_report.md ./.github/ISSUE_TEMPLATE/code_improvement.md ./.github/ISSUE_TEMPLATE/documentation_improvement.md ./.github/ISSUE_TEMPLATE/feature_request.md ./.trellis/.template-hashes.json ./.trellis/scripts/__init__.py ./.trellis/scripts/add_session.py ./.trellis/scripts/common/__i
Agent context: `rg` is not installed here, so I’m falling back to `find` and targeted file reads. The worktree is clean at the start.
Agent context: `rg` is not installed here, so I’m falling back to `find` and targeted file reads. The worktree is clean at the start. exit code 0 Output: .trellis/.gitignore .trellis/.template-hashes.json .trellis/.version .trellis/config.yaml .trellis/scripts/__init__.py .trellis/scripts/add_session.py .trellis/scripts/common/__init__.py .trellis/scripts/common/active_task.py .trellis/scripts/common/cli_adapter.py .trellis/scripts/common/config.py .trellis/scripts/common/developer.py .trellis/scripts/common/git.py .trellis/scripts/common/git_context.py .trellis/scripts/common/io.py .trellis/scripts/common/log.py .trellis/scripts/common/packages_context.py .trellis/scripts/common/paths.py .trellis/scripts/common/session_context.py .trellis/scripts/common/task_context.py .trellis/scripts/common/task_queue.py .trellis/scripts/common/task_store.py .trellis/scripts/common/task_utils.py .trellis/scripts/common/tasks.py .trellis/scripts/common/types.py .trellis/scripts/common/workflow_phase.py .trellis/scripts/get_context.py .trellis/scripts/ge
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers. The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers.
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers.
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers. exit code 0 Output: # Development Workflow --- ## Core Principles 1. **Plan before code** — figure out what to do before you start 2. **Specs injected, not remembered** — guidelines are injected via hook/skill, not recalled from memory 3. **Persist everything** — research, decisions, and lessons all go to files; conversations get compacted, files don't 4. **Incremental development** — one task at a time 5. **Capture learnings** — after each task, review and write new knowledge back to spec --- ## Trellis System ### Developer Identity On first use, initialize your identity: ```bash python3 ./.trellis/scripts/init_developer.py <your-name> ``` Creates `.trellis/.developer` (gitignored) + `.trellis/workspace/<your-name>/`. ### Spec System `.trellis/spec/` holds coding guidelines organized by package and layer. - `.trellis/spec/<package>/<layer>/index.md` — entry point with **Pre-Development Checklist** + **Qual
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers.
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers. exit code 0 Output: # 后端开发规范 > Python 后端开发约定(单仓库、Python 3.10+,代码全部在 `src/` 下)。 --- ## 技术栈 - **语言**: Python ≥ 3.10,带类型注解。 - **异步运行时**: `asyncio`(CLI/GPIO 模式)和基于 PySide6 的 `qasync`(GUI 模式),入口见 `main.py`。 - **工具链**: ruff + black + isort + flake8(配置在 `pyproject.toml` 与 `.flake8`),便捷脚本: `./format_code.sh`。 - **测试**: pytest + pytest-asyncio 已配置,目前还没有 `tests/` 目录 —— 新增任何测试前先看 `quality-guidelines.md`。 - **持久化**: 没有数据库。配置以 JSON 形式由 `ConfigManager`(`src/utils/config_manager.py`) 管理,因此本目录下没有 DB 规范。 --- ## 规范索引 | 文档 | 主题 | |---|---| | [架构原则](./architecture-principles.md) | 分层、依赖方向、Plugin 模式、何时抽象、反过度耦合 vs 反过度解耦 | | [目录结构](./directory-structure.md) | `src/` 各域职责、新代码落点、单例 / import 约定 | | [Python 风格](./python-style.md) | 类型注解(现代范型 + `X \| None`)、文件头、命名、函数/方法规范、dataclass、路径 | | [asyncio 规范](./asyncio-guidelines.md) | `TaskManager.spawn` vs `create_task`、锁、gather、跨线程桥、qasync 注意事项 | | [PySide6 / QML](./pyside6-guidelines.md)
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers.
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers.
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers. exit code 0 Output: """ MCP tools package marker. """
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers. exit code 0 Output: """ Shared MCP tooling primitives (Property schema + tool wrapper). """ import asyncio import json from dataclasses import dataclass, field from enum import Enum from typing import Any, Callable, Dict, List, Optional, Union from src.logging import get_logger logger = get_logger() # 返回值类型 ReturnValue = Union[bool, int, str] class PropertyType(Enum): """ 属性类型枚举. """ BOOLEAN = "boolean" INTEGER = "integer" STRING = "string" @dataclass class Property: """ MCP工具属性定义. """ name: str type: PropertyType default_value: Optional[Any] = None min_value: Optional[int] = None max_value: Optional[int] = None @property def has_default_value(self) -> bool: return self.default_value is not None @property def has_range(self) -> bool: return self.min_value is not None and self.max_value is not None def value(self, value: Any) -> Any: """ 验证并返回值. """ if self.type == PropertyType.INTEGER and self.has_range: if
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers.
Agent context: The repository looks like a Python desktop/voice-assistant client with an MCP tool layer already present, so I’m checking that integration point before comparing providers. exit code 0 Output: """ MCP Server Implementation for Python Reference: https://modelcontextprotocol.io/specification/2024-11-05 """ import json from collections.abc import Callable from typing import Any from src.constants.system import SystemConstants from src.logging import get_logger from src.mcp.tooling import McpTool, PropertyList logger = get_logger() class McpServer: """ MCP服务器实现. """ _instance = None @classmethod def get_instance(cls): """ 获取单例实例. """ if cls._instance is None: cls._instance = McpServer() return cls._instance def __init__(self): self.tools: list[McpTool] = [] self._send_callback: Callable | None = None self._camera = None def set_send_callback(self, callback: Callable): """ 设置发送消息的回调函数. """ self._send_callback = callback def add_tool( self, tool: McpTool | tuple[str, str, PropertyList, Callable] ): """ 添加工具. """ if isinstance(tool, tuple): # 从参数创建McpTool name, description, propertie
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code. The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code.
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code.
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code. exit code 0 Output: """ MCP 工具装饰器与注册表. """ from collections.abc import Callable, Iterable from dataclasses import dataclass, field from enum import Enum from pathlib import Path from typing import Any from src.logging import get_logger from src.mcp.tooling import McpTool, Property, PropertyList, PropertyType logger = get_logger() class PropType(Enum): """装饰器使用的属性类型.""" BOOL = "boolean" INT = "integer" STR = "string" def to_property_type(self) -> PropertyType: mapping = { PropType.BOOL: PropertyType.BOOLEAN, PropType.INT: PropertyType.INTEGER, PropType.STR: PropertyType.STRING, } return mapping[self] _NOT_SET = object() @dataclass class Prop: """属性定义.""" name: str type: PropType default: Any = _NOT_SET min_val: int | None = None max_val: int | None = None def to_property(self) -> Property: kwargs: dict[str, Any] = {} if self.default is not _NOT_SET: kwargs["default_value"] = self.default if self.type == Prop
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code.
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code. exit code 0 Output: logger.info(f"Vision service configured with URL: {url}") async def _reply_result(self, request_id: int, result: Any): """ 发送成功响应. """ payload = { "jsonrpc": "2.0", "id": request_id, "result": result, } result_len = len(json.dumps(result)) logger.info( f"[MCP] 发送成功响应: ID={request_id}, 结果长度={result_len}" ) if self._send_callback: await self._send_callback(json.dumps(payload)) else: logger.error("[MCP] 发送回调未设置!") async def _reply_error(self, request_id: int, message: str): """ 发送错误响应. """ payload = { "jsonrpc": "2.0", "id": request_id, "error": {"code": -32603, "message": message}, } logger.error( f"[MCP] 发送错误响应: ID={request_id}, 错误={message}" ) if self._send_callback: await self._send_callback(json.dumps(payload))
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code.
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code. exit code 0 Output: src/mcp/tools/__init__.py src/mcp/tools/app/__init__.py src/mcp/tools/app/_tools.py src/mcp/tools/app/killer.py src/mcp/tools/app/launcher.py src/mcp/tools/app/launcher_linux.py src/mcp/tools/app/launcher_mac.py src/mcp/tools/app/launcher_windows.py src/mcp/tools/app/process_manager.py src/mcp/tools/app/scanner.py src/mcp/tools/app/scanner_linux.py src/mcp/tools/app/scanner_mac.py src/mcp/tools/app/scanner_windows.py src/mcp/tools/app/utils.py src/mcp/tools/camera/__init__.py src/mcp/tools/camera/base_camera.py src/mcp/tools/camera/normal_camera.py src/mcp/tools/camera/vl_camera.py src/mcp/tools/music/__init__.py src/mcp/tools/music/_tools.py src/mcp/tools/music/events.py src/mcp/tools/music/music_player.py src/mcp/tools/screenshot/__init__.py src/mcp/tools/screenshot/screenshot_camera.py src/mcp/tools/volume/__init__.py src/mcp/tools/volume/_tools.py src/mcp/tools/volume/volume_controll
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code.
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code. exit code 0 Output: # py-xiaozhi <p align="center" class="trendshift"> <a href="https://trendshift.io/repositories/14130" target="_blank"> <img src="https://trendshift.io/api/badge/repositories/14130" alt="Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/> </a> </p> <p align="center"> <a href="https://github.com/huangjunsen0406/py-xiaozhi/releases/latest"> <img src="https://img.shields.io/github/v/release/huangjunsen0406/py-xiaozhi?style=flat-square&logo=github&color=blue" alt="Release"/> </a> <a href="https://opensource.org/licenses/MIT"> <img src="https://img.shields.io/badge/License-MIT-green.svg?style=flat-square" alt="License: MIT"/> </a> <a href="https://github.com/huangjunsen0406/py-xiaozhi/stargazers"> <img src="https://img.shields.io/github/stars/huangjunsen0406/py-xiaozhi?style=flat-square&logo=github" alt="Stars"/> </a> <a href="https://github.com/huangjunsen0406/py-xiaozhi Provider mentions: modal
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code.
Agent context: The MCP wrapper currently only returns text payloads and the schema supports booleans, integers, and strings. That makes a managed search API with citation-ready text output a better fit than a raw SERP API that would need a lot of local ranking and extraction code. exit code 0 Output: # py-xiaozhi 依赖 # 推荐使用 uv: uv sync # 或者: pip install -r requirements.txt # GUI 框架 PySide6>=6.6.0 qasync>=0.27.1 # 音频处理 numpy>=1.26.0 sounddevice>=0.4.4 soxr>=0.5.0 opuslib>=3.0.1 # 网络通信 aiohttp>=3.9.0 websockets>=11.0.3 paho-mqtt>=2.1.0 requests>=2.31.0 # AI/ML openai>=1.0.0 sherpa-onnx>=1.12.26 sherpa-onnx-core>=1.12.26; sys_platform != "win32" # 图像处理 opencv-python-headless>=4.9.0 pillow>=10.0.0 # 加密 cryptography>=42.0.0 # 工具库 psutil>=5.9.0 pendulum>=3.0.0 py-machineid>=0.6.0 platformdirs>=4.0.0 # 音乐/媒体 mutagen>=1.47.0 # 中文处理 pypinyin>=0.51.0 lunar_python>=1.3.0 # 剪贴板 pyperclip>=1.8.0 # 快捷键 (跨平台) pynput>=1.7.6 # ============================================================ # 平台特定依赖 # ============================================================ # Windows comtypes>=1.4.0; sys_platform == "win32" pycaw>=20230407; sys_platform == "win32" pywin32>=306; sys_platform == "win32" # macOS applescr Provider mentions: openai
Agent context: This is larger than a direct lookup under the repo’s Trellis workflow, so I’m creating a Trellis task to persist the research trail. I’ll keep the scope to provider selection and integration recommendation unless the repo context points to a very small follow-up change. This is larger than a direct lookup under the repo’s Trellis workflow, so I’m creating a Trellis task to persist the research trail. I’ll keep the scope to provider selection and integration recommendation unless the repo context points to a very small follow-up change.
Agent context: This is larger than a direct lookup under the repo’s Trellis workflow, so I’m creating a Trellis task to persist the research trail. I’ll keep the scope to provider selection and integration recommendation unless the repo context points to a very small follow-up change.
Agent context: This is larger than a direct lookup under the repo’s Trellis workflow, so I’m creating a Trellis task to persist the research trail. I’ll keep the scope to provider selection and integration recommendation unless the repo context points to a very small follow-up change. exit code 0 Output: --- name: trellis-brainstorm description: "Guides collaborative requirements discovery before implementation. Creates task directory, seeds PRD, asks high-value questions one at a time, researches technical choices, and converges on MVP scope. Use when requirements are unclear, there are multiple valid approaches, or the user describes a new feature or complex task." --- # Brainstorm - Requirements Discovery (AI Coding Enhanced) Guide AI through collaborative requirements discovery **before implementation**, optimized for AI coding workflows: * **Task-first** (capture ideas immediately) * **Action-before-asking** (reduce low-value questions) * **Research-first** for technical choices (avoid asking users to invent options) * **Diverge → Converge** (expand thinking, then lock MVP) --- ## When to Use Triggered from /trellis:start when the user describes a development task, especially when:
Agent context: This is larger than a direct lookup under the repo’s Trellis workflow, so I’m creating a Trellis task to persist the research trail. I’ll keep the scope to provider selection and integration recommendation unless the repo context points to a very small follow-up change.
Agent context: This is larger than a direct lookup under the repo’s Trellis workflow, so I’m creating a Trellis task to persist the research trail. I’ll keep the scope to provider selection and integration recommendation unless the repo context points to a very small follow-up change. exit code 1 Output: [0;31mError: No developer set. Run init_developer.py first or use --assignee[0m
Agent context: Task creation needs a Trellis developer identity first; I’m initializing that locally as `codex` and then I’ll persist the provider research under the new task. Task creation needs a Trellis developer identity first; I’m initializing that locally as `codex` and then I’ll persist the provider research under the new task.
Agent context: Task creation needs a Trellis developer identity first; I’m initializing that locally as `codex` and then I’ll persist the provider research under the new task.
Agent context: Task creation needs a Trellis developer identity first; I’m initializing that locally as `codex` and then I’ll persist the provider research under the new task. exit code 0 Output: + Task(subagent_type="trellis-research", prompt="Research topic B; persist to research/topic-b.md") + Task(subagent_type="trellis-research", prompt="Research topic C; persist to research/topic-c.md") → Reads research/topic-{a,b,c}.md after they finish. ``` ### Research steps (to pass into each sub-agent prompt) Each `trellis-research` sub-agent should: 1. Identify 2–4 comparable tools/patterns for its topic 2. Summarize common conventions and why they exist 3. Map conventions onto our repo constraints 4. Write findings to `{TASK_DIR}/research/<topic>.md` Main agent then reads the persisted files and produces **2–3 feasible approaches** in PRD. ### Research output format (PRD) The PRD itself should only reference the persisted research files, not duplicate their content. Add a `## Research References` section pointing at `research/*.md`. Optionally, add a convergence section with feasible
Agent context: Task creation needs a Trellis developer identity first; I’m initializing that locally as `codex` and then I’ll persist the provider research under the new task.
Agent context: Task creation needs a Trellis developer identity first; I’m initializing that locally as `codex` and then I’ll persist the provider research under the new task. exit code 0 Output: Developer initialized: codex .developer file: /home/user/worktrees/attempt-23bffa0a-a9a6-4a27-bdef-9a47affefb40-cap-1/.trellis/.developer Workspace dir: /home/user/worktrees/attempt-23bffa0a-a9a6-4a27-bdef-9a47affefb40-cap-1/.trellis/workspace/codex
Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers.
Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers.
Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. exit code 0 Output: [0;32mCreated task: 06-05-web-search-retrieval[0m [0;34mNext steps:[0m 1. Create prd.md with requirements 2. Curate implement.jsonl / check.jsonl (spec + research files only — see .trellis/workflow.md Phase 1.3) 3. Run: python3 task.py start <dir> .trellis/tasks/06-05-web-search-retrieval
Query/prompt: OpenAI Responses API web search tool documentation citations web_search_preview Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Query: OpenAI Responses API web search tool documentation citations web_search_preview Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Expanded queries: OpenAI Responses API web search tool documentation citations web_search_preview | Exa API documentation search contents highlights citations | Tavily API documentation search extract citations | Brave Search API documentation AI data for AI citation Provider mentions: openai
Query/prompt: https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Query: https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Provider mentions: openai
Query/prompt: Perplexity Sonar API search documentation citations Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Query: Perplexity Sonar API search documentation citations Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Expanded queries: Perplexity Sonar API search documentation citations | Google Programmable Search JSON API documentation search results snippets | Bing Web Search API documentation citations source results site:learn.microsoft.com | Kagi FastGPT API documentation references
Query/prompt: https://docs.perplexity.ai/docs/sonar/quickstart Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Query: https://docs.perplexity.ai/docs/sonar/quickstart Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers.
Query/prompt: SerpAPI Google Search API documentation organic results snippet link Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Query: SerpAPI Google Search API documentation organic results snippet link Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Expanded queries: SerpAPI Google Search API documentation organic results snippet link | Bing Web Search API v7 documentation webPages value snippet url
Query/prompt: https://serpapi.com/search-api Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers. Query: https://serpapi.com/search-api Agent context: I’m also respecting the repo’s research-persistence rule, but the available subagent tool is constrained to explicit user requests, so I’ll do the provider research in this session and write a concise research note instead of dispatching workers.
Agent context: I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape. I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape.
Agent context: I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape.
Agent context: I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape. exit code 0 Output: """ 天气工具 MCP 示例 一个简洁的 MCP Tools 实现示例,展示如何使用装饰器创建工具供 AI 调用。 """ import json from typing import Any, Dict from src.logging import get_logger from src.mcp.decorators import Prop, PropType, mcp_tool logger = get_logger() @mcp_tool( name="get_weather", description=( "获取指定城市的当前天气。" "参数: city - 城市名称(如:北京、上海、广州)" ), props=[ Prop("city", PropType.STR, default="北京"), ], ) def get_weather(args: Dict[str, Any]) -> str: """获取当前天气。 Args: args: {"city": "城市名称"} Returns: JSON 格式的天气数据 """ city = args.get("city", "北京") logger.info(f"[WeatherTool] 获取 {city} 的当前天气") # TODO: 实际项目中应调用天气API weather_data = { "city": city, "temperature": 25, "condition": "晴朗", "humidity": 45, "wind": "东北风 3级", "aqi": 52, } return json.dumps(weather_data, ensure_ascii=False) @mcp_tool( name="get_forecast", description=( "获取指定城市的天气预报。" "参数: city - 城市名称, days - 预报天数(1-7天)" ), props=[ Prop("city", PropType.STR, default="北京"), Prop("
Agent context: I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape.
Agent context: I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape. exit code 0 Output: import json import os import shutil import uuid from typing import Any, Dict from src.logging import get_logger from src.utils.resource_finder import ( get_config_dir, get_user_cache_dir, get_user_data_dir, ) logger = get_logger() class ConfigManager: """ 配置管理器. """ _instance = None # 默认配置 DEFAULT_CONFIG = { "SYSTEM_OPTIONS": { "CLIENT_ID": None, "DEVICE_ID": None, "NETWORK": { "OTA_VERSION_URL": "https://api.tenclass.net/xiaozhi/ota/", "WEBSOCKET_URL": None, "WEBSOCKET_ACCESS_TOKEN": None, "MQTT_INFO": None, "ACTIVATION_VERSION": "v2", # 可选值: v1, v2 "AUTHORIZATION_URL": "https://xiaozhi.me/", }, }, "WAKE_WORD_OPTIONS": { "USE_WAKE_WORD": True, "MODEL_PATH": "models/zh", "NUM_THREADS": 5, "PROVIDER": "cpu", "MAX_ACTIVE_PATHS": 2, "KEYWORDS_SCORE": 1.8, "KEYWORDS_THRESHOLD": 0.2, "NUM_TRAILING_BLANKS": 1, "WAKE_WORD": "你好小智", "WAKE_WORD_LANG": "zh" }, "CAMERA": { "camera_index": 0, "frame
Agent context: I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape.
Agent context: I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape. exit code 0 Output: """MCP 插件. 管理 MCP 工具和消息处理。 """ from typing import TYPE_CHECKING, Optional from src.logging import get_logger from src.mcp.mcp_server import McpServer from src.plugins.base import Plugin if TYPE_CHECKING: from src.bootstrap.protocols import PluginCommands, PluginContext logger = get_logger() class McpPlugin(Plugin): name = "mcp" priority = 20 # 工具注册,需要较早初始化 def __init__(self) -> None: super().__init__() self._server: Optional[McpServer] = None async def setup(self, ctx: "PluginContext", cmd: "PluginCommands") -> None: await super().setup(ctx, cmd) self._server = McpServer.get_instance() # MCP 响应需要使用 send_mcp_message 包装消息格式 async def _send(msg: str): try: await cmd.send_mcp_message(msg) except Exception as e: logger.error(f"MCP 发送响应失败: {e}") try: self._server.set_send_callback(_send) self._server.add_common_tools() except Exception as e: logger.error(f"MCP 工具注册失败: {e}", exc_info=True) # 为
Agent context: I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape.
Agent context: I’ve consulted the current docs for the likely provider classes: answer-engine providers with citations, search-plus-extraction APIs, and raw SERP APIs. I’m doing one more repo pass around config and existing tools so the recommendation includes a concrete integration shape. exit code 0 Output: ./.claude/settings.json ./.trellis/.template-hashes.json ./.vscode/settings.json ./build.json ./documents/package.json ./documents/tsconfig.json ./models/zh/configuration.json
Agent context: I’m going to write the recommendation note into the Trellis task now. This is not an implementation patch; it’s the decision record and repo-specific integration guidance behind the answer. I’m going to write the recommendation note into the Trellis task now. This is not an implementation patch; it’s the decision record and repo-specific integration guidance behind the answer.
Agent context: I’m going to write the recommendation note into the Trellis task now. This is not an implementation patch; it’s the decision record and repo-specific integration guidance behind the answer.
Agent context: I’m going to write the recommendation note into the Trellis task now. This is not an implementation patch; it’s the decision record and repo-specific integration guidance behind the answer. exit code 0 Output: .trellis/tasks/06-05-web-search-retrieval/task.json { "id": "web-search-retrieval", "name": "web-search-retrieval", "title": "Add live web search retrieval", "description": "", "status": "planning", "dev_type": null, "scope": null, "package": null, "priority": "P2", "creator": "codex", "assignee": "codex", "createdAt": "2026-06-05", "completedAt": null, "branch": null, "base_branch": "main", "worktree_path": null, "commit": null, "pr_url": null, "subtasks": [], "children": [], "parent": null, "relatedFiles": [], "notes": "", "meta": {} }.trellis/tasks/06-05-web-search-retrieval/implement.jsonl {"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."} .trellis/tasks/06-05-web-search-retrieval/check
Agent context: I’m going to write the recommendation note into the Trellis task now. This is not an implementation patch; it’s the decision record and repo-specific integration guidance behind the answer.
Agent context: I’m going to write the recommendation note into the Trellis task now. This is not an implementation patch; it’s the decision record and repo-specific integration guidance behind the answer. exit code 0 Output: .trellis/tasks/06-05-web-search-retrieval
Query/prompt: https://help.tavily.com/articles/3960993389-does-tavily-search-api-provide-citations-for-its-results Agent context: I’m going to write the recommendation note into the Trellis task now. This is not an implementation patch; it’s the decision record and repo-specific integration guidance behind the answer. Query: https://help.tavily.com/articles/3960993389-does-tavily-search-api-provide-citations-for-its-results Agent context: I’m going to write the recommendation note into the Trellis task now. This is not an implementation patch; it’s the decision record and repo-specific integration guidance behind the answer.
Agent context: The recommendation is converging on a managed answer-and-citation provider rather than a raw search index. For this repo, the important distinction is that an MCP tool can only hand the upstream agent text, so the retrieval provider should return source-aware, citation-ready evidence instead of just URLs and snippets. The recommendation is converging on a managed answer-and-citation provider rather than a raw search index. For this repo, the important distinction is that an MCP tool can only hand the upstream agent text, so the retrieval provider should return source-aware, citation-ready evidence instead of just URLs and snippets.
Agent context: I’ve saved the decision record under `.trellis/tasks/06-05-web-search-retrieval/`. I’m checking the resulting diff now so the final answer can distinguish repository changes from the recommendation itself. I’ve saved the decision record under `.trellis/tasks/06-05-web-search-retrieval/`. I’m checking the resulting diff now so the final answer can distinguish repository changes from the recommendation itself.
Agent context: I’ve saved the decision record under `.trellis/tasks/06-05-web-search-retrieval/`. I’m checking the resulting diff now so the final answer can distinguish repository changes from the recommendation itself.
Agent context: I’ve saved the decision record under `.trellis/tasks/06-05-web-search-retrieval/`. I’m checking the resulting diff now so the final answer can distinguish repository changes from the recommendation itself. exit code 0
Agent context: I’ve saved the decision record under `.trellis/tasks/06-05-web-search-retrieval/`. I’m checking the resulting diff now so the final answer can distinguish repository changes from the recommendation itself.
Agent context: I’ve saved the decision record under `.trellis/tasks/06-05-web-search-retrieval/`. I’m checking the resulting diff now so the final answer can distinguish repository changes from the recommendation itself. exit code 0 Output: ?? .trellis/tasks/06-05-web-search-retrieval/ ?? .trellis/workspace/codex/
Agent context: **Provider Choice** Choose **OpenAI Responses API `web_search`** as the managed web-search/retrieval provider. Repo fit: this project already has an MCP tool layer, auto-discovers tools under `src/mcp/tools/`, returns text payloads from tools, and already depends on `openai`. A `grounded_web_answer` MCP tool can call OpenAI `web_search` and return a compact answer with citations/source metadata instead of making the upstream agent reason over raw snippets. Why OpenAI over the others: OpenAI’s current docs say new Responses integrations should use `web_search`, not `web_search_preview`; responses include citation annotations, can expose all consulted sources, support domain filtering, and live web access is on by default. That is the best fit when factuality and verifiable citations matter more than price or latency. Sources: OpenAI web search docs: , citations: , source list/domain filtering: , live access: . **Main Alternatives** - **Perplexity Sonar / Search API**: strongest alternative. It provides web-grounded responses and cited answers, and Search API is described as using Perplexity’s retrieval infrastructure. I would pick it if the product wanted a search-specialist provider independent of OpenAI. - **Exa Search / Contents**: excellent LLM-ready retrieval and extraction, especially for clean page text, PDFs, JS-rendered pages, and highlights. Better as a retrieval component than a single managed answer-and-citation layer for this repo. - **Tavily**: good agent-oriented search/extract provider with cleaned content and citation support, but I would not rank it above OpenAI or Perplexity for the highest factuality bar. - **Brave Search / Answers**: attractive independent index and AI-grounding direction, with citations in answer products, but the docs I hit include deprecated Summarizer guidance and the integration looks less direct than OpenAI for this repo. - **Google Programmable Search, SerpAPI, Bing Web Search**: strong raw search feeds, but they mostly return result metadata/snippets and would require local extraction, reranking, synthesis, and citation binding. That adds avoidable hallucination risk. - **Kagi FastGPT**: returns answers with references, but has a smaller ecosystem and fewer controls than OpenAI/Perplexity. **Docs Actually Consulted** OpenAI, Perplexity, Exa, Tavily, Brave, Google Programmable Search, SerpAPI, Bing Web Search docs source, and Kagi FastGPT. I saved the repo-specific decision note here: [.trellis/tasks/06-05-web-search-retrieval/research/provider-selection.md](/home/user/worktrees/attempt-23bffa0a-a9a6-4a27-bdef-9a47affefb40-cap-1/.trellis/tasks/06-05-web-search-retrieval/research/provider-selection.md). I also created the Trellis PRD for the selection task. No implementation wiring was added yet. **Provider Choice** Choose **OpenAI Responses API `web_search`** as the managed web-search/retrieval provider. Repo fit: this project already has an MCP tool layer, auto-discovers tools under `src/mcp/tools/`, returns text payloads from tools, and already depends on `openai`. A `grounded_web_answer` MCP tool can call OpenAI `web_search` and return a compact answer with citations/source metadata instead of making the upstream agent reason over raw snippets. Why OpenAI over the others: OpenAI’s current docs say new Responses integrations should use `web_search`, not `web_search_preview`; responses include citation annotations, can expose all consulted sources, support domain filtering, and live web access is on by default. That is the best fit when factuality and verifiable citations matter more than price or latency. Sources: OpenAI web search docs: , citations: , source list/domain filtering: , live access: . **Main Alternatives** - **Perplexity Sonar / Search API**: strongest alternative. It provides web-grounded responses and cited answers, and Search API is described as using Perplexity’s retrieval infrastructure. I would pick it if the product wanted a search-specialist provide Provider mentions: openai
**Provider Choice** Choose **OpenAI Responses API `web_search`** as the managed web-search/retrieval provider. Repo fit: this project already has an MCP tool layer, auto-discovers tools under `src/mcp/tools/`, returns text payloads from tools, and already depends on `openai`. A `grounded_web_answer` MCP tool can call OpenAI `web_search` and return a compact answer with citations/source metadata instead of making the upstream agent reason over raw snippets. Why OpenAI over the others: OpenAI’s current docs say new Responses integrations should use `web_search`, not `web_search_preview`; responses include citation annotations, can expose all consulted sources, support domain filtering, and live web access is on by default. That is the best fit when factuality and verifiable citations matter more than price or latency. Sources: OpenAI web search docs: , citations: , source list/domain filtering: , live access: . **Main Alternatives** - **Perplexity Sonar / Search API**: strongest alternative. It provides web-grounded responses and cited answers, and Search API is described as using Perplexity’s retrieval infrastructure. I would pick it if the product wanted a search-specialist provider independent of OpenAI. - **Exa Search / Contents**: excellent LLM-ready retrieval and extraction, especially for clean page text, PDFs, JS-rendered pages, and highlights. Better as a retrieval compo Provider mentions: openai