OmniSearch AI
OmniSearch AI是一个利用谷歌Gemini模型的尖端界面。它的特点是 深度研究代理, 网络接地 (实时搜索), 语音转录,并且已满 模型上下文协议(MCP) 支持工具互操作性。
特性
- 深度研究模式:利用
deep-research-pro-preview-12-2025agent自主规划、执行和综合多步骤研究任务。 - 标准模式:使用快速、有根据的答案
gemini-3-pro-preview或gemini-3-flash-preview具有可选的思维能力。 - 网络搜索限制:使用谷歌搜索工具进行实时事实检查。
- MCP客户端和服务器:
- 连接到外部MCP服务器,为AI提供新的工具(天气、数据库等)。 - 将OmniSearch本身作为MCP工具暴露给其他代理。
- 语音接口:无缝录制和转录音频。
- 无头模式:通过stdio将后端逻辑作为独立的MCP服务器运行。
先决条件
- 操作系统:Linux(Ubuntu、Debian、Fedora、Arch等)、macOS或Windows(WSL推荐)。
- Node.js:v18.0.0或更高版本(在无头模式下进行本机获取时需要)。
- npm 或 纱线.
安装
- 克隆或下载 项目文件保存到一个目录中。
- 安装依赖项:
npm install环境配置
此应用程序需要Google GenAI API密钥。
- 创建一个
.env根目录中的文件:
touch .env- 将API密钥添加到
.env使用变量名的文件OMNI_API_KEY:
OMNI_API_KEY=your_actual_google_api_key_here运行Web应用程序
我们使用 包裹 对于零配置开发服务器。
- 启动开发服务器:
npm start- 在浏览器中打开:
导航到 http://localhost:1234.
在无头模式下运行(MCP服务器)
您可以将OmniSearch AI作为独立的MCP服务器运行,该服务器通过以下方式进行通信 stdio。这允许您将其连接到其他MCP客户端(如Claude Desktop或其他AI代理),而无需运行web UI。
- 运行无头脚本:
npm run headless- 用法:
服务器通过stdin接受JSON-RPC 2.0消息。
API参考和示例
无头服务器支持以下JSON-RPC 2.0方法:
1.初始化
握手以建立联系和能力。
请求:
{
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "client-name",
"version": "1.0.0"
}
},
"id": 1
}2.初始化通知
初始化后发送,以确认连接已就绪。
请求:
{
"jsonrpc": "2.0",
"method": "notifications/initialized",
"params": {}
}3.列出工具
检索OmniSearch AI公开的可用工具列表。
请求:
{
"jsonrpc": "2.0",
"method": "tools/list",
"id": 2
}响应(示例):
{
"jsonrpc": "2.0",
"result": {
"tools": [
{
"name": "consult_omnisearch",
"description": "Query the OmniSearch AI. capable of Standard or Deep Search using Gemini models.",
"inputSchema": { ... }
},
{
"name": "transcribe_audio",
"description": "Transcribe audio data...",
"inputSchema": { ... }
}
]
},
"id": 2
}4.调用工具(consult_omnisearch)
查询AI模型。您可以选择特定的Gemini模型和搜索模式(标准与深度)。
请求:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "consult_omnisearch",
"arguments": {
"query": "Research the history of Google TPUs.",
"model": "gemini-3-pro-preview",
"search_mode": "deep"
}
},
"id": 3
}| 参数 | 类型 | 描述 |
|---|---|---|
query | string | 用户的提示或问题。 |
model | 字符串 | gemini-3-pro-preview (默认)或 gemini-3-flash-preview. |
search_mode | 字符串 | standard (默认)或 deep深度模式激活深度研究代理。 |
5.调用工具(transcribe_audio)
转录base64编码的音频数据。
请求:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "transcribe_audio",
"arguments": {
"audio_base64": "UklGRi..."
}
},
"id": 4
}生产建筑(网络)
要创建用于部署的优化版本,请执行以下操作:
npm run build输出将在 dist/ 目录。
项目结构
App.tsx:主应用控制器和布局。headless.ts:无头MCP服务器的入口点。services/geminiService.ts:与Gemini API交互的核心逻辑。services/internalMcpServer.ts:通过MCP公开应用程序功能的逻辑。components/:UI组件。
故障排除
- 麦克风问题:确保您的浏览器允许本地主机的麦克风访问。
- API错误:检查控制台。验证您的
OMNI_API_KEY在.env文件有效,可以访问gemini-3-pro-preview和deep-research-pro-preview-12-2025模型。 - 无头模式:确保您使用的是Node.js v18+原生版
fetch否则请求可能会失败。
