@QingQ77: 本地优先的多智能体协作桌面应用,把 AI 协作做成聊天一样的体验,支持多智能体任务分发、文件审查和人工审批。 https://github.com/lizyoko9/bitdance-agenthub… 一个基于 Next.js + El…
摘要
AgentHub 是一个本地优先的多智能体协作桌面应用,将 AI 协作做成聊天体验,支持任务分发、文件审查和人工审批,基于 Next.js 和 Electron 构建。
查看缓存全文
缓存时间: 2026/06/18 18:21
本地优先的多智能体协作桌面应用,把 AI 协作做成聊天一样的体验,支持多智能体任务分发、文件审查和人工审批。
https://github.com/lizyoko9/bitdance-agenthub…
一个基于 Next.js + Electron 的本地优先多智能体桌面应用,把 AI 协作做成了聊天的感觉。智能体像联系人一样列在会话列表里,每个会话是一个独立工作空间,文件、构建产物和部署预览都作为共享上下文。
lizyoko9/bitdance-agenthub
Source: https://github.com/lizyoko9/bitdance-agenthub
AgentHub
English · 简体中文
AgentHub is a local-first multi-agent workspace that turns AI collaboration into an IM-style experience.
Instead of treating every agent run as an isolated terminal transcript, AgentHub organizes work around conversations: agents are contacts, a conversation is a workspace, files and artifacts are shared context, and the Orchestrator can split work across multiple agents.
Current status: active local development. The app is usable as a web app and Electron desktop app; the mobile companion app is under development.
Contents
- Why AgentHub
- Features
- Tech Stack
- Requirements
- Quick Start
- Desktop App
- Mobile Companion
- Common Commands
- Architecture
- Security Model
- Known Limits
- Contributing
Why AgentHub
Modern coding agents are powerful, but real work often needs more than one prompt:
- keep multiple conversations and workspaces alive
- route work to different agents and models
- inspect reasoning, tool calls, file writes, command output, and artifacts
- approve risky changes before they touch the workspace
- continue from desktop, and eventually monitor from a phone
AgentHub is built for that workflow. It is local by default, uses SQLite, and keeps agent execution on your own machine.
Features
IM-style agent workspace
- Conversation list, group chats, mentions, unread state, bookmarks, pins, reply quoting, edit-and-resend, withdraw, and regenerate.
- Messages are structured parts, not one raw markdown blob: text, code, thinking, tool calls, tool results, attachments, artifact refs, deployment cards, and dispatch plans render differently.
- Tool calls are visible in the chat stream, including long bash commands and command output.
Multi-agent support
| Adapter | Use case |
|---|---|
| Claude Code | Uses @anthropic-ai/claude-agent-sdk, with Claude Code tools and session continuation. |
| Codex | Uses @openai/codex-sdk, with isolated AgentHub CODEX_HOME / CODEX_SQLITE_HOME. |
| Custom Agent | OpenAI Chat Completions-compatible providers such as OpenAI, DeepSeek, Volcano Ark, OpenRouter, SiliconFlow, and other compatible endpoints. |
| Mock | Local development without spending tokens. |
You can create custom agents in the UI with their own model, provider, system prompt, base URL, API key, and tool set.
Orchestrator and task dispatch
The Orchestrator is a normal agent with extra tools. It can:
- ask structured clarification questions
- create a task plan
- wait for plan approval or revision
- dispatch tasks to child agents
- track child task completion, failures, blockers, and artifacts
- aggregate the final answer back into the conversation
Workspace, files, and approvals
- Each conversation has a workspace.
- Sandbox mode stores files under
.agenthub-data/workspaces/<conversationId>. - Local mode binds a conversation to a real local project directory.
fs_read,fs_write, andbashare constrained to the effective workspace directory.- Review mode can require approval before file writes.
- High-risk bash commands can require approval before execution.
Artifacts and deployment previews
Agents can create and reference structured artifacts:
web_app: sandboxed iframe previewdocument: markdown renderingimage: image previewppt: slide preview and real.pptxexportcode_file: workspace file referencediff: version comparison
For local frontend projects, agents can deploy static output directories such as dist, build, out, or client/dist into a local preview card.
Desktop and mobile
- Electron desktop packaging is supported.
- A Capacitor mobile companion app lives in
apps/mobile. - The intended mobile workflow is companion-client style: phone connects to the desktop AgentHub host over LAN or Tailscale, then observes runs, sends messages, and handles approvals.
Tech Stack
- Next.js 16 App Router + React 19
- TypeScript strict mode
- Tailwind CSS v4 + shadcn/ui
- Zustand + Immer
- SQLite + Drizzle +
better-sqlite3 - SSE for live updates
- Electron 33 for desktop packaging
- Capacitor for the mobile companion app
- pnpm workspaces
Next.js is pinned to 16.2.6. If you modify framework-level behavior, read the local Next docs in node_modules/next/dist/docs/ first.
Requirements
- Node.js 20+
- pnpm
- macOS or Windows for the desktop app path
- Xcode and CocoaPods only if you work on the iOS companion app
Optional provider setup:
- Claude Code login for Claude Code adapter OAuth usage
- API keys for Anthropic, OpenAI, DeepSeek, Volcano Ark, or custom OpenAI-compatible providers
Quick Start
pnpm install
# Optional
cp .env.example .env.local
# Run dev
pnpm dev
Open:
http://localhost:3000
The app auto-creates the SQLite database and seeds the built-in agents on first startup.
You can configure API keys either in .env.local or in the app settings panel. Agent-specific keys override global settings.
Common env vars:
ANTHROPIC_API_KEY=...
OPENAI_API_KEY=...
DEEPSEEK_API_KEY=...
ARK_API_KEY=...
Claude Code can also work from an existing local Claude Code login without a separate Anthropic API key.
Desktop App
Development mode:
pnpm electron:dev
Default package command:
pnpm electron:build
Output goes to:
release/
The current package.json#build config targets:
- macOS:
dmg,arm64 - Windows:
nsis,x64
Specify Electron build platform
pnpm electron:build is a convenience script. If you want to choose the exact platform/arch, run the same prebuild pipeline and call electron-builder with platform flags:
# macOS arm64 DMG
pnpm build && pnpm electron:prebuild && pnpm electron:tsc && pnpm exec electron-builder --mac dmg --arm64
# macOS x64 DMG
pnpm build && pnpm electron:prebuild && pnpm electron:tsc && pnpm exec electron-builder --mac dmg --x64
# Windows x64 NSIS installer
pnpm build && pnpm electron:prebuild && pnpm electron:tsc && pnpm exec electron-builder --win nsis --x64
Short forms also work when you are calling electron-builder directly:
pnpm exec electron-builder -m --arm64
pnpm exec electron-builder -w --x64
Native modules matter here. better-sqlite3 is compiled for a specific Node/Electron ABI and CPU architecture. For reliable releases, build on the target OS/architecture or use a CI matrix. Cross-building Windows from macOS may require extra toolchain support such as Wine, and cross-building native modules across CPU architectures is not always reliable.
SQLite ABI notes
This project flips better-sqlite3 between Node ABI and Electron ABI depending on the command:
pnpm dev,pnpm test,pnpm e2e: Node ABIpnpm build,pnpm start,pnpm db:*, packaged Electron app: Electron ABI
The package scripts try to check and rebuild automatically. If you see a native module version error, run one of:
pnpm rebuild better-sqlite3
pnpm electron:rebuild
Then rerun the failed command.
Mobile Companion
Mobile app workspace:
apps/mobile
Useful commands:
pnpm mobile:dev
pnpm mobile:build
pnpm mobile:sync
pnpm mobile:open:ios
pnpm mobile:open:android
The mobile app is designed to connect to a desktop AgentHub host over LAN or Tailscale. Agent execution, file writes, command execution, and workspace state remain on the desktop side.
Common Commands
pnpm dev # Web dev server
pnpm typecheck # TypeScript check
pnpm lint # ESLint
pnpm test # Vitest
pnpm e2e # Playwright E2E
pnpm build # Next production build under Electron Node ABI
pnpm start # Start production server
pnpm db:push # Apply Drizzle schema
pnpm db:seed # Re-seed built-in agents
pnpm electron:dev # Desktop development mode
pnpm electron:build # Desktop package
Local data:
.agenthub-data/agenthub.db
.agenthub-data/workspaces/
Packaged desktop data:
macOS: ~/Library/Application Support/AgentHub/data
Windows: %APPDATA%/AgentHub/data
Architecture
AgentHub follows a five-layer structure:
L5 UI
React components, shadcn/ui, message/artifact rendering
L4 State + Transport
Zustand store, SSE client, reducers for StreamEvent
L3 Application Services
AgentRunner, ConversationService, EventBus, ToolExecutor
L2 Agent Platform Adapters
Claude Code, Codex, Custom OpenAI-compatible adapter, Mock
L1 Persistence
SQLite, Drizzle, workspace filesystem
The central contract is StreamEvent. Adapter output, tool activity, artifact creation, pending approvals, dispatch state, and usage updates flow through this event model before reaching the UI.
Key docs:
- CLAUDE.md: project rules for AI collaborators
- OVERVIEW.md: codebase map and current implementation status
- openspec/project.md: OpenSpec capability index
- specs/: detailed numbered specs
Security Model
AgentHub assumes LLM output is untrusted.
- File tools resolve paths under the conversation effective workspace.
- Bash commands run inside the workspace cwd.
- Dangerous bash patterns are blocked.
- Risky commands can require approval.
- Generated web app artifacts render in sandboxed iframes.
- API keys are local settings or environment variables; there is no hosted key service.
This is a local single-user app, not a multi-tenant hosted service.
Known Limits
- Linux desktop packaging is not configured yet.
- Cross-platform Electron builds with native modules should be handled through target-platform machines or CI.
- Claude Code SDK can write files through its own tool layer; sandbox quota enforcement only applies to AgentHub-managed file tools.
- Some SDK-level command/file approval bridges depend on what the underlying adapter exposes.
- The mobile app is a companion client, not a standalone agent runtime.
Contributing
Before making code changes, read:
- CLAUDE.md
- openspec/project.md
- Relevant files under openspec/specs and specs
When changing entities, stream events, tools, adapters, persistence, platform behavior, or security rules, update code and specs together.
License
AGPL-3.0-only. See LICENSE.
相似文章
@VincentLogic: 发现个挺有意思的 AI 助手客户端! Hermes Agent,界面做得挺清爽的中文桌面应用。功能集成得挺全: - 对话、会话管理 - 多模型支持 - 技能、工具集成 - 定时任务、网关配置 从界面看能帮你:搜索网页、设置提醒、总结邮件、…
Hermes Agent 是一款基于 Electron 开发的跨平台 AI 助手桌面客户端,支持多模型切换、技能集成与定时任务等功能,旨在为用户提供统一的 AI 效率工作台。
@geekbb: 让你同时跑多个 AI 编码智能体时不用在终端标签页里翻来找去,看板一眼看清谁在干活、谁在等你、谁已经做完。 https://github.com/lanes-sh/app
Lanes is a native macOS desktop application that serves as a mission control for managing multiple AI coding agents, featuring an issue board, live embedded terminals, and Git integration to streamline developer workflows.
@QingQ77: 用自然语言描述需求,AI Agent 自动拆解步骤、调用工具完成开发、文件操作、浏览器操控等任务,同时提供完整的编辑器与终端功能。 https://github.com/Liuchun-oss/codelf-agent… Codelf 是…
Codelf 是一个开源的桌面 AI 助理,可用自然语言描述需求,自动拆解步骤并调用工具完成开发、文件操作、浏览器操控等任务,同时提供完整的编辑器与终端功能,支持 DeepSeek、Claude、ChatGPT 等模型,对国内网络友好,具备本地 RAG 知识库能力。
@op7418: https://x.com/op7418/status/2057776589027594406
开源项目 AI Desk Card 将墨水屏硬件与 AI Agent 结合,智能显示日程、待办、GitHub 动态等信息,支持语音或文字交互,无需手机 App 配置。
@FakeMaidenMaker: 单一 Agent 用来生成图片、做数据分析、剪视频——每一项看起来能干,但想出一份完整的结果,往往得在 ChatGPT、Midjourney、Seedance、Excel 之间来回切五次。 给大家分享一个最近在用的开源项目 VRSEN/O…
介绍开源多智能体系统 OpenSwarm,8 个专业 agent 协同工作,从单个 prompt 在终端中生成幻灯片、研究报告、数据可视化等完整交付物,无需 GUI。