Repository files navigation

Infinite Research / 无限研究

A recursive BFS-powered research engine that leverages Vane for AI-driven web search, automatically generating and exploring sub-questions to build a comprehensive knowledge tree.

基于递归广度优先搜索的研究引擎,利用 Vane 进行 AI 驱动的网络搜索,自动生成并探索子问题,构建完整的知识树。

ReactViteTailwindCSSReactFlow


Table of Contents / 目录


Features / 功能特性

Feature功能
Recursive BFS search with auto-generated sub-questions递归广度优先搜索,自动生成子问题
Interactive ReactFlow canvas with task tree visualization基于 ReactFlow 的交互式任务树可视化画布
TF-IDF cosine similarity deduplication (threshold 0.7)TF-IDF 余弦相似度去重(阈值 0.7)
Up to 3 concurrent search tasks最多 3 个并发搜索任务
Sources sidebar with flat/grouped views and content snippets来源侧边栏,支持平铺/分组视图和内容摘要
Execution logs with level filtering执行日志,支持级别过滤
Session history with IndexedDB persistence会话历史,IndexedDB 持久化存储
Export to Markdown, JSON, and TSV formats支持导出 Markdown、JSON、TSV 格式
Pause / Resume / Stop controls暂停 / 继续 / 停止控制

Architecture / 架构

graph TB
subgraph Browser ["Browser / 浏览器"]
UI["InputBar<br/>用户输入"]
Canvas["ReactFlow Canvas<br/>任务树画布"]
Sources["SourcesSidebar<br/>来源侧边栏"]
History["HistorySidebar<br/>历史侧边栏"]
Logs["LogsPanel<br/>日志面板"]
StatusBar["StatusBar<br/>状态栏"]
subgraph Engine ["TaskEngine / 任务引擎"]
Queue["BFS Queue<br/>广度优先队列"]
Runner["Concurrent Runner<br/>并发执行器 (max 3)"]
Dedup["TF-IDF Dedup<br/>TF-IDF 去重"]
end
subgraph Storage ["Storage / 存储"]
IDB["IndexedDB<br/>sessions + embeddings"]
end
end
subgraph Backend ["Vane Backend / Vane 后端"]
VaneAPI["Vane API<br/>/api/search"]
SearxNG["SearxNG<br/>搜索聚合"]
LLM["Local LLM<br/>本地大模型"]
end
UI -->|"query / 查询"| Engine
Engine -->|"tasks, logs / 任务, 日志"| Canvas
Engine -->|"tasks, logs"| Sources
Engine -->|"tasks, logs"| Logs
Engine -->|"stats / 统计"| StatusBar
Engine -->|"save / 保存"| IDB
History -->|"load session / 加载会话"| IDB
Runner -->|"POST /api/search"| VaneAPI
VaneAPI --> SearxNG
VaneAPI --> LLM
style Engine fill:#1e3a5f,stroke:#3b82f6
style Storage fill:#1e3a2f,stroke:#10b981
style Backend fill:#3a1e3f,stroke:#a855f7
Loading

Component Overview / 组件概览

src/
├── App.jsx # Main app, ReactFlow canvas, state management
│ # 主应用,ReactFlow 画布,状态管理
├── lib/
│ ├── searchApi.js # Vane API client, source normalization
│ │ # Vane API 客户端,来源数据标准化
│ ├── taskEngine.js # BFS engine, concurrency, logging, persistence
│ │ # BFS 引擎,并发控制,日志记录,持久化
│ ├── similarity.js # TF-IDF cosine similarity deduplication
│ │ # TF-IDF 余弦相似度去重
│ └── storage.js # IndexedDB wrapper (sessions + embeddings)
│ # IndexedDB 封装(会话 + 嵌入向量存储)
├── components/
│ ├── InputBar.jsx # Search input, controls, history toggle
│ │ # 搜索输入,控制按钮,历史切换
│ ├── TaskNode.jsx # ReactFlow custom node for each task
│ │ # ReactFlow 自定义任务节点
│ ├── SourcesSidebar.jsx # Right sidebar: sources + logs tabs
│ │ # 右侧边栏:来源 + 日志标签页
│ ├── HistorySidebar.jsx # Left sidebar: session history
│ │ # 左侧边栏:会话历史
│ ├── LogsPanel.jsx # Filterable execution log viewer
│ │ # 可过滤的执行日志查看器
│ └── StatusBar.jsx # Bottom stats bar
│ # 底部状态栏
└── styles/
└── index.css # Tailwind directives + animations
# Tailwind 指令 + 动画

Message Processing Flow / 消息处理流程

sequenceDiagram
participant U as User / 用户
participant E as TaskEngine / 任务引擎
participant V as Vane API
participant D as TF-IDF Dedup / 去重
participant S as IndexedDB
U->>E: Submit query / 提交查询
E->>E: Create root task (depth 0)<br/>创建根任务(深度 0)
E->>E: Add to BFS queue / 加入队列
loop BFS Processing / BFS 处理 (max 3 concurrent / 最多3并发)
E->>V: POST /api/search (query)
V-->>E: {message, sources[]}
E->>E: Store result + sources<br/>保存结果和来源
E->>V: POST /api/search (generate sub-tasks prompt)
V-->>E: JSON array of 1-3 sub-questions<br/>返回1-3个子问题
loop For each sub-question / 对每个子问题
E->>D: isDuplicate(subQuery, existingTasks, 0.7)
alt Similarity > 0.7 / 相似度 > 0.7
D-->>E: duplicate=true
E->>E: Mark as skipped / 标记为跳过
else Similarity <= 0.7 / 相似度 <= 0.7
D-->>E: duplicate=false
E->>E: Create task, add to queue<br/>创建任务,加入队列
end
end
E->>S: Debounced save (500ms)<br/>防抖保存(500毫秒)
E-->>U: Update UI (tasks, logs, stats)<br/>更新界面(任务,日志,统计)
end
Loading

Task Lifecycle / 任务生命周期

stateDiagram-v2
[*] --> pending: Created / 创建
pending --> running: Dequeued / 出队执行
running --> completed: Search + sub-tasks done / 搜索+子任务完成
running --> failed: Error / 错误
pending --> skipped: Duplicate detected / 检测到重复
completed --> [*]
failed --> [*]
skipped --> [*]
Loading

Prerequisites / 前置要求

Requirement / 要求Version / 版本
Node.js>= 18
npm>= 9
Vane (running instance)latest
Ollama (for Vane's LLM backend)latest
A chat model in Ollamae.g. llama3, gemma2, etc.
An embedding model in Ollamae.g. nomic-embed-text, etc.

Vane Installation / Vane 安装

Vane is a privacy-focused AI search engine that runs on your own hardware. It provides the search API that powers Infinite Research.

Vane 是一个注重隐私的 AI 搜索引擎,完全在本地硬件上运行。它为 Infinite Research 提供搜索 API。

Full documentation / 完整文档: github.com/ItzCrazyKns/Vane

Option A: Docker (Recommended / 推荐)

# Pull and run with bundled SearxNG# 拉取并运行(内置 SearxNG)
docker run -d \
-p 3000:3000 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:latest

For custom SearxNG instance / 使用自定义 SearxNG 实例:

docker run -d \
-p 3000:3000 \
-e SEARXNG_API_URL=http://your-searxng:8080 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:slim-latest

Option B: From Source / 从源码安装

git clone https://github.com/ItzCrazyKns/Vane.git
cd Vane
npm i
npm run build
npm run start

Configure Ollama for Vane / 为 Vane 配置 Ollama

  1. Install Ollama / 安装 Ollama: ollama.com

  2. Pull required models / 拉取所需模型:

    ollama pull <your-chat-model># e.g. llama3, gemma2, etc. / 对话模型
    ollama pull <your-embedding-model># e.g. nomic-embed-text, etc. / 嵌入模型
  3. Ensure Ollama listens on 0.0.0.0 (required for Docker or remote access): 确保 Ollama 监听 0.0.0.0(Docker 或远程访问时必需):

    Linux:

    # Edit /etc/systemd/system/ollama.service, add:# 编辑 /etc/systemd/system/ollama.service,添加:
    Environment="OLLAMA_HOST=0.0.0.0:11434"
    systemctl daemon-reload
    systemctl restart ollama

    macOS / Windows:

    OLLAMA_HOST=0.0.0.0:11434 ollama serve
  4. Open Vane at http://localhost:3000 and configure: 打开 Vane (http://localhost:3000) 并配置:

    • Select your Ollama chat model / 选择 Ollama 对话模型
    • Select your Ollama embedding model / 选择嵌入模型
    • Note the Provider ID shown in Vane's settings / 记下设置中显示的 Provider ID

App Installation / 应用安装

# Clone the repository / 克隆仓库
git clone <repository-url>cd gemma_claude
# Install dependencies / 安装依赖
npm install
# Copy env template and edit / 复制环境变量模板并编辑
cp .env.example .env
# Start development server / 启动开发服务器
npm run dev

The app will be available at http://localhost:5180.

应用将在 http://localhost:5180 启动。


Configuration / 配置

All configuration is managed through the .env file. Copy .env.example to .env and edit the values.

所有配置通过 .env 文件管理。将 .env.example 复制为 .env 并编辑其中的值。

cp .env.example .env

Environment Variables / 环境变量

Variable / 变量Default / 默认值Description / 说明
VITE_API_BASE/apiAPI base path (usually no need to change) / API 基础路径(通常无需修改)
VITE_VANE_TARGEThttp://localhost:3000Vane instance URL / Vane 实例地址
VITE_CHAT_PROVIDER_IDVane chat provider UUID / Vane 对话提供者 UUID
VITE_CHAT_MODEL_KEYChat model name in Ollama / Ollama 中的对话模型名称
VITE_EMBED_PROVIDER_IDVane embedding provider UUID / Vane 嵌入提供者 UUID
VITE_EMBED_MODEL_KEYEmbedding model name / 嵌入模型名称
VITE_MAX_CONCURRENT3Max parallel search tasks / 最大并行搜索任务数
VITE_SIMILARITY_THRESHOLD0.7TF-IDF dedup threshold (0–1) / TF-IDF 去重阈值
VITE_MAX_SUB_TASKS3Max sub-questions per task / 每个任务最大子问题数
VITE_FETCH_TIMEOUT600000API request timeout in ms (10 min) / API 请求超时(毫秒)
VITE_PORT5180Dev server port / 开发服务器端口

Example .env / 示例

# Vane APIVITE_API_BASE=/apiVITE_VANE_TARGET=http://localhost:3000# Models (find Provider ID in Vane settings)# 模型配置(在 Vane 设置页面找到 Provider ID)VITE_CHAT_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_CHAT_MODEL_KEY=your-chat-modelVITE_EMBED_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_EMBED_MODEL_KEY=your-embedding-model# Engine tuning / 引擎调优VITE_MAX_CONCURRENT=3VITE_SIMILARITY_THRESHOLD=0.7VITE_MAX_SUB_TASKS=3VITE_FETCH_TIMEOUT=600000# Dev server / 开发服务器VITE_PORT=5180

Finding your Provider ID / 查找 Provider ID: Open Vane's web UI, go to settings. The provider ID is a UUID shown next to each configured provider (Ollama, OpenAI, etc.).

打开 Vane 网页界面,进入设置页面。Provider ID 是每个配置的提供者(Ollama、OpenAI 等)旁边显示的 UUID。


Usage / 使用方法

  1. Start a research / 开始研究: Enter a research question in the top search bar and click "Research". 在顶部搜索栏输入研究问题,点击 "Research"。

  2. Watch the tree grow / 观察树的生长: The ReactFlow canvas shows tasks as nodes. Running tasks pulse, completed tasks turn green, skipped duplicates turn yellow. ReactFlow 画布以节点形式展示任务。运行中的任务闪烁,已完成的变绿,跳过的重复项变黄。

  3. Control execution / 控制执行:

    • Pause / 暂停 - Stops dequeuing new tasks (running tasks finish) / 停止出队新任务(运行中的任务会完成)
    • Resume / 继续 - Resumes queue processing / 恢复队列处理
    • Stop / 停止 - Stops all processing / 停止所有处理
  4. Browse sources / 浏览来源: Click "Sources" to open the right sidebar. Toggle between flat and grouped views. Filter by keyword. Expand cards to see full content snippets. 点击 "Sources" 打开右侧边栏。切换平铺和分组视图。按关键词过滤。展开卡片查看完整内容摘要。

  5. View logs / 查看日志: Switch to the "Logs" tab in the right sidebar. Filter by level (Info/Warn/Error). 在右侧边栏切换到 "Logs" 标签页。按级别过滤(Info/Warn/Error)。

  6. Export results / 导出结果:

    • Markdown (.md) - Full research report / 完整研究报告
    • JSON (.json) - Structured task data / 结构化任务数据
    • TSV (.tsv) - Source links spreadsheet / 来源链接表格
  7. Session history / 会话历史: Click "History" to browse past sessions. Click any session to reload it on the canvas. Sessions persist across page refreshes via IndexedDB. 点击 "History" 浏览历史会话。点击任意会话在画布上重新加载。会话通过 IndexedDB 在页面刷新后持久保存。


Tech Stack / 技术栈

Layer / 层Technology / 技术
UI FrameworkReact 19
Build ToolVite 6
StylingTailwindCSS 3
Graph Visualization@xyflow/react (ReactFlow) 12
Search BackendVane (SearxNG + LLM)
LLMOllama (any compatible model)
PersistenceIndexedDB (browser-native)
DeduplicationTF-IDF Cosine Similarity

License / 许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Infinite Research / 无限研究

A recursive BFS-powered research engine that leverages Vane for AI-driven web search, automatically generating and exploring sub-questions to build a comprehensive knowledge tree.

基于递归广度优先搜索的研究引擎,利用 Vane 进行 AI 驱动的网络搜索,自动生成并探索子问题,构建完整的知识树。

ReactViteTailwindCSSReactFlow


Table of Contents / 目录


Features / 功能特性

Feature功能
Recursive BFS search with auto-generated sub-questions递归广度优先搜索,自动生成子问题
Interactive ReactFlow canvas with task tree visualization基于 ReactFlow 的交互式任务树可视化画布
TF-IDF cosine similarity deduplication (threshold 0.7)TF-IDF 余弦相似度去重(阈值 0.7)
Up to 3 concurrent search tasks最多 3 个并发搜索任务
Sources sidebar with flat/grouped views and content snippets来源侧边栏,支持平铺/分组视图和内容摘要
Execution logs with level filtering执行日志,支持级别过滤
Session history with IndexedDB persistence会话历史,IndexedDB 持久化存储
Export to Markdown, JSON, and TSV formats支持导出 Markdown、JSON、TSV 格式
Pause / Resume / Stop controls暂停 / 继续 / 停止控制

Architecture / 架构

graph TB
subgraph Browser ["Browser / 浏览器"]
UI["InputBar<br/>用户输入"]
Canvas["ReactFlow Canvas<br/>任务树画布"]
Sources["SourcesSidebar<br/>来源侧边栏"]
History["HistorySidebar<br/>历史侧边栏"]
Logs["LogsPanel<br/>日志面板"]
StatusBar["StatusBar<br/>状态栏"]
subgraph Engine ["TaskEngine / 任务引擎"]
Queue["BFS Queue<br/>广度优先队列"]
Runner["Concurrent Runner<br/>并发执行器 (max 3)"]
Dedup["TF-IDF Dedup<br/>TF-IDF 去重"]
end
subgraph Storage ["Storage / 存储"]
IDB["IndexedDB<br/>sessions + embeddings"]
end
end
subgraph Backend ["Vane Backend / Vane 后端"]
VaneAPI["Vane API<br/>/api/search"]
SearxNG["SearxNG<br/>搜索聚合"]
LLM["Local LLM<br/>本地大模型"]
end
UI -->|"query / 查询"| Engine
Engine -->|"tasks, logs / 任务, 日志"| Canvas
Engine -->|"tasks, logs"| Sources
Engine -->|"tasks, logs"| Logs
Engine -->|"stats / 统计"| StatusBar
Engine -->|"save / 保存"| IDB
History -->|"load session / 加载会话"| IDB
Runner -->|"POST /api/search"| VaneAPI
VaneAPI --> SearxNG
VaneAPI --> LLM
style Engine fill:#1e3a5f,stroke:#3b82f6
style Storage fill:#1e3a2f,stroke:#10b981
style Backend fill:#3a1e3f,stroke:#a855f7
Loading

Component Overview / 组件概览

src/
├── App.jsx # Main app, ReactFlow canvas, state management
│ # 主应用,ReactFlow 画布,状态管理
├── lib/
│ ├── searchApi.js # Vane API client, source normalization
│ │ # Vane API 客户端,来源数据标准化
│ ├── taskEngine.js # BFS engine, concurrency, logging, persistence
│ │ # BFS 引擎,并发控制,日志记录,持久化
│ ├── similarity.js # TF-IDF cosine similarity deduplication
│ │ # TF-IDF 余弦相似度去重
│ └── storage.js # IndexedDB wrapper (sessions + embeddings)
│ # IndexedDB 封装(会话 + 嵌入向量存储)
├── components/
│ ├── InputBar.jsx # Search input, controls, history toggle
│ │ # 搜索输入,控制按钮,历史切换
│ ├── TaskNode.jsx # ReactFlow custom node for each task
│ │ # ReactFlow 自定义任务节点
│ ├── SourcesSidebar.jsx # Right sidebar: sources + logs tabs
│ │ # 右侧边栏:来源 + 日志标签页
│ ├── HistorySidebar.jsx # Left sidebar: session history
│ │ # 左侧边栏:会话历史
│ ├── LogsPanel.jsx # Filterable execution log viewer
│ │ # 可过滤的执行日志查看器
│ └── StatusBar.jsx # Bottom stats bar
│ # 底部状态栏
└── styles/
└── index.css # Tailwind directives + animations
# Tailwind 指令 + 动画

Message Processing Flow / 消息处理流程

sequenceDiagram
participant U as User / 用户
participant E as TaskEngine / 任务引擎
participant V as Vane API
participant D as TF-IDF Dedup / 去重
participant S as IndexedDB
U->>E: Submit query / 提交查询
E->>E: Create root task (depth 0)<br/>创建根任务(深度 0)
E->>E: Add to BFS queue / 加入队列
loop BFS Processing / BFS 处理 (max 3 concurrent / 最多3并发)
E->>V: POST /api/search (query)
V-->>E: {message, sources[]}
E->>E: Store result + sources<br/>保存结果和来源
E->>V: POST /api/search (generate sub-tasks prompt)
V-->>E: JSON array of 1-3 sub-questions<br/>返回1-3个子问题
loop For each sub-question / 对每个子问题
E->>D: isDuplicate(subQuery, existingTasks, 0.7)
alt Similarity > 0.7 / 相似度 > 0.7
D-->>E: duplicate=true
E->>E: Mark as skipped / 标记为跳过
else Similarity <= 0.7 / 相似度 <= 0.7
D-->>E: duplicate=false
E->>E: Create task, add to queue<br/>创建任务,加入队列
end
end
E->>S: Debounced save (500ms)<br/>防抖保存(500毫秒)
E-->>U: Update UI (tasks, logs, stats)<br/>更新界面(任务,日志,统计)
end
Loading

Task Lifecycle / 任务生命周期

stateDiagram-v2
[*] --> pending: Created / 创建
pending --> running: Dequeued / 出队执行
running --> completed: Search + sub-tasks done / 搜索+子任务完成
running --> failed: Error / 错误
pending --> skipped: Duplicate detected / 检测到重复
completed --> [*]
failed --> [*]
skipped --> [*]
Loading

Prerequisites / 前置要求

Requirement / 要求Version / 版本
Node.js>= 18
npm>= 9
Vane (running instance)latest
Ollama (for Vane's LLM backend)latest
A chat model in Ollamae.g. llama3, gemma2, etc.
An embedding model in Ollamae.g. nomic-embed-text, etc.

Vane Installation / Vane 安装

Vane is a privacy-focused AI search engine that runs on your own hardware. It provides the search API that powers Infinite Research.

Vane 是一个注重隐私的 AI 搜索引擎,完全在本地硬件上运行。它为 Infinite Research 提供搜索 API。

Full documentation / 完整文档: github.com/ItzCrazyKns/Vane

Option A: Docker (Recommended / 推荐)

# Pull and run with bundled SearxNG# 拉取并运行(内置 SearxNG)
docker run -d \
-p 3000:3000 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:latest

For custom SearxNG instance / 使用自定义 SearxNG 实例:

docker run -d \
-p 3000:3000 \
-e SEARXNG_API_URL=http://your-searxng:8080 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:slim-latest

Option B: From Source / 从源码安装

git clone https://github.com/ItzCrazyKns/Vane.git
cd Vane
npm i
npm run build
npm run start

Configure Ollama for Vane / 为 Vane 配置 Ollama

  1. Install Ollama / 安装 Ollama: ollama.com

  2. Pull required models / 拉取所需模型:

    ollama pull <your-chat-model># e.g. llama3, gemma2, etc. / 对话模型
    ollama pull <your-embedding-model># e.g. nomic-embed-text, etc. / 嵌入模型
  3. Ensure Ollama listens on 0.0.0.0 (required for Docker or remote access): 确保 Ollama 监听 0.0.0.0(Docker 或远程访问时必需):

    Linux:

    # Edit /etc/systemd/system/ollama.service, add:# 编辑 /etc/systemd/system/ollama.service,添加:
    Environment="OLLAMA_HOST=0.0.0.0:11434"
    systemctl daemon-reload
    systemctl restart ollama

    macOS / Windows:

    OLLAMA_HOST=0.0.0.0:11434 ollama serve
  4. Open Vane at http://localhost:3000 and configure: 打开 Vane (http://localhost:3000) 并配置:

    • Select your Ollama chat model / 选择 Ollama 对话模型
    • Select your Ollama embedding model / 选择嵌入模型
    • Note the Provider ID shown in Vane's settings / 记下设置中显示的 Provider ID

App Installation / 应用安装

# Clone the repository / 克隆仓库
git clone <repository-url>cd gemma_claude
# Install dependencies / 安装依赖
npm install
# Copy env template and edit / 复制环境变量模板并编辑
cp .env.example .env
# Start development server / 启动开发服务器
npm run dev

The app will be available at http://localhost:5180.

应用将在 http://localhost:5180 启动。


Configuration / 配置

All configuration is managed through the .env file. Copy .env.example to .env and edit the values.

所有配置通过 .env 文件管理。将 .env.example 复制为 .env 并编辑其中的值。

cp .env.example .env

Environment Variables / 环境变量

Variable / 变量Default / 默认值Description / 说明
VITE_API_BASE/apiAPI base path (usually no need to change) / API 基础路径(通常无需修改)
VITE_VANE_TARGEThttp://localhost:3000Vane instance URL / Vane 实例地址
VITE_CHAT_PROVIDER_IDVane chat provider UUID / Vane 对话提供者 UUID
VITE_CHAT_MODEL_KEYChat model name in Ollama / Ollama 中的对话模型名称
VITE_EMBED_PROVIDER_IDVane embedding provider UUID / Vane 嵌入提供者 UUID
VITE_EMBED_MODEL_KEYEmbedding model name / 嵌入模型名称
VITE_MAX_CONCURRENT3Max parallel search tasks / 最大并行搜索任务数
VITE_SIMILARITY_THRESHOLD0.7TF-IDF dedup threshold (0–1) / TF-IDF 去重阈值
VITE_MAX_SUB_TASKS3Max sub-questions per task / 每个任务最大子问题数
VITE_FETCH_TIMEOUT600000API request timeout in ms (10 min) / API 请求超时(毫秒)
VITE_PORT5180Dev server port / 开发服务器端口

Example .env / 示例

# Vane APIVITE_API_BASE=/apiVITE_VANE_TARGET=http://localhost:3000# Models (find Provider ID in Vane settings)# 模型配置(在 Vane 设置页面找到 Provider ID)VITE_CHAT_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_CHAT_MODEL_KEY=your-chat-modelVITE_EMBED_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_EMBED_MODEL_KEY=your-embedding-model# Engine tuning / 引擎调优VITE_MAX_CONCURRENT=3VITE_SIMILARITY_THRESHOLD=0.7VITE_MAX_SUB_TASKS=3VITE_FETCH_TIMEOUT=600000# Dev server / 开发服务器VITE_PORT=5180

Finding your Provider ID / 查找 Provider ID: Open Vane's web UI, go to settings. The provider ID is a UUID shown next to each configured provider (Ollama, OpenAI, etc.).

打开 Vane 网页界面,进入设置页面。Provider ID 是每个配置的提供者(Ollama、OpenAI 等)旁边显示的 UUID。


Usage / 使用方法

  1. Start a research / 开始研究: Enter a research question in the top search bar and click "Research". 在顶部搜索栏输入研究问题,点击 "Research"。

  2. Watch the tree grow / 观察树的生长: The ReactFlow canvas shows tasks as nodes. Running tasks pulse, completed tasks turn green, skipped duplicates turn yellow. ReactFlow 画布以节点形式展示任务。运行中的任务闪烁,已完成的变绿,跳过的重复项变黄。

  3. Control execution / 控制执行:

    • Pause / 暂停 - Stops dequeuing new tasks (running tasks finish) / 停止出队新任务(运行中的任务会完成)
    • Resume / 继续 - Resumes queue processing / 恢复队列处理
    • Stop / 停止 - Stops all processing / 停止所有处理
  4. Browse sources / 浏览来源: Click "Sources" to open the right sidebar. Toggle between flat and grouped views. Filter by keyword. Expand cards to see full content snippets. 点击 "Sources" 打开右侧边栏。切换平铺和分组视图。按关键词过滤。展开卡片查看完整内容摘要。

  5. View logs / 查看日志: Switch to the "Logs" tab in the right sidebar. Filter by level (Info/Warn/Error). 在右侧边栏切换到 "Logs" 标签页。按级别过滤(Info/Warn/Error)。

  6. Export results / 导出结果:

    • Markdown (.md) - Full research report / 完整研究报告
    • JSON (.json) - Structured task data / 结构化任务数据
    • TSV (.tsv) - Source links spreadsheet / 来源链接表格
  7. Session history / 会话历史: Click "History" to browse past sessions. Click any session to reload it on the canvas. Sessions persist across page refreshes via IndexedDB. 点击 "History" 浏览历史会话。点击任意会话在画布上重新加载。会话通过 IndexedDB 在页面刷新后持久保存。


Tech Stack / 技术栈

Layer / 层Technology / 技术
UI FrameworkReact 19
Build ToolVite 6
StylingTailwindCSS 3
Graph Visualization@xyflow/react (ReactFlow) 12
Search BackendVane (SearxNG + LLM)
LLMOllama (any compatible model)
PersistenceIndexedDB (browser-native)
DeduplicationTF-IDF Cosine Similarity

License / 许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Infinite Research / 无限研究

A recursive BFS-powered research engine that leverages Vane for AI-driven web search, automatically generating and exploring sub-questions to build a comprehensive knowledge tree.

基于递归广度优先搜索的研究引擎,利用 Vane 进行 AI 驱动的网络搜索,自动生成并探索子问题,构建完整的知识树。

ReactViteTailwindCSSReactFlow


Table of Contents / 目录


Features / 功能特性

Feature功能
Recursive BFS search with auto-generated sub-questions递归广度优先搜索,自动生成子问题
Interactive ReactFlow canvas with task tree visualization基于 ReactFlow 的交互式任务树可视化画布
TF-IDF cosine similarity deduplication (threshold 0.7)TF-IDF 余弦相似度去重(阈值 0.7)
Up to 3 concurrent search tasks最多 3 个并发搜索任务
Sources sidebar with flat/grouped views and content snippets来源侧边栏,支持平铺/分组视图和内容摘要
Execution logs with level filtering执行日志,支持级别过滤
Session history with IndexedDB persistence会话历史,IndexedDB 持久化存储
Export to Markdown, JSON, and TSV formats支持导出 Markdown、JSON、TSV 格式
Pause / Resume / Stop controls暂停 / 继续 / 停止控制

Architecture / 架构

graph TB
subgraph Browser ["Browser / 浏览器"]
UI["InputBar<br/>用户输入"]
Canvas["ReactFlow Canvas<br/>任务树画布"]
Sources["SourcesSidebar<br/>来源侧边栏"]
History["HistorySidebar<br/>历史侧边栏"]
Logs["LogsPanel<br/>日志面板"]
StatusBar["StatusBar<br/>状态栏"]
subgraph Engine ["TaskEngine / 任务引擎"]
Queue["BFS Queue<br/>广度优先队列"]
Runner["Concurrent Runner<br/>并发执行器 (max 3)"]
Dedup["TF-IDF Dedup<br/>TF-IDF 去重"]
end
subgraph Storage ["Storage / 存储"]
IDB["IndexedDB<br/>sessions + embeddings"]
end
end
subgraph Backend ["Vane Backend / Vane 后端"]
VaneAPI["Vane API<br/>/api/search"]
SearxNG["SearxNG<br/>搜索聚合"]
LLM["Local LLM<br/>本地大模型"]
end
UI -->|"query / 查询"| Engine
Engine -->|"tasks, logs / 任务, 日志"| Canvas
Engine -->|"tasks, logs"| Sources
Engine -->|"tasks, logs"| Logs
Engine -->|"stats / 统计"| StatusBar
Engine -->|"save / 保存"| IDB
History -->|"load session / 加载会话"| IDB
Runner -->|"POST /api/search"| VaneAPI
VaneAPI --> SearxNG
VaneAPI --> LLM
style Engine fill:#1e3a5f,stroke:#3b82f6
style Storage fill:#1e3a2f,stroke:#10b981
style Backend fill:#3a1e3f,stroke:#a855f7
Loading

Component Overview / 组件概览

src/
├── App.jsx # Main app, ReactFlow canvas, state management
│ # 主应用,ReactFlow 画布,状态管理
├── lib/
│ ├── searchApi.js # Vane API client, source normalization
│ │ # Vane API 客户端,来源数据标准化
│ ├── taskEngine.js # BFS engine, concurrency, logging, persistence
│ │ # BFS 引擎,并发控制,日志记录,持久化
│ ├── similarity.js # TF-IDF cosine similarity deduplication
│ │ # TF-IDF 余弦相似度去重
│ └── storage.js # IndexedDB wrapper (sessions + embeddings)
│ # IndexedDB 封装(会话 + 嵌入向量存储)
├── components/
│ ├── InputBar.jsx # Search input, controls, history toggle
│ │ # 搜索输入,控制按钮,历史切换
│ ├── TaskNode.jsx # ReactFlow custom node for each task
│ │ # ReactFlow 自定义任务节点
│ ├── SourcesSidebar.jsx # Right sidebar: sources + logs tabs
│ │ # 右侧边栏:来源 + 日志标签页
│ ├── HistorySidebar.jsx # Left sidebar: session history
│ │ # 左侧边栏:会话历史
│ ├── LogsPanel.jsx # Filterable execution log viewer
│ │ # 可过滤的执行日志查看器
│ └── StatusBar.jsx # Bottom stats bar
│ # 底部状态栏
└── styles/
└── index.css # Tailwind directives + animations
# Tailwind 指令 + 动画

Message Processing Flow / 消息处理流程

sequenceDiagram
participant U as User / 用户
participant E as TaskEngine / 任务引擎
participant V as Vane API
participant D as TF-IDF Dedup / 去重
participant S as IndexedDB
U->>E: Submit query / 提交查询
E->>E: Create root task (depth 0)<br/>创建根任务(深度 0)
E->>E: Add to BFS queue / 加入队列
loop BFS Processing / BFS 处理 (max 3 concurrent / 最多3并发)
E->>V: POST /api/search (query)
V-->>E: {message, sources[]}
E->>E: Store result + sources<br/>保存结果和来源
E->>V: POST /api/search (generate sub-tasks prompt)
V-->>E: JSON array of 1-3 sub-questions<br/>返回1-3个子问题
loop For each sub-question / 对每个子问题
E->>D: isDuplicate(subQuery, existingTasks, 0.7)
alt Similarity > 0.7 / 相似度 > 0.7
D-->>E: duplicate=true
E->>E: Mark as skipped / 标记为跳过
else Similarity <= 0.7 / 相似度 <= 0.7
D-->>E: duplicate=false
E->>E: Create task, add to queue<br/>创建任务,加入队列
end
end
E->>S: Debounced save (500ms)<br/>防抖保存(500毫秒)
E-->>U: Update UI (tasks, logs, stats)<br/>更新界面(任务,日志,统计)
end
Loading

Task Lifecycle / 任务生命周期

stateDiagram-v2
[*] --> pending: Created / 创建
pending --> running: Dequeued / 出队执行
running --> completed: Search + sub-tasks done / 搜索+子任务完成
running --> failed: Error / 错误
pending --> skipped: Duplicate detected / 检测到重复
completed --> [*]
failed --> [*]
skipped --> [*]
Loading

Prerequisites / 前置要求

Requirement / 要求Version / 版本
Node.js>= 18
npm>= 9
Vane (running instance)latest
Ollama (for Vane's LLM backend)latest
A chat model in Ollamae.g. llama3, gemma2, etc.
An embedding model in Ollamae.g. nomic-embed-text, etc.

Vane Installation / Vane 安装

Vane is a privacy-focused AI search engine that runs on your own hardware. It provides the search API that powers Infinite Research.

Vane 是一个注重隐私的 AI 搜索引擎,完全在本地硬件上运行。它为 Infinite Research 提供搜索 API。

Full documentation / 完整文档: github.com/ItzCrazyKns/Vane

Option A: Docker (Recommended / 推荐)

# Pull and run with bundled SearxNG# 拉取并运行(内置 SearxNG)
docker run -d \
-p 3000:3000 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:latest

For custom SearxNG instance / 使用自定义 SearxNG 实例:

docker run -d \
-p 3000:3000 \
-e SEARXNG_API_URL=http://your-searxng:8080 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:slim-latest

Option B: From Source / 从源码安装

git clone https://github.com/ItzCrazyKns/Vane.git
cd Vane
npm i
npm run build
npm run start

Configure Ollama for Vane / 为 Vane 配置 Ollama

  1. Install Ollama / 安装 Ollama: ollama.com

  2. Pull required models / 拉取所需模型:

    ollama pull <your-chat-model># e.g. llama3, gemma2, etc. / 对话模型
    ollama pull <your-embedding-model># e.g. nomic-embed-text, etc. / 嵌入模型
  3. Ensure Ollama listens on 0.0.0.0 (required for Docker or remote access): 确保 Ollama 监听 0.0.0.0(Docker 或远程访问时必需):

    Linux:

    # Edit /etc/systemd/system/ollama.service, add:# 编辑 /etc/systemd/system/ollama.service,添加:
    Environment="OLLAMA_HOST=0.0.0.0:11434"
    systemctl daemon-reload
    systemctl restart ollama

    macOS / Windows:

    OLLAMA_HOST=0.0.0.0:11434 ollama serve
  4. Open Vane at http://localhost:3000 and configure: 打开 Vane (http://localhost:3000) 并配置:

    • Select your Ollama chat model / 选择 Ollama 对话模型
    • Select your Ollama embedding model / 选择嵌入模型
    • Note the Provider ID shown in Vane's settings / 记下设置中显示的 Provider ID

App Installation / 应用安装

# Clone the repository / 克隆仓库
git clone <repository-url>cd gemma_claude
# Install dependencies / 安装依赖
npm install
# Copy env template and edit / 复制环境变量模板并编辑
cp .env.example .env
# Start development server / 启动开发服务器
npm run dev

The app will be available at http://localhost:5180.

应用将在 http://localhost:5180 启动。


Configuration / 配置

All configuration is managed through the .env file. Copy .env.example to .env and edit the values.

所有配置通过 .env 文件管理。将 .env.example 复制为 .env 并编辑其中的值。

cp .env.example .env

Environment Variables / 环境变量

Variable / 变量Default / 默认值Description / 说明
VITE_API_BASE/apiAPI base path (usually no need to change) / API 基础路径(通常无需修改)
VITE_VANE_TARGEThttp://localhost:3000Vane instance URL / Vane 实例地址
VITE_CHAT_PROVIDER_IDVane chat provider UUID / Vane 对话提供者 UUID
VITE_CHAT_MODEL_KEYChat model name in Ollama / Ollama 中的对话模型名称
VITE_EMBED_PROVIDER_IDVane embedding provider UUID / Vane 嵌入提供者 UUID
VITE_EMBED_MODEL_KEYEmbedding model name / 嵌入模型名称
VITE_MAX_CONCURRENT3Max parallel search tasks / 最大并行搜索任务数
VITE_SIMILARITY_THRESHOLD0.7TF-IDF dedup threshold (0–1) / TF-IDF 去重阈值
VITE_MAX_SUB_TASKS3Max sub-questions per task / 每个任务最大子问题数
VITE_FETCH_TIMEOUT600000API request timeout in ms (10 min) / API 请求超时(毫秒)
VITE_PORT5180Dev server port / 开发服务器端口

Example .env / 示例

# Vane APIVITE_API_BASE=/apiVITE_VANE_TARGET=http://localhost:3000# Models (find Provider ID in Vane settings)# 模型配置(在 Vane 设置页面找到 Provider ID)VITE_CHAT_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_CHAT_MODEL_KEY=your-chat-modelVITE_EMBED_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_EMBED_MODEL_KEY=your-embedding-model# Engine tuning / 引擎调优VITE_MAX_CONCURRENT=3VITE_SIMILARITY_THRESHOLD=0.7VITE_MAX_SUB_TASKS=3VITE_FETCH_TIMEOUT=600000# Dev server / 开发服务器VITE_PORT=5180

Finding your Provider ID / 查找 Provider ID: Open Vane's web UI, go to settings. The provider ID is a UUID shown next to each configured provider (Ollama, OpenAI, etc.).

打开 Vane 网页界面,进入设置页面。Provider ID 是每个配置的提供者(Ollama、OpenAI 等)旁边显示的 UUID。


Usage / 使用方法

  1. Start a research / 开始研究: Enter a research question in the top search bar and click "Research". 在顶部搜索栏输入研究问题,点击 "Research"。

  2. Watch the tree grow / 观察树的生长: The ReactFlow canvas shows tasks as nodes. Running tasks pulse, completed tasks turn green, skipped duplicates turn yellow. ReactFlow 画布以节点形式展示任务。运行中的任务闪烁,已完成的变绿,跳过的重复项变黄。

  3. Control execution / 控制执行:

    • Pause / 暂停 - Stops dequeuing new tasks (running tasks finish) / 停止出队新任务(运行中的任务会完成)
    • Resume / 继续 - Resumes queue processing / 恢复队列处理
    • Stop / 停止 - Stops all processing / 停止所有处理
  4. Browse sources / 浏览来源: Click "Sources" to open the right sidebar. Toggle between flat and grouped views. Filter by keyword. Expand cards to see full content snippets. 点击 "Sources" 打开右侧边栏。切换平铺和分组视图。按关键词过滤。展开卡片查看完整内容摘要。

  5. View logs / 查看日志: Switch to the "Logs" tab in the right sidebar. Filter by level (Info/Warn/Error). 在右侧边栏切换到 "Logs" 标签页。按级别过滤(Info/Warn/Error)。

  6. Export results / 导出结果:

    • Markdown (.md) - Full research report / 完整研究报告
    • JSON (.json) - Structured task data / 结构化任务数据
    • TSV (.tsv) - Source links spreadsheet / 来源链接表格
  7. Session history / 会话历史: Click "History" to browse past sessions. Click any session to reload it on the canvas. Sessions persist across page refreshes via IndexedDB. 点击 "History" 浏览历史会话。点击任意会话在画布上重新加载。会话通过 IndexedDB 在页面刷新后持久保存。


Tech Stack / 技术栈

Layer / 层Technology / 技术
UI FrameworkReact 19
Build ToolVite 6
StylingTailwindCSS 3
Graph Visualization@xyflow/react (ReactFlow) 12
Search BackendVane (SearxNG + LLM)
LLMOllama (any compatible model)
PersistenceIndexedDB (browser-native)
DeduplicationTF-IDF Cosine Similarity

License / 许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Infinite Research / 无限研究

A recursive BFS-powered research engine that leverages Vane for AI-driven web search, automatically generating and exploring sub-questions to build a comprehensive knowledge tree.

基于递归广度优先搜索的研究引擎,利用 Vane 进行 AI 驱动的网络搜索,自动生成并探索子问题,构建完整的知识树。

ReactViteTailwindCSSReactFlow


Table of Contents / 目录


Features / 功能特性

Feature功能
Recursive BFS search with auto-generated sub-questions递归广度优先搜索,自动生成子问题
Interactive ReactFlow canvas with task tree visualization基于 ReactFlow 的交互式任务树可视化画布
TF-IDF cosine similarity deduplication (threshold 0.7)TF-IDF 余弦相似度去重(阈值 0.7)
Up to 3 concurrent search tasks最多 3 个并发搜索任务
Sources sidebar with flat/grouped views and content snippets来源侧边栏,支持平铺/分组视图和内容摘要
Execution logs with level filtering执行日志,支持级别过滤
Session history with IndexedDB persistence会话历史,IndexedDB 持久化存储
Export to Markdown, JSON, and TSV formats支持导出 Markdown、JSON、TSV 格式
Pause / Resume / Stop controls暂停 / 继续 / 停止控制

Architecture / 架构

graph TB
subgraph Browser ["Browser / 浏览器"]
UI["InputBar<br/>用户输入"]
Canvas["ReactFlow Canvas<br/>任务树画布"]
Sources["SourcesSidebar<br/>来源侧边栏"]
History["HistorySidebar<br/>历史侧边栏"]
Logs["LogsPanel<br/>日志面板"]
StatusBar["StatusBar<br/>状态栏"]
subgraph Engine ["TaskEngine / 任务引擎"]
Queue["BFS Queue<br/>广度优先队列"]
Runner["Concurrent Runner<br/>并发执行器 (max 3)"]
Dedup["TF-IDF Dedup<br/>TF-IDF 去重"]
end
subgraph Storage ["Storage / 存储"]
IDB["IndexedDB<br/>sessions + embeddings"]
end
end
subgraph Backend ["Vane Backend / Vane 后端"]
VaneAPI["Vane API<br/>/api/search"]
SearxNG["SearxNG<br/>搜索聚合"]
LLM["Local LLM<br/>本地大模型"]
end
UI -->|"query / 查询"| Engine
Engine -->|"tasks, logs / 任务, 日志"| Canvas
Engine -->|"tasks, logs"| Sources
Engine -->|"tasks, logs"| Logs
Engine -->|"stats / 统计"| StatusBar
Engine -->|"save / 保存"| IDB
History -->|"load session / 加载会话"| IDB
Runner -->|"POST /api/search"| VaneAPI
VaneAPI --> SearxNG
VaneAPI --> LLM
style Engine fill:#1e3a5f,stroke:#3b82f6
style Storage fill:#1e3a2f,stroke:#10b981
style Backend fill:#3a1e3f,stroke:#a855f7
Loading

Component Overview / 组件概览

src/
├── App.jsx # Main app, ReactFlow canvas, state management
│ # 主应用,ReactFlow 画布,状态管理
├── lib/
│ ├── searchApi.js # Vane API client, source normalization
│ │ # Vane API 客户端,来源数据标准化
│ ├── taskEngine.js # BFS engine, concurrency, logging, persistence
│ │ # BFS 引擎,并发控制,日志记录,持久化
│ ├── similarity.js # TF-IDF cosine similarity deduplication
│ │ # TF-IDF 余弦相似度去重
│ └── storage.js # IndexedDB wrapper (sessions + embeddings)
│ # IndexedDB 封装(会话 + 嵌入向量存储)
├── components/
│ ├── InputBar.jsx # Search input, controls, history toggle
│ │ # 搜索输入,控制按钮,历史切换
│ ├── TaskNode.jsx # ReactFlow custom node for each task
│ │ # ReactFlow 自定义任务节点
│ ├── SourcesSidebar.jsx # Right sidebar: sources + logs tabs
│ │ # 右侧边栏:来源 + 日志标签页
│ ├── HistorySidebar.jsx # Left sidebar: session history
│ │ # 左侧边栏:会话历史
│ ├── LogsPanel.jsx # Filterable execution log viewer
│ │ # 可过滤的执行日志查看器
│ └── StatusBar.jsx # Bottom stats bar
│ # 底部状态栏
└── styles/
└── index.css # Tailwind directives + animations
# Tailwind 指令 + 动画

Message Processing Flow / 消息处理流程

sequenceDiagram
participant U as User / 用户
participant E as TaskEngine / 任务引擎
participant V as Vane API
participant D as TF-IDF Dedup / 去重
participant S as IndexedDB
U->>E: Submit query / 提交查询
E->>E: Create root task (depth 0)<br/>创建根任务(深度 0)
E->>E: Add to BFS queue / 加入队列
loop BFS Processing / BFS 处理 (max 3 concurrent / 最多3并发)
E->>V: POST /api/search (query)
V-->>E: {message, sources[]}
E->>E: Store result + sources<br/>保存结果和来源
E->>V: POST /api/search (generate sub-tasks prompt)
V-->>E: JSON array of 1-3 sub-questions<br/>返回1-3个子问题
loop For each sub-question / 对每个子问题
E->>D: isDuplicate(subQuery, existingTasks, 0.7)
alt Similarity > 0.7 / 相似度 > 0.7
D-->>E: duplicate=true
E->>E: Mark as skipped / 标记为跳过
else Similarity <= 0.7 / 相似度 <= 0.7
D-->>E: duplicate=false
E->>E: Create task, add to queue<br/>创建任务,加入队列
end
end
E->>S: Debounced save (500ms)<br/>防抖保存(500毫秒)
E-->>U: Update UI (tasks, logs, stats)<br/>更新界面(任务,日志,统计)
end
Loading

Task Lifecycle / 任务生命周期

stateDiagram-v2
[*] --> pending: Created / 创建
pending --> running: Dequeued / 出队执行
running --> completed: Search + sub-tasks done / 搜索+子任务完成
running --> failed: Error / 错误
pending --> skipped: Duplicate detected / 检测到重复
completed --> [*]
failed --> [*]
skipped --> [*]
Loading

Prerequisites / 前置要求

Requirement / 要求Version / 版本
Node.js>= 18
npm>= 9
Vane (running instance)latest
Ollama (for Vane's LLM backend)latest
A chat model in Ollamae.g. llama3, gemma2, etc.
An embedding model in Ollamae.g. nomic-embed-text, etc.

Vane Installation / Vane 安装

Vane is a privacy-focused AI search engine that runs on your own hardware. It provides the search API that powers Infinite Research.

Vane 是一个注重隐私的 AI 搜索引擎,完全在本地硬件上运行。它为 Infinite Research 提供搜索 API。

Full documentation / 完整文档: github.com/ItzCrazyKns/Vane

Option A: Docker (Recommended / 推荐)

# Pull and run with bundled SearxNG# 拉取并运行(内置 SearxNG)
docker run -d \
-p 3000:3000 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:latest

For custom SearxNG instance / 使用自定义 SearxNG 实例:

docker run -d \
-p 3000:3000 \
-e SEARXNG_API_URL=http://your-searxng:8080 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:slim-latest

Option B: From Source / 从源码安装

git clone https://github.com/ItzCrazyKns/Vane.git
cd Vane
npm i
npm run build
npm run start

Configure Ollama for Vane / 为 Vane 配置 Ollama

  1. Install Ollama / 安装 Ollama: ollama.com

  2. Pull required models / 拉取所需模型:

    ollama pull <your-chat-model># e.g. llama3, gemma2, etc. / 对话模型
    ollama pull <your-embedding-model># e.g. nomic-embed-text, etc. / 嵌入模型
  3. Ensure Ollama listens on 0.0.0.0 (required for Docker or remote access): 确保 Ollama 监听 0.0.0.0(Docker 或远程访问时必需):

    Linux:

    # Edit /etc/systemd/system/ollama.service, add:# 编辑 /etc/systemd/system/ollama.service,添加:
    Environment="OLLAMA_HOST=0.0.0.0:11434"
    systemctl daemon-reload
    systemctl restart ollama

    macOS / Windows:

    OLLAMA_HOST=0.0.0.0:11434 ollama serve
  4. Open Vane at http://localhost:3000 and configure: 打开 Vane (http://localhost:3000) 并配置:

    • Select your Ollama chat model / 选择 Ollama 对话模型
    • Select your Ollama embedding model / 选择嵌入模型
    • Note the Provider ID shown in Vane's settings / 记下设置中显示的 Provider ID

App Installation / 应用安装

# Clone the repository / 克隆仓库
git clone <repository-url>cd gemma_claude
# Install dependencies / 安装依赖
npm install
# Copy env template and edit / 复制环境变量模板并编辑
cp .env.example .env
# Start development server / 启动开发服务器
npm run dev

The app will be available at http://localhost:5180.

应用将在 http://localhost:5180 启动。


Configuration / 配置

All configuration is managed through the .env file. Copy .env.example to .env and edit the values.

所有配置通过 .env 文件管理。将 .env.example 复制为 .env 并编辑其中的值。

cp .env.example .env

Environment Variables / 环境变量

Variable / 变量Default / 默认值Description / 说明
VITE_API_BASE/apiAPI base path (usually no need to change) / API 基础路径(通常无需修改)
VITE_VANE_TARGEThttp://localhost:3000Vane instance URL / Vane 实例地址
VITE_CHAT_PROVIDER_IDVane chat provider UUID / Vane 对话提供者 UUID
VITE_CHAT_MODEL_KEYChat model name in Ollama / Ollama 中的对话模型名称
VITE_EMBED_PROVIDER_IDVane embedding provider UUID / Vane 嵌入提供者 UUID
VITE_EMBED_MODEL_KEYEmbedding model name / 嵌入模型名称
VITE_MAX_CONCURRENT3Max parallel search tasks / 最大并行搜索任务数
VITE_SIMILARITY_THRESHOLD0.7TF-IDF dedup threshold (0–1) / TF-IDF 去重阈值
VITE_MAX_SUB_TASKS3Max sub-questions per task / 每个任务最大子问题数
VITE_FETCH_TIMEOUT600000API request timeout in ms (10 min) / API 请求超时(毫秒)
VITE_PORT5180Dev server port / 开发服务器端口

Example .env / 示例

# Vane APIVITE_API_BASE=/apiVITE_VANE_TARGET=http://localhost:3000# Models (find Provider ID in Vane settings)# 模型配置(在 Vane 设置页面找到 Provider ID)VITE_CHAT_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_CHAT_MODEL_KEY=your-chat-modelVITE_EMBED_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_EMBED_MODEL_KEY=your-embedding-model# Engine tuning / 引擎调优VITE_MAX_CONCURRENT=3VITE_SIMILARITY_THRESHOLD=0.7VITE_MAX_SUB_TASKS=3VITE_FETCH_TIMEOUT=600000# Dev server / 开发服务器VITE_PORT=5180

Finding your Provider ID / 查找 Provider ID: Open Vane's web UI, go to settings. The provider ID is a UUID shown next to each configured provider (Ollama, OpenAI, etc.).

打开 Vane 网页界面,进入设置页面。Provider ID 是每个配置的提供者(Ollama、OpenAI 等)旁边显示的 UUID。


Usage / 使用方法

  1. Start a research / 开始研究: Enter a research question in the top search bar and click "Research". 在顶部搜索栏输入研究问题,点击 "Research"。

  2. Watch the tree grow / 观察树的生长: The ReactFlow canvas shows tasks as nodes. Running tasks pulse, completed tasks turn green, skipped duplicates turn yellow. ReactFlow 画布以节点形式展示任务。运行中的任务闪烁,已完成的变绿,跳过的重复项变黄。

  3. Control execution / 控制执行:

    • Pause / 暂停 - Stops dequeuing new tasks (running tasks finish) / 停止出队新任务(运行中的任务会完成)
    • Resume / 继续 - Resumes queue processing / 恢复队列处理
    • Stop / 停止 - Stops all processing / 停止所有处理
  4. Browse sources / 浏览来源: Click "Sources" to open the right sidebar. Toggle between flat and grouped views. Filter by keyword. Expand cards to see full content snippets. 点击 "Sources" 打开右侧边栏。切换平铺和分组视图。按关键词过滤。展开卡片查看完整内容摘要。

  5. View logs / 查看日志: Switch to the "Logs" tab in the right sidebar. Filter by level (Info/Warn/Error). 在右侧边栏切换到 "Logs" 标签页。按级别过滤(Info/Warn/Error)。

  6. Export results / 导出结果:

    • Markdown (.md) - Full research report / 完整研究报告
    • JSON (.json) - Structured task data / 结构化任务数据
    • TSV (.tsv) - Source links spreadsheet / 来源链接表格
  7. Session history / 会话历史: Click "History" to browse past sessions. Click any session to reload it on the canvas. Sessions persist across page refreshes via IndexedDB. 点击 "History" 浏览历史会话。点击任意会话在画布上重新加载。会话通过 IndexedDB 在页面刷新后持久保存。


Tech Stack / 技术栈

Layer / 层Technology / 技术
UI FrameworkReact 19
Build ToolVite 6
StylingTailwindCSS 3
Graph Visualization@xyflow/react (ReactFlow) 12
Search BackendVane (SearxNG + LLM)
LLMOllama (any compatible model)
PersistenceIndexedDB (browser-native)
DeduplicationTF-IDF Cosine Similarity

License / 许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Infinite Research / 无限研究

A recursive BFS-powered research engine that leverages Vane for AI-driven web search, automatically generating and exploring sub-questions to build a comprehensive knowledge tree.

基于递归广度优先搜索的研究引擎,利用 Vane 进行 AI 驱动的网络搜索,自动生成并探索子问题,构建完整的知识树。

ReactViteTailwindCSSReactFlow


Table of Contents / 目录


Features / 功能特性

Feature功能
Recursive BFS search with auto-generated sub-questions递归广度优先搜索,自动生成子问题
Interactive ReactFlow canvas with task tree visualization基于 ReactFlow 的交互式任务树可视化画布
TF-IDF cosine similarity deduplication (threshold 0.7)TF-IDF 余弦相似度去重(阈值 0.7)
Up to 3 concurrent search tasks最多 3 个并发搜索任务
Sources sidebar with flat/grouped views and content snippets来源侧边栏,支持平铺/分组视图和内容摘要
Execution logs with level filtering执行日志,支持级别过滤
Session history with IndexedDB persistence会话历史,IndexedDB 持久化存储
Export to Markdown, JSON, and TSV formats支持导出 Markdown、JSON、TSV 格式
Pause / Resume / Stop controls暂停 / 继续 / 停止控制

Architecture / 架构

graph TB
subgraph Browser ["Browser / 浏览器"]
UI["InputBar<br/>用户输入"]
Canvas["ReactFlow Canvas<br/>任务树画布"]
Sources["SourcesSidebar<br/>来源侧边栏"]
History["HistorySidebar<br/>历史侧边栏"]
Logs["LogsPanel<br/>日志面板"]
StatusBar["StatusBar<br/>状态栏"]
subgraph Engine ["TaskEngine / 任务引擎"]
Queue["BFS Queue<br/>广度优先队列"]
Runner["Concurrent Runner<br/>并发执行器 (max 3)"]
Dedup["TF-IDF Dedup<br/>TF-IDF 去重"]
end
subgraph Storage ["Storage / 存储"]
IDB["IndexedDB<br/>sessions + embeddings"]
end
end
subgraph Backend ["Vane Backend / Vane 后端"]
VaneAPI["Vane API<br/>/api/search"]
SearxNG["SearxNG<br/>搜索聚合"]
LLM["Local LLM<br/>本地大模型"]
end
UI -->|"query / 查询"| Engine
Engine -->|"tasks, logs / 任务, 日志"| Canvas
Engine -->|"tasks, logs"| Sources
Engine -->|"tasks, logs"| Logs
Engine -->|"stats / 统计"| StatusBar
Engine -->|"save / 保存"| IDB
History -->|"load session / 加载会话"| IDB
Runner -->|"POST /api/search"| VaneAPI
VaneAPI --> SearxNG
VaneAPI --> LLM
style Engine fill:#1e3a5f,stroke:#3b82f6
style Storage fill:#1e3a2f,stroke:#10b981
style Backend fill:#3a1e3f,stroke:#a855f7
Loading

Component Overview / 组件概览

src/
├── App.jsx # Main app, ReactFlow canvas, state management
│ # 主应用,ReactFlow 画布,状态管理
├── lib/
│ ├── searchApi.js # Vane API client, source normalization
│ │ # Vane API 客户端,来源数据标准化
│ ├── taskEngine.js # BFS engine, concurrency, logging, persistence
│ │ # BFS 引擎,并发控制,日志记录,持久化
│ ├── similarity.js # TF-IDF cosine similarity deduplication
│ │ # TF-IDF 余弦相似度去重
│ └── storage.js # IndexedDB wrapper (sessions + embeddings)
│ # IndexedDB 封装(会话 + 嵌入向量存储)
├── components/
│ ├── InputBar.jsx # Search input, controls, history toggle
│ │ # 搜索输入,控制按钮,历史切换
│ ├── TaskNode.jsx # ReactFlow custom node for each task
│ │ # ReactFlow 自定义任务节点
│ ├── SourcesSidebar.jsx # Right sidebar: sources + logs tabs
│ │ # 右侧边栏:来源 + 日志标签页
│ ├── HistorySidebar.jsx # Left sidebar: session history
│ │ # 左侧边栏:会话历史
│ ├── LogsPanel.jsx # Filterable execution log viewer
│ │ # 可过滤的执行日志查看器
│ └── StatusBar.jsx # Bottom stats bar
│ # 底部状态栏
└── styles/
└── index.css # Tailwind directives + animations
# Tailwind 指令 + 动画

Message Processing Flow / 消息处理流程

sequenceDiagram
participant U as User / 用户
participant E as TaskEngine / 任务引擎
participant V as Vane API
participant D as TF-IDF Dedup / 去重
participant S as IndexedDB
U->>E: Submit query / 提交查询
E->>E: Create root task (depth 0)<br/>创建根任务(深度 0)
E->>E: Add to BFS queue / 加入队列
loop BFS Processing / BFS 处理 (max 3 concurrent / 最多3并发)
E->>V: POST /api/search (query)
V-->>E: {message, sources[]}
E->>E: Store result + sources<br/>保存结果和来源
E->>V: POST /api/search (generate sub-tasks prompt)
V-->>E: JSON array of 1-3 sub-questions<br/>返回1-3个子问题
loop For each sub-question / 对每个子问题
E->>D: isDuplicate(subQuery, existingTasks, 0.7)
alt Similarity > 0.7 / 相似度 > 0.7
D-->>E: duplicate=true
E->>E: Mark as skipped / 标记为跳过
else Similarity <= 0.7 / 相似度 <= 0.7
D-->>E: duplicate=false
E->>E: Create task, add to queue<br/>创建任务,加入队列
end
end
E->>S: Debounced save (500ms)<br/>防抖保存(500毫秒)
E-->>U: Update UI (tasks, logs, stats)<br/>更新界面(任务,日志,统计)
end
Loading

Task Lifecycle / 任务生命周期

stateDiagram-v2
[*] --> pending: Created / 创建
pending --> running: Dequeued / 出队执行
running --> completed: Search + sub-tasks done / 搜索+子任务完成
running --> failed: Error / 错误
pending --> skipped: Duplicate detected / 检测到重复
completed --> [*]
failed --> [*]
skipped --> [*]
Loading

Prerequisites / 前置要求

Requirement / 要求Version / 版本
Node.js>= 18
npm>= 9
Vane (running instance)latest
Ollama (for Vane's LLM backend)latest
A chat model in Ollamae.g. llama3, gemma2, etc.
An embedding model in Ollamae.g. nomic-embed-text, etc.

Vane Installation / Vane 安装

Vane is a privacy-focused AI search engine that runs on your own hardware. It provides the search API that powers Infinite Research.

Vane 是一个注重隐私的 AI 搜索引擎,完全在本地硬件上运行。它为 Infinite Research 提供搜索 API。

Full documentation / 完整文档: github.com/ItzCrazyKns/Vane

Option A: Docker (Recommended / 推荐)

# Pull and run with bundled SearxNG# 拉取并运行(内置 SearxNG)
docker run -d \
-p 3000:3000 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:latest

For custom SearxNG instance / 使用自定义 SearxNG 实例:

docker run -d \
-p 3000:3000 \
-e SEARXNG_API_URL=http://your-searxng:8080 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:slim-latest

Option B: From Source / 从源码安装

git clone https://github.com/ItzCrazyKns/Vane.git
cd Vane
npm i
npm run build
npm run start

Configure Ollama for Vane / 为 Vane 配置 Ollama

  1. Install Ollama / 安装 Ollama: ollama.com

  2. Pull required models / 拉取所需模型:

    ollama pull <your-chat-model># e.g. llama3, gemma2, etc. / 对话模型
    ollama pull <your-embedding-model># e.g. nomic-embed-text, etc. / 嵌入模型
  3. Ensure Ollama listens on 0.0.0.0 (required for Docker or remote access): 确保 Ollama 监听 0.0.0.0(Docker 或远程访问时必需):

    Linux:

    # Edit /etc/systemd/system/ollama.service, add:# 编辑 /etc/systemd/system/ollama.service,添加:
    Environment="OLLAMA_HOST=0.0.0.0:11434"
    systemctl daemon-reload
    systemctl restart ollama

    macOS / Windows:

    OLLAMA_HOST=0.0.0.0:11434 ollama serve
  4. Open Vane at http://localhost:3000 and configure: 打开 Vane (http://localhost:3000) 并配置:

    • Select your Ollama chat model / 选择 Ollama 对话模型
    • Select your Ollama embedding model / 选择嵌入模型
    • Note the Provider ID shown in Vane's settings / 记下设置中显示的 Provider ID

App Installation / 应用安装

# Clone the repository / 克隆仓库
git clone <repository-url>cd gemma_claude
# Install dependencies / 安装依赖
npm install
# Copy env template and edit / 复制环境变量模板并编辑
cp .env.example .env
# Start development server / 启动开发服务器
npm run dev

The app will be available at http://localhost:5180.

应用将在 http://localhost:5180 启动。


Configuration / 配置

All configuration is managed through the .env file. Copy .env.example to .env and edit the values.

所有配置通过 .env 文件管理。将 .env.example 复制为 .env 并编辑其中的值。

cp .env.example .env

Environment Variables / 环境变量

Variable / 变量Default / 默认值Description / 说明
VITE_API_BASE/apiAPI base path (usually no need to change) / API 基础路径(通常无需修改)
VITE_VANE_TARGEThttp://localhost:3000Vane instance URL / Vane 实例地址
VITE_CHAT_PROVIDER_IDVane chat provider UUID / Vane 对话提供者 UUID
VITE_CHAT_MODEL_KEYChat model name in Ollama / Ollama 中的对话模型名称
VITE_EMBED_PROVIDER_IDVane embedding provider UUID / Vane 嵌入提供者 UUID
VITE_EMBED_MODEL_KEYEmbedding model name / 嵌入模型名称
VITE_MAX_CONCURRENT3Max parallel search tasks / 最大并行搜索任务数
VITE_SIMILARITY_THRESHOLD0.7TF-IDF dedup threshold (0–1) / TF-IDF 去重阈值
VITE_MAX_SUB_TASKS3Max sub-questions per task / 每个任务最大子问题数
VITE_FETCH_TIMEOUT600000API request timeout in ms (10 min) / API 请求超时(毫秒)
VITE_PORT5180Dev server port / 开发服务器端口

Example .env / 示例

# Vane APIVITE_API_BASE=/apiVITE_VANE_TARGET=http://localhost:3000# Models (find Provider ID in Vane settings)# 模型配置(在 Vane 设置页面找到 Provider ID)VITE_CHAT_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_CHAT_MODEL_KEY=your-chat-modelVITE_EMBED_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_EMBED_MODEL_KEY=your-embedding-model# Engine tuning / 引擎调优VITE_MAX_CONCURRENT=3VITE_SIMILARITY_THRESHOLD=0.7VITE_MAX_SUB_TASKS=3VITE_FETCH_TIMEOUT=600000# Dev server / 开发服务器VITE_PORT=5180

Finding your Provider ID / 查找 Provider ID: Open Vane's web UI, go to settings. The provider ID is a UUID shown next to each configured provider (Ollama, OpenAI, etc.).

打开 Vane 网页界面,进入设置页面。Provider ID 是每个配置的提供者(Ollama、OpenAI 等)旁边显示的 UUID。


Usage / 使用方法

  1. Start a research / 开始研究: Enter a research question in the top search bar and click "Research". 在顶部搜索栏输入研究问题,点击 "Research"。

  2. Watch the tree grow / 观察树的生长: The ReactFlow canvas shows tasks as nodes. Running tasks pulse, completed tasks turn green, skipped duplicates turn yellow. ReactFlow 画布以节点形式展示任务。运行中的任务闪烁,已完成的变绿,跳过的重复项变黄。

  3. Control execution / 控制执行:

    • Pause / 暂停 - Stops dequeuing new tasks (running tasks finish) / 停止出队新任务(运行中的任务会完成)
    • Resume / 继续 - Resumes queue processing / 恢复队列处理
    • Stop / 停止 - Stops all processing / 停止所有处理
  4. Browse sources / 浏览来源: Click "Sources" to open the right sidebar. Toggle between flat and grouped views. Filter by keyword. Expand cards to see full content snippets. 点击 "Sources" 打开右侧边栏。切换平铺和分组视图。按关键词过滤。展开卡片查看完整内容摘要。

  5. View logs / 查看日志: Switch to the "Logs" tab in the right sidebar. Filter by level (Info/Warn/Error). 在右侧边栏切换到 "Logs" 标签页。按级别过滤(Info/Warn/Error)。

  6. Export results / 导出结果:

    • Markdown (.md) - Full research report / 完整研究报告
    • JSON (.json) - Structured task data / 结构化任务数据
    • TSV (.tsv) - Source links spreadsheet / 来源链接表格
  7. Session history / 会话历史: Click "History" to browse past sessions. Click any session to reload it on the canvas. Sessions persist across page refreshes via IndexedDB. 点击 "History" 浏览历史会话。点击任意会话在画布上重新加载。会话通过 IndexedDB 在页面刷新后持久保存。


Tech Stack / 技术栈

Layer / 层Technology / 技术
UI FrameworkReact 19
Build ToolVite 6
StylingTailwindCSS 3
Graph Visualization@xyflow/react (ReactFlow) 12
Search BackendVane (SearxNG + LLM)
LLMOllama (any compatible model)
PersistenceIndexedDB (browser-native)
DeduplicationTF-IDF Cosine Similarity

License / 许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Infinite Research / 无限研究

A recursive BFS-powered research engine that leverages Vane for AI-driven web search, automatically generating and exploring sub-questions to build a comprehensive knowledge tree.

基于递归广度优先搜索的研究引擎,利用 Vane 进行 AI 驱动的网络搜索,自动生成并探索子问题,构建完整的知识树。

ReactViteTailwindCSSReactFlow


Table of Contents / 目录


Features / 功能特性

Feature功能
Recursive BFS search with auto-generated sub-questions递归广度优先搜索,自动生成子问题
Interactive ReactFlow canvas with task tree visualization基于 ReactFlow 的交互式任务树可视化画布
TF-IDF cosine similarity deduplication (threshold 0.7)TF-IDF 余弦相似度去重(阈值 0.7)
Up to 3 concurrent search tasks最多 3 个并发搜索任务
Sources sidebar with flat/grouped views and content snippets来源侧边栏,支持平铺/分组视图和内容摘要
Execution logs with level filtering执行日志,支持级别过滤
Session history with IndexedDB persistence会话历史,IndexedDB 持久化存储
Export to Markdown, JSON, and TSV formats支持导出 Markdown、JSON、TSV 格式
Pause / Resume / Stop controls暂停 / 继续 / 停止控制

Architecture / 架构

graph TB
subgraph Browser ["Browser / 浏览器"]
UI["InputBar<br/>用户输入"]
Canvas["ReactFlow Canvas<br/>任务树画布"]
Sources["SourcesSidebar<br/>来源侧边栏"]
History["HistorySidebar<br/>历史侧边栏"]
Logs["LogsPanel<br/>日志面板"]
StatusBar["StatusBar<br/>状态栏"]
subgraph Engine ["TaskEngine / 任务引擎"]
Queue["BFS Queue<br/>广度优先队列"]
Runner["Concurrent Runner<br/>并发执行器 (max 3)"]
Dedup["TF-IDF Dedup<br/>TF-IDF 去重"]
end
subgraph Storage ["Storage / 存储"]
IDB["IndexedDB<br/>sessions + embeddings"]
end
end
subgraph Backend ["Vane Backend / Vane 后端"]
VaneAPI["Vane API<br/>/api/search"]
SearxNG["SearxNG<br/>搜索聚合"]
LLM["Local LLM<br/>本地大模型"]
end
UI -->|"query / 查询"| Engine
Engine -->|"tasks, logs / 任务, 日志"| Canvas
Engine -->|"tasks, logs"| Sources
Engine -->|"tasks, logs"| Logs
Engine -->|"stats / 统计"| StatusBar
Engine -->|"save / 保存"| IDB
History -->|"load session / 加载会话"| IDB
Runner -->|"POST /api/search"| VaneAPI
VaneAPI --> SearxNG
VaneAPI --> LLM
style Engine fill:#1e3a5f,stroke:#3b82f6
style Storage fill:#1e3a2f,stroke:#10b981
style Backend fill:#3a1e3f,stroke:#a855f7
Loading

Component Overview / 组件概览

src/
├── App.jsx # Main app, ReactFlow canvas, state management
│ # 主应用,ReactFlow 画布,状态管理
├── lib/
│ ├── searchApi.js # Vane API client, source normalization
│ │ # Vane API 客户端,来源数据标准化
│ ├── taskEngine.js # BFS engine, concurrency, logging, persistence
│ │ # BFS 引擎,并发控制,日志记录,持久化
│ ├── similarity.js # TF-IDF cosine similarity deduplication
│ │ # TF-IDF 余弦相似度去重
│ └── storage.js # IndexedDB wrapper (sessions + embeddings)
│ # IndexedDB 封装(会话 + 嵌入向量存储)
├── components/
│ ├── InputBar.jsx # Search input, controls, history toggle
│ │ # 搜索输入,控制按钮,历史切换
│ ├── TaskNode.jsx # ReactFlow custom node for each task
│ │ # ReactFlow 自定义任务节点
│ ├── SourcesSidebar.jsx # Right sidebar: sources + logs tabs
│ │ # 右侧边栏:来源 + 日志标签页
│ ├── HistorySidebar.jsx # Left sidebar: session history
│ │ # 左侧边栏:会话历史
│ ├── LogsPanel.jsx # Filterable execution log viewer
│ │ # 可过滤的执行日志查看器
│ └── StatusBar.jsx # Bottom stats bar
│ # 底部状态栏
└── styles/
└── index.css # Tailwind directives + animations
# Tailwind 指令 + 动画

Message Processing Flow / 消息处理流程

sequenceDiagram
participant U as User / 用户
participant E as TaskEngine / 任务引擎
participant V as Vane API
participant D as TF-IDF Dedup / 去重
participant S as IndexedDB
U->>E: Submit query / 提交查询
E->>E: Create root task (depth 0)<br/>创建根任务(深度 0)
E->>E: Add to BFS queue / 加入队列
loop BFS Processing / BFS 处理 (max 3 concurrent / 最多3并发)
E->>V: POST /api/search (query)
V-->>E: {message, sources[]}
E->>E: Store result + sources<br/>保存结果和来源
E->>V: POST /api/search (generate sub-tasks prompt)
V-->>E: JSON array of 1-3 sub-questions<br/>返回1-3个子问题
loop For each sub-question / 对每个子问题
E->>D: isDuplicate(subQuery, existingTasks, 0.7)
alt Similarity > 0.7 / 相似度 > 0.7
D-->>E: duplicate=true
E->>E: Mark as skipped / 标记为跳过
else Similarity <= 0.7 / 相似度 <= 0.7
D-->>E: duplicate=false
E->>E: Create task, add to queue<br/>创建任务,加入队列
end
end
E->>S: Debounced save (500ms)<br/>防抖保存(500毫秒)
E-->>U: Update UI (tasks, logs, stats)<br/>更新界面(任务,日志,统计)
end
Loading

Task Lifecycle / 任务生命周期

stateDiagram-v2
[*] --> pending: Created / 创建
pending --> running: Dequeued / 出队执行
running --> completed: Search + sub-tasks done / 搜索+子任务完成
running --> failed: Error / 错误
pending --> skipped: Duplicate detected / 检测到重复
completed --> [*]
failed --> [*]
skipped --> [*]
Loading

Prerequisites / 前置要求

Requirement / 要求Version / 版本
Node.js>= 18
npm>= 9
Vane (running instance)latest
Ollama (for Vane's LLM backend)latest
A chat model in Ollamae.g. llama3, gemma2, etc.
An embedding model in Ollamae.g. nomic-embed-text, etc.

Vane Installation / Vane 安装

Vane is a privacy-focused AI search engine that runs on your own hardware. It provides the search API that powers Infinite Research.

Vane 是一个注重隐私的 AI 搜索引擎,完全在本地硬件上运行。它为 Infinite Research 提供搜索 API。

Full documentation / 完整文档: github.com/ItzCrazyKns/Vane

Option A: Docker (Recommended / 推荐)

# Pull and run with bundled SearxNG# 拉取并运行(内置 SearxNG)
docker run -d \
-p 3000:3000 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:latest

For custom SearxNG instance / 使用自定义 SearxNG 实例:

docker run -d \
-p 3000:3000 \
-e SEARXNG_API_URL=http://your-searxng:8080 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:slim-latest

Option B: From Source / 从源码安装

git clone https://github.com/ItzCrazyKns/Vane.git
cd Vane
npm i
npm run build
npm run start

Configure Ollama for Vane / 为 Vane 配置 Ollama

  1. Install Ollama / 安装 Ollama: ollama.com

  2. Pull required models / 拉取所需模型:

    ollama pull <your-chat-model># e.g. llama3, gemma2, etc. / 对话模型
    ollama pull <your-embedding-model># e.g. nomic-embed-text, etc. / 嵌入模型
  3. Ensure Ollama listens on 0.0.0.0 (required for Docker or remote access): 确保 Ollama 监听 0.0.0.0(Docker 或远程访问时必需):

    Linux:

    # Edit /etc/systemd/system/ollama.service, add:# 编辑 /etc/systemd/system/ollama.service,添加:
    Environment="OLLAMA_HOST=0.0.0.0:11434"
    systemctl daemon-reload
    systemctl restart ollama

    macOS / Windows:

    OLLAMA_HOST=0.0.0.0:11434 ollama serve
  4. Open Vane at http://localhost:3000 and configure: 打开 Vane (http://localhost:3000) 并配置:

    • Select your Ollama chat model / 选择 Ollama 对话模型
    • Select your Ollama embedding model / 选择嵌入模型
    • Note the Provider ID shown in Vane's settings / 记下设置中显示的 Provider ID

App Installation / 应用安装

# Clone the repository / 克隆仓库
git clone <repository-url>cd gemma_claude
# Install dependencies / 安装依赖
npm install
# Copy env template and edit / 复制环境变量模板并编辑
cp .env.example .env
# Start development server / 启动开发服务器
npm run dev

The app will be available at http://localhost:5180.

应用将在 http://localhost:5180 启动。


Configuration / 配置

All configuration is managed through the .env file. Copy .env.example to .env and edit the values.

所有配置通过 .env 文件管理。将 .env.example 复制为 .env 并编辑其中的值。

cp .env.example .env

Environment Variables / 环境变量

Variable / 变量Default / 默认值Description / 说明
VITE_API_BASE/apiAPI base path (usually no need to change) / API 基础路径(通常无需修改)
VITE_VANE_TARGEThttp://localhost:3000Vane instance URL / Vane 实例地址
VITE_CHAT_PROVIDER_IDVane chat provider UUID / Vane 对话提供者 UUID
VITE_CHAT_MODEL_KEYChat model name in Ollama / Ollama 中的对话模型名称
VITE_EMBED_PROVIDER_IDVane embedding provider UUID / Vane 嵌入提供者 UUID
VITE_EMBED_MODEL_KEYEmbedding model name / 嵌入模型名称
VITE_MAX_CONCURRENT3Max parallel search tasks / 最大并行搜索任务数
VITE_SIMILARITY_THRESHOLD0.7TF-IDF dedup threshold (0–1) / TF-IDF 去重阈值
VITE_MAX_SUB_TASKS3Max sub-questions per task / 每个任务最大子问题数
VITE_FETCH_TIMEOUT600000API request timeout in ms (10 min) / API 请求超时(毫秒)
VITE_PORT5180Dev server port / 开发服务器端口

Example .env / 示例

# Vane APIVITE_API_BASE=/apiVITE_VANE_TARGET=http://localhost:3000# Models (find Provider ID in Vane settings)# 模型配置(在 Vane 设置页面找到 Provider ID)VITE_CHAT_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_CHAT_MODEL_KEY=your-chat-modelVITE_EMBED_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_EMBED_MODEL_KEY=your-embedding-model# Engine tuning / 引擎调优VITE_MAX_CONCURRENT=3VITE_SIMILARITY_THRESHOLD=0.7VITE_MAX_SUB_TASKS=3VITE_FETCH_TIMEOUT=600000# Dev server / 开发服务器VITE_PORT=5180

Finding your Provider ID / 查找 Provider ID: Open Vane's web UI, go to settings. The provider ID is a UUID shown next to each configured provider (Ollama, OpenAI, etc.).

打开 Vane 网页界面,进入设置页面。Provider ID 是每个配置的提供者(Ollama、OpenAI 等)旁边显示的 UUID。


Usage / 使用方法

  1. Start a research / 开始研究: Enter a research question in the top search bar and click "Research". 在顶部搜索栏输入研究问题,点击 "Research"。

  2. Watch the tree grow / 观察树的生长: The ReactFlow canvas shows tasks as nodes. Running tasks pulse, completed tasks turn green, skipped duplicates turn yellow. ReactFlow 画布以节点形式展示任务。运行中的任务闪烁,已完成的变绿,跳过的重复项变黄。

  3. Control execution / 控制执行:

    • Pause / 暂停 - Stops dequeuing new tasks (running tasks finish) / 停止出队新任务(运行中的任务会完成)
    • Resume / 继续 - Resumes queue processing / 恢复队列处理
    • Stop / 停止 - Stops all processing / 停止所有处理
  4. Browse sources / 浏览来源: Click "Sources" to open the right sidebar. Toggle between flat and grouped views. Filter by keyword. Expand cards to see full content snippets. 点击 "Sources" 打开右侧边栏。切换平铺和分组视图。按关键词过滤。展开卡片查看完整内容摘要。

  5. View logs / 查看日志: Switch to the "Logs" tab in the right sidebar. Filter by level (Info/Warn/Error). 在右侧边栏切换到 "Logs" 标签页。按级别过滤(Info/Warn/Error)。

  6. Export results / 导出结果:

    • Markdown (.md) - Full research report / 完整研究报告
    • JSON (.json) - Structured task data / 结构化任务数据
    • TSV (.tsv) - Source links spreadsheet / 来源链接表格
  7. Session history / 会话历史: Click "History" to browse past sessions. Click any session to reload it on the canvas. Sessions persist across page refreshes via IndexedDB. 点击 "History" 浏览历史会话。点击任意会话在画布上重新加载。会话通过 IndexedDB 在页面刷新后持久保存。


Tech Stack / 技术栈

Layer / 层Technology / 技术
UI FrameworkReact 19
Build ToolVite 6
StylingTailwindCSS 3
Graph Visualization@xyflow/react (ReactFlow) 12
Search BackendVane (SearxNG + LLM)
LLMOllama (any compatible model)
PersistenceIndexedDB (browser-native)
DeduplicationTF-IDF Cosine Similarity

License / 许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Infinite Research / 无限研究

A recursive BFS-powered research engine that leverages Vane for AI-driven web search, automatically generating and exploring sub-questions to build a comprehensive knowledge tree.

基于递归广度优先搜索的研究引擎,利用 Vane 进行 AI 驱动的网络搜索,自动生成并探索子问题,构建完整的知识树。

ReactViteTailwindCSSReactFlow


Table of Contents / 目录


Features / 功能特性

Feature功能
Recursive BFS search with auto-generated sub-questions递归广度优先搜索,自动生成子问题
Interactive ReactFlow canvas with task tree visualization基于 ReactFlow 的交互式任务树可视化画布
TF-IDF cosine similarity deduplication (threshold 0.7)TF-IDF 余弦相似度去重(阈值 0.7)
Up to 3 concurrent search tasks最多 3 个并发搜索任务
Sources sidebar with flat/grouped views and content snippets来源侧边栏,支持平铺/分组视图和内容摘要
Execution logs with level filtering执行日志,支持级别过滤
Session history with IndexedDB persistence会话历史,IndexedDB 持久化存储
Export to Markdown, JSON, and TSV formats支持导出 Markdown、JSON、TSV 格式
Pause / Resume / Stop controls暂停 / 继续 / 停止控制

Architecture / 架构

graph TB
subgraph Browser ["Browser / 浏览器"]
UI["InputBar<br/>用户输入"]
Canvas["ReactFlow Canvas<br/>任务树画布"]
Sources["SourcesSidebar<br/>来源侧边栏"]
History["HistorySidebar<br/>历史侧边栏"]
Logs["LogsPanel<br/>日志面板"]
StatusBar["StatusBar<br/>状态栏"]
subgraph Engine ["TaskEngine / 任务引擎"]
Queue["BFS Queue<br/>广度优先队列"]
Runner["Concurrent Runner<br/>并发执行器 (max 3)"]
Dedup["TF-IDF Dedup<br/>TF-IDF 去重"]
end
subgraph Storage ["Storage / 存储"]
IDB["IndexedDB<br/>sessions + embeddings"]
end
end
subgraph Backend ["Vane Backend / Vane 后端"]
VaneAPI["Vane API<br/>/api/search"]
SearxNG["SearxNG<br/>搜索聚合"]
LLM["Local LLM<br/>本地大模型"]
end
UI -->|"query / 查询"| Engine
Engine -->|"tasks, logs / 任务, 日志"| Canvas
Engine -->|"tasks, logs"| Sources
Engine -->|"tasks, logs"| Logs
Engine -->|"stats / 统计"| StatusBar
Engine -->|"save / 保存"| IDB
History -->|"load session / 加载会话"| IDB
Runner -->|"POST /api/search"| VaneAPI
VaneAPI --> SearxNG
VaneAPI --> LLM
style Engine fill:#1e3a5f,stroke:#3b82f6
style Storage fill:#1e3a2f,stroke:#10b981
style Backend fill:#3a1e3f,stroke:#a855f7
Loading

Component Overview / 组件概览

src/
├── App.jsx # Main app, ReactFlow canvas, state management
│ # 主应用,ReactFlow 画布,状态管理
├── lib/
│ ├── searchApi.js # Vane API client, source normalization
│ │ # Vane API 客户端,来源数据标准化
│ ├── taskEngine.js # BFS engine, concurrency, logging, persistence
│ │ # BFS 引擎,并发控制,日志记录,持久化
│ ├── similarity.js # TF-IDF cosine similarity deduplication
│ │ # TF-IDF 余弦相似度去重
│ └── storage.js # IndexedDB wrapper (sessions + embeddings)
│ # IndexedDB 封装(会话 + 嵌入向量存储)
├── components/
│ ├── InputBar.jsx # Search input, controls, history toggle
│ │ # 搜索输入,控制按钮,历史切换
│ ├── TaskNode.jsx # ReactFlow custom node for each task
│ │ # ReactFlow 自定义任务节点
│ ├── SourcesSidebar.jsx # Right sidebar: sources + logs tabs
│ │ # 右侧边栏:来源 + 日志标签页
│ ├── HistorySidebar.jsx # Left sidebar: session history
│ │ # 左侧边栏:会话历史
│ ├── LogsPanel.jsx # Filterable execution log viewer
│ │ # 可过滤的执行日志查看器
│ └── StatusBar.jsx # Bottom stats bar
│ # 底部状态栏
└── styles/
└── index.css # Tailwind directives + animations
# Tailwind 指令 + 动画

Message Processing Flow / 消息处理流程

sequenceDiagram
participant U as User / 用户
participant E as TaskEngine / 任务引擎
participant V as Vane API
participant D as TF-IDF Dedup / 去重
participant S as IndexedDB
U->>E: Submit query / 提交查询
E->>E: Create root task (depth 0)<br/>创建根任务(深度 0)
E->>E: Add to BFS queue / 加入队列
loop BFS Processing / BFS 处理 (max 3 concurrent / 最多3并发)
E->>V: POST /api/search (query)
V-->>E: {message, sources[]}
E->>E: Store result + sources<br/>保存结果和来源
E->>V: POST /api/search (generate sub-tasks prompt)
V-->>E: JSON array of 1-3 sub-questions<br/>返回1-3个子问题
loop For each sub-question / 对每个子问题
E->>D: isDuplicate(subQuery, existingTasks, 0.7)
alt Similarity > 0.7 / 相似度 > 0.7
D-->>E: duplicate=true
E->>E: Mark as skipped / 标记为跳过
else Similarity <= 0.7 / 相似度 <= 0.7
D-->>E: duplicate=false
E->>E: Create task, add to queue<br/>创建任务,加入队列
end
end
E->>S: Debounced save (500ms)<br/>防抖保存(500毫秒)
E-->>U: Update UI (tasks, logs, stats)<br/>更新界面(任务,日志,统计)
end
Loading

Task Lifecycle / 任务生命周期

stateDiagram-v2
[*] --> pending: Created / 创建
pending --> running: Dequeued / 出队执行
running --> completed: Search + sub-tasks done / 搜索+子任务完成
running --> failed: Error / 错误
pending --> skipped: Duplicate detected / 检测到重复
completed --> [*]
failed --> [*]
skipped --> [*]
Loading

Prerequisites / 前置要求

Requirement / 要求Version / 版本
Node.js>= 18
npm>= 9
Vane (running instance)latest
Ollama (for Vane's LLM backend)latest
A chat model in Ollamae.g. llama3, gemma2, etc.
An embedding model in Ollamae.g. nomic-embed-text, etc.

Vane Installation / Vane 安装

Vane is a privacy-focused AI search engine that runs on your own hardware. It provides the search API that powers Infinite Research.

Vane 是一个注重隐私的 AI 搜索引擎,完全在本地硬件上运行。它为 Infinite Research 提供搜索 API。

Full documentation / 完整文档: github.com/ItzCrazyKns/Vane

Option A: Docker (Recommended / 推荐)

# Pull and run with bundled SearxNG# 拉取并运行(内置 SearxNG)
docker run -d \
-p 3000:3000 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:latest

For custom SearxNG instance / 使用自定义 SearxNG 实例:

docker run -d \
-p 3000:3000 \
-e SEARXNG_API_URL=http://your-searxng:8080 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:slim-latest

Option B: From Source / 从源码安装

git clone https://github.com/ItzCrazyKns/Vane.git
cd Vane
npm i
npm run build
npm run start

Configure Ollama for Vane / 为 Vane 配置 Ollama

  1. Install Ollama / 安装 Ollama: ollama.com

  2. Pull required models / 拉取所需模型:

    ollama pull <your-chat-model># e.g. llama3, gemma2, etc. / 对话模型
    ollama pull <your-embedding-model># e.g. nomic-embed-text, etc. / 嵌入模型
  3. Ensure Ollama listens on 0.0.0.0 (required for Docker or remote access): 确保 Ollama 监听 0.0.0.0(Docker 或远程访问时必需):

    Linux:

    # Edit /etc/systemd/system/ollama.service, add:# 编辑 /etc/systemd/system/ollama.service,添加:
    Environment="OLLAMA_HOST=0.0.0.0:11434"
    systemctl daemon-reload
    systemctl restart ollama

    macOS / Windows:

    OLLAMA_HOST=0.0.0.0:11434 ollama serve
  4. Open Vane at http://localhost:3000 and configure: 打开 Vane (http://localhost:3000) 并配置:

    • Select your Ollama chat model / 选择 Ollama 对话模型
    • Select your Ollama embedding model / 选择嵌入模型
    • Note the Provider ID shown in Vane's settings / 记下设置中显示的 Provider ID

App Installation / 应用安装

# Clone the repository / 克隆仓库
git clone <repository-url>cd gemma_claude
# Install dependencies / 安装依赖
npm install
# Copy env template and edit / 复制环境变量模板并编辑
cp .env.example .env
# Start development server / 启动开发服务器
npm run dev

The app will be available at http://localhost:5180.

应用将在 http://localhost:5180 启动。


Configuration / 配置

All configuration is managed through the .env file. Copy .env.example to .env and edit the values.

所有配置通过 .env 文件管理。将 .env.example 复制为 .env 并编辑其中的值。

cp .env.example .env

Environment Variables / 环境变量

Variable / 变量Default / 默认值Description / 说明
VITE_API_BASE/apiAPI base path (usually no need to change) / API 基础路径(通常无需修改)
VITE_VANE_TARGEThttp://localhost:3000Vane instance URL / Vane 实例地址
VITE_CHAT_PROVIDER_IDVane chat provider UUID / Vane 对话提供者 UUID
VITE_CHAT_MODEL_KEYChat model name in Ollama / Ollama 中的对话模型名称
VITE_EMBED_PROVIDER_IDVane embedding provider UUID / Vane 嵌入提供者 UUID
VITE_EMBED_MODEL_KEYEmbedding model name / 嵌入模型名称
VITE_MAX_CONCURRENT3Max parallel search tasks / 最大并行搜索任务数
VITE_SIMILARITY_THRESHOLD0.7TF-IDF dedup threshold (0–1) / TF-IDF 去重阈值
VITE_MAX_SUB_TASKS3Max sub-questions per task / 每个任务最大子问题数
VITE_FETCH_TIMEOUT600000API request timeout in ms (10 min) / API 请求超时(毫秒)
VITE_PORT5180Dev server port / 开发服务器端口

Example .env / 示例

# Vane APIVITE_API_BASE=/apiVITE_VANE_TARGET=http://localhost:3000# Models (find Provider ID in Vane settings)# 模型配置(在 Vane 设置页面找到 Provider ID)VITE_CHAT_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_CHAT_MODEL_KEY=your-chat-modelVITE_EMBED_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_EMBED_MODEL_KEY=your-embedding-model# Engine tuning / 引擎调优VITE_MAX_CONCURRENT=3VITE_SIMILARITY_THRESHOLD=0.7VITE_MAX_SUB_TASKS=3VITE_FETCH_TIMEOUT=600000# Dev server / 开发服务器VITE_PORT=5180

Finding your Provider ID / 查找 Provider ID: Open Vane's web UI, go to settings. The provider ID is a UUID shown next to each configured provider (Ollama, OpenAI, etc.).

打开 Vane 网页界面,进入设置页面。Provider ID 是每个配置的提供者(Ollama、OpenAI 等)旁边显示的 UUID。


Usage / 使用方法

  1. Start a research / 开始研究: Enter a research question in the top search bar and click "Research". 在顶部搜索栏输入研究问题,点击 "Research"。

  2. Watch the tree grow / 观察树的生长: The ReactFlow canvas shows tasks as nodes. Running tasks pulse, completed tasks turn green, skipped duplicates turn yellow. ReactFlow 画布以节点形式展示任务。运行中的任务闪烁,已完成的变绿,跳过的重复项变黄。

  3. Control execution / 控制执行:

    • Pause / 暂停 - Stops dequeuing new tasks (running tasks finish) / 停止出队新任务(运行中的任务会完成)
    • Resume / 继续 - Resumes queue processing / 恢复队列处理
    • Stop / 停止 - Stops all processing / 停止所有处理
  4. Browse sources / 浏览来源: Click "Sources" to open the right sidebar. Toggle between flat and grouped views. Filter by keyword. Expand cards to see full content snippets. 点击 "Sources" 打开右侧边栏。切换平铺和分组视图。按关键词过滤。展开卡片查看完整内容摘要。

  5. View logs / 查看日志: Switch to the "Logs" tab in the right sidebar. Filter by level (Info/Warn/Error). 在右侧边栏切换到 "Logs" 标签页。按级别过滤(Info/Warn/Error)。

  6. Export results / 导出结果:

    • Markdown (.md) - Full research report / 完整研究报告
    • JSON (.json) - Structured task data / 结构化任务数据
    • TSV (.tsv) - Source links spreadsheet / 来源链接表格
  7. Session history / 会话历史: Click "History" to browse past sessions. Click any session to reload it on the canvas. Sessions persist across page refreshes via IndexedDB. 点击 "History" 浏览历史会话。点击任意会话在画布上重新加载。会话通过 IndexedDB 在页面刷新后持久保存。


Tech Stack / 技术栈

Layer / 层Technology / 技术
UI FrameworkReact 19
Build ToolVite 6
StylingTailwindCSS 3
Graph Visualization@xyflow/react (ReactFlow) 12
Search BackendVane (SearxNG + LLM)
LLMOllama (any compatible model)
PersistenceIndexedDB (browser-native)
DeduplicationTF-IDF Cosine Similarity

License / 许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Infinite Research / 无限研究

A recursive BFS-powered research engine that leverages Vane for AI-driven web search, automatically generating and exploring sub-questions to build a comprehensive knowledge tree.

基于递归广度优先搜索的研究引擎,利用 Vane 进行 AI 驱动的网络搜索,自动生成并探索子问题,构建完整的知识树。

ReactViteTailwindCSSReactFlow


Table of Contents / 目录


Features / 功能特性

Feature功能
Recursive BFS search with auto-generated sub-questions递归广度优先搜索,自动生成子问题
Interactive ReactFlow canvas with task tree visualization基于 ReactFlow 的交互式任务树可视化画布
TF-IDF cosine similarity deduplication (threshold 0.7)TF-IDF 余弦相似度去重(阈值 0.7)
Up to 3 concurrent search tasks最多 3 个并发搜索任务
Sources sidebar with flat/grouped views and content snippets来源侧边栏,支持平铺/分组视图和内容摘要
Execution logs with level filtering执行日志,支持级别过滤
Session history with IndexedDB persistence会话历史,IndexedDB 持久化存储
Export to Markdown, JSON, and TSV formats支持导出 Markdown、JSON、TSV 格式
Pause / Resume / Stop controls暂停 / 继续 / 停止控制

Architecture / 架构

graph TB
subgraph Browser ["Browser / 浏览器"]
UI["InputBar<br/>用户输入"]
Canvas["ReactFlow Canvas<br/>任务树画布"]
Sources["SourcesSidebar<br/>来源侧边栏"]
History["HistorySidebar<br/>历史侧边栏"]
Logs["LogsPanel<br/>日志面板"]
StatusBar["StatusBar<br/>状态栏"]
subgraph Engine ["TaskEngine / 任务引擎"]
Queue["BFS Queue<br/>广度优先队列"]
Runner["Concurrent Runner<br/>并发执行器 (max 3)"]
Dedup["TF-IDF Dedup<br/>TF-IDF 去重"]
end
subgraph Storage ["Storage / 存储"]
IDB["IndexedDB<br/>sessions + embeddings"]
end
end
subgraph Backend ["Vane Backend / Vane 后端"]
VaneAPI["Vane API<br/>/api/search"]
SearxNG["SearxNG<br/>搜索聚合"]
LLM["Local LLM<br/>本地大模型"]
end
UI -->|"query / 查询"| Engine
Engine -->|"tasks, logs / 任务, 日志"| Canvas
Engine -->|"tasks, logs"| Sources
Engine -->|"tasks, logs"| Logs
Engine -->|"stats / 统计"| StatusBar
Engine -->|"save / 保存"| IDB
History -->|"load session / 加载会话"| IDB
Runner -->|"POST /api/search"| VaneAPI
VaneAPI --> SearxNG
VaneAPI --> LLM
style Engine fill:#1e3a5f,stroke:#3b82f6
style Storage fill:#1e3a2f,stroke:#10b981
style Backend fill:#3a1e3f,stroke:#a855f7
Loading

Component Overview / 组件概览

src/
├── App.jsx # Main app, ReactFlow canvas, state management
│ # 主应用,ReactFlow 画布,状态管理
├── lib/
│ ├── searchApi.js # Vane API client, source normalization
│ │ # Vane API 客户端,来源数据标准化
│ ├── taskEngine.js # BFS engine, concurrency, logging, persistence
│ │ # BFS 引擎,并发控制,日志记录,持久化
│ ├── similarity.js # TF-IDF cosine similarity deduplication
│ │ # TF-IDF 余弦相似度去重
│ └── storage.js # IndexedDB wrapper (sessions + embeddings)
│ # IndexedDB 封装(会话 + 嵌入向量存储)
├── components/
│ ├── InputBar.jsx # Search input, controls, history toggle
│ │ # 搜索输入,控制按钮,历史切换
│ ├── TaskNode.jsx # ReactFlow custom node for each task
│ │ # ReactFlow 自定义任务节点
│ ├── SourcesSidebar.jsx # Right sidebar: sources + logs tabs
│ │ # 右侧边栏:来源 + 日志标签页
│ ├── HistorySidebar.jsx # Left sidebar: session history
│ │ # 左侧边栏:会话历史
│ ├── LogsPanel.jsx # Filterable execution log viewer
│ │ # 可过滤的执行日志查看器
│ └── StatusBar.jsx # Bottom stats bar
│ # 底部状态栏
└── styles/
└── index.css # Tailwind directives + animations
# Tailwind 指令 + 动画

Message Processing Flow / 消息处理流程

sequenceDiagram
participant U as User / 用户
participant E as TaskEngine / 任务引擎
participant V as Vane API
participant D as TF-IDF Dedup / 去重
participant S as IndexedDB
U->>E: Submit query / 提交查询
E->>E: Create root task (depth 0)<br/>创建根任务(深度 0)
E->>E: Add to BFS queue / 加入队列
loop BFS Processing / BFS 处理 (max 3 concurrent / 最多3并发)
E->>V: POST /api/search (query)
V-->>E: {message, sources[]}
E->>E: Store result + sources<br/>保存结果和来源
E->>V: POST /api/search (generate sub-tasks prompt)
V-->>E: JSON array of 1-3 sub-questions<br/>返回1-3个子问题
loop For each sub-question / 对每个子问题
E->>D: isDuplicate(subQuery, existingTasks, 0.7)
alt Similarity > 0.7 / 相似度 > 0.7
D-->>E: duplicate=true
E->>E: Mark as skipped / 标记为跳过
else Similarity <= 0.7 / 相似度 <= 0.7
D-->>E: duplicate=false
E->>E: Create task, add to queue<br/>创建任务,加入队列
end
end
E->>S: Debounced save (500ms)<br/>防抖保存(500毫秒)
E-->>U: Update UI (tasks, logs, stats)<br/>更新界面(任务,日志,统计)
end
Loading

Task Lifecycle / 任务生命周期

stateDiagram-v2
[*] --> pending: Created / 创建
pending --> running: Dequeued / 出队执行
running --> completed: Search + sub-tasks done / 搜索+子任务完成
running --> failed: Error / 错误
pending --> skipped: Duplicate detected / 检测到重复
completed --> [*]
failed --> [*]
skipped --> [*]
Loading

Prerequisites / 前置要求

Requirement / 要求Version / 版本
Node.js>= 18
npm>= 9
Vane (running instance)latest
Ollama (for Vane's LLM backend)latest
A chat model in Ollamae.g. llama3, gemma2, etc.
An embedding model in Ollamae.g. nomic-embed-text, etc.

Vane Installation / Vane 安装

Vane is a privacy-focused AI search engine that runs on your own hardware. It provides the search API that powers Infinite Research.

Vane 是一个注重隐私的 AI 搜索引擎,完全在本地硬件上运行。它为 Infinite Research 提供搜索 API。

Full documentation / 完整文档: github.com/ItzCrazyKns/Vane

Option A: Docker (Recommended / 推荐)

# Pull and run with bundled SearxNG# 拉取并运行(内置 SearxNG)
docker run -d \
-p 3000:3000 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:latest

For custom SearxNG instance / 使用自定义 SearxNG 实例:

docker run -d \
-p 3000:3000 \
-e SEARXNG_API_URL=http://your-searxng:8080 \
-v vane-data:/home/vane/data \
--name vane \
itzcrazykns1337/vane:slim-latest

Option B: From Source / 从源码安装

git clone https://github.com/ItzCrazyKns/Vane.git
cd Vane
npm i
npm run build
npm run start

Configure Ollama for Vane / 为 Vane 配置 Ollama

  1. Install Ollama / 安装 Ollama: ollama.com

  2. Pull required models / 拉取所需模型:

    ollama pull <your-chat-model># e.g. llama3, gemma2, etc. / 对话模型
    ollama pull <your-embedding-model># e.g. nomic-embed-text, etc. / 嵌入模型
  3. Ensure Ollama listens on 0.0.0.0 (required for Docker or remote access): 确保 Ollama 监听 0.0.0.0(Docker 或远程访问时必需):

    Linux:

    # Edit /etc/systemd/system/ollama.service, add:# 编辑 /etc/systemd/system/ollama.service,添加:
    Environment="OLLAMA_HOST=0.0.0.0:11434"
    systemctl daemon-reload
    systemctl restart ollama

    macOS / Windows:

    OLLAMA_HOST=0.0.0.0:11434 ollama serve
  4. Open Vane at http://localhost:3000 and configure: 打开 Vane (http://localhost:3000) 并配置:

    • Select your Ollama chat model / 选择 Ollama 对话模型
    • Select your Ollama embedding model / 选择嵌入模型
    • Note the Provider ID shown in Vane's settings / 记下设置中显示的 Provider ID

App Installation / 应用安装

# Clone the repository / 克隆仓库
git clone <repository-url>cd gemma_claude
# Install dependencies / 安装依赖
npm install
# Copy env template and edit / 复制环境变量模板并编辑
cp .env.example .env
# Start development server / 启动开发服务器
npm run dev

The app will be available at http://localhost:5180.

应用将在 http://localhost:5180 启动。


Configuration / 配置

All configuration is managed through the .env file. Copy .env.example to .env and edit the values.

所有配置通过 .env 文件管理。将 .env.example 复制为 .env 并编辑其中的值。

cp .env.example .env

Environment Variables / 环境变量

Variable / 变量Default / 默认值Description / 说明
VITE_API_BASE/apiAPI base path (usually no need to change) / API 基础路径(通常无需修改)
VITE_VANE_TARGEThttp://localhost:3000Vane instance URL / Vane 实例地址
VITE_CHAT_PROVIDER_IDVane chat provider UUID / Vane 对话提供者 UUID
VITE_CHAT_MODEL_KEYChat model name in Ollama / Ollama 中的对话模型名称
VITE_EMBED_PROVIDER_IDVane embedding provider UUID / Vane 嵌入提供者 UUID
VITE_EMBED_MODEL_KEYEmbedding model name / 嵌入模型名称
VITE_MAX_CONCURRENT3Max parallel search tasks / 最大并行搜索任务数
VITE_SIMILARITY_THRESHOLD0.7TF-IDF dedup threshold (0–1) / TF-IDF 去重阈值
VITE_MAX_SUB_TASKS3Max sub-questions per task / 每个任务最大子问题数
VITE_FETCH_TIMEOUT600000API request timeout in ms (10 min) / API 请求超时(毫秒)
VITE_PORT5180Dev server port / 开发服务器端口

Example .env / 示例

# Vane APIVITE_API_BASE=/apiVITE_VANE_TARGET=http://localhost:3000# Models (find Provider ID in Vane settings)# 模型配置(在 Vane 设置页面找到 Provider ID)VITE_CHAT_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_CHAT_MODEL_KEY=your-chat-modelVITE_EMBED_PROVIDER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxVITE_EMBED_MODEL_KEY=your-embedding-model# Engine tuning / 引擎调优VITE_MAX_CONCURRENT=3VITE_SIMILARITY_THRESHOLD=0.7VITE_MAX_SUB_TASKS=3VITE_FETCH_TIMEOUT=600000# Dev server / 开发服务器VITE_PORT=5180

Finding your Provider ID / 查找 Provider ID: Open Vane's web UI, go to settings. The provider ID is a UUID shown next to each configured provider (Ollama, OpenAI, etc.).

打开 Vane 网页界面,进入设置页面。Provider ID 是每个配置的提供者(Ollama、OpenAI 等)旁边显示的 UUID。


Usage / 使用方法

  1. Start a research / 开始研究: Enter a research question in the top search bar and click "Research". 在顶部搜索栏输入研究问题,点击 "Research"。

  2. Watch the tree grow / 观察树的生长: The ReactFlow canvas shows tasks as nodes. Running tasks pulse, completed tasks turn green, skipped duplicates turn yellow. ReactFlow 画布以节点形式展示任务。运行中的任务闪烁,已完成的变绿,跳过的重复项变黄。

  3. Control execution / 控制执行:

    • Pause / 暂停 - Stops dequeuing new tasks (running tasks finish) / 停止出队新任务(运行中的任务会完成)
    • Resume / 继续 - Resumes queue processing / 恢复队列处理
    • Stop / 停止 - Stops all processing / 停止所有处理
  4. Browse sources / 浏览来源: Click "Sources" to open the right sidebar. Toggle between flat and grouped views. Filter by keyword. Expand cards to see full content snippets. 点击 "Sources" 打开右侧边栏。切换平铺和分组视图。按关键词过滤。展开卡片查看完整内容摘要。

  5. View logs / 查看日志: Switch to the "Logs" tab in the right sidebar. Filter by level (Info/Warn/Error). 在右侧边栏切换到 "Logs" 标签页。按级别过滤(Info/Warn/Error)。

  6. Export results / 导出结果:

    • Markdown (.md) - Full research report / 完整研究报告
    • JSON (.json) - Structured task data / 结构化任务数据
    • TSV (.tsv) - Source links spreadsheet / 来源链接表格
  7. Session history / 会话历史: Click "History" to browse past sessions. Click any session to reload it on the canvas. Sessions persist across page refreshes via IndexedDB. 点击 "History" 浏览历史会话。点击任意会话在画布上重新加载。会话通过 IndexedDB 在页面刷新后持久保存。


Tech Stack / 技术栈

Layer / 层Technology / 技术
UI FrameworkReact 19
Build ToolVite 6
StylingTailwindCSS 3
Graph Visualization@xyflow/react (ReactFlow) 12
Search BackendVane (SearxNG + LLM)
LLMOllama (any compatible model)
PersistenceIndexedDB (browser-native)
DeduplicationTF-IDF Cosine Similarity

License / 许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages