An open API service indexing awesome lists of open source software.

https://github.com/kevinluosl/deepbot

DeepBot is a system-level AI assistant built for both personal productivity and enterprise workflows โ€” one-click setup, seamless experience, and native Feishu integration.
https://github.com/kevinluosl/deepbot

agent-skills agent-tools agentic-workflow agentos ai-agents harness harness-engineering openclaw

Last synced: about 1 month ago
JSON representation

DeepBot is a system-level AI assistant built for both personal productivity and enterprise workflows โ€” one-click setup, seamless experience, and native Feishu integration.

Awesome Lists containing this project

README

          

DeepBot Terminal

**Bring AI into your enterprise workflows โ€” a real working partner, not just a chatbot**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Node.js](https://img.shields.io/badge/Node.js-20+-green.svg)](https://nodejs.org/)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.3+-blue.svg)](https://www.typescriptlang.org/)
[![Electron](https://img.shields.io/badge/Electron-28+-9feaf9.svg)](https://www.electronjs.org/)

[English](README.md) | [็ฎ€ไฝ“ไธญๆ–‡](README_ZH.md)


---

## ๐Ÿ“– Introduction

DeepBot is a system-level AI assistant focused on enterprise productivity. It integrates deeply with existing enterprise systems, enabling AI to participate in day-to-day operations across departments through multi-Agent collaboration โ€” automating complex business workflows. Whether it's document processing, data analysis, system monitoring, or cross-department coordination, DeepBot handles it through AI Agent technology. It supports parallel task execution, scheduled tasks, and skill extensions, all protected by strict security controls.

### โœจ Core Features

- ๐ŸŽฏ **Parallel Task Processing** โ€” Run multiple tasks simultaneously without interference
- ๐Ÿ”ง **14 Built-in Tools** โ€” File operations, command execution, browser control, image generation, AI chat, cross-session messaging, web fetching, Feishu document operations, and more
- ๐Ÿง  **Memory System** โ€” Long-term memory for user preferences and important context
- โฐ **Scheduled Tasks** โ€” Automate recurring work with cron-based scheduling
- ๐ŸŽจ **Skill Extensions** โ€” Compose tools into reusable Skills for complex workflows
- ๐Ÿ”’ **Security Controls** โ€” Strict path whitelist to protect system access
- ๐Ÿค– **Multi-Model Support** โ€” Qwen, OpenAI, Claude, and more
- ๐ŸŒ **External Integrations** โ€” Connect with Feishu and other platforms for cross-platform interaction

---

## ๐Ÿš€ Quick Start

### Requirements

- **Python**: 3.11+
- **Node.js**: 20.0.0+ (optional, for running JS scripts)
- **pnpm**: 10.23.0+ (optional, for running JS scripts)
- **OS**: macOS, Windows (desktop), Linux/Docker

### Installation

```bash
# Clone the repository
git clone https://github.com/kevinluosl/deepbot.git
cd deepbot

# Install dependencies
pnpm install

# Start in development mode
pnpm run dev
```

### Build Desktop App

```bash
# Build for all platforms
pnpm run dist

# macOS (with code signing + notarization, requires Apple Developer account)
pnpm run dist:mac

# macOS local build (no signing, no notarization โ€” for development/testing)
pnpm run dist:mac:local

# Windows only
pnpm run dist:win
```

**`dist:mac` vs `dist:mac:local`**:

| | `dist:mac` | `dist:mac:local` |
|---|---|---|
| Code signing | โœ… Apple Developer ID | โŒ None |
| Notarization | โœ… Apple notarization | โŒ None |
| Gatekeeper | โœ… Passes verification | โŒ Triggers security warnings |
| Requirements | Apple Developer account + `.env` credentials | None |

To use `dist:mac`, configure the following in your `.env` file:

```bash
# Apple signing and notarization (macOS Electron builds only)
APPLE_ID=your-apple-id@example.com
APPLE_ID_PASSWORD=your-app-specific-password
APPLE_APP_SPECIFIC_PASSWORD=your-app-specific-password
APPLE_TEAM_ID=your-team-id
```

> You can generate an app-specific password at [appleid.apple.com](https://appleid.apple.com). The Team ID can be found in your [Apple Developer account](https://developer.apple.com/account).
| Use case | Production release | Local development / testing |

> **Note**: `dist:mac:local` builds will trigger macOS security warnings on first launch โ€” see the section below for how to handle them.

### Docker Deployment

Docker deployment is available for Linux servers. If you need the Docker version, please contact the author.

**Note for macOS builds**: Signed builds (`dist:mac`) pass Gatekeeper verification and work without issues. Local builds (`dist:mac:local`) are unsigned and will trigger security warnings โ€” see below for solutions.

### macOS Security Warnings (Local Builds)

When using `dist:mac:local` (unsigned builds), macOS may show security warnings on first launch:

#### "App is damaged"

Run this in Terminal, then reopen the app:

```bash
sudo xattr -rd com.apple.quarantine /Applications/DeepBot.app
```

#### "Cannot verify developer"

**Option 1: Right-click to open**

Right-click the app icon, select "Open", then click "Open" again in the dialog.

**Option 2: System Settings**

1. Try to open the app (you'll see a security warning โ€” click "Cancel")
2. Go to "System Settings" โ†’ "Privacy & Security"
3. Scroll to the "Security" section
4. Click "Open Anyway"
5. Try opening the app again and click "Open" in the dialog

---

## ๐Ÿ—๏ธ Architecture

DeepBot uses a modular architecture with support for multi-Agent communication and collaboration:

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ User Interface (Electron) โ”‚
โ”‚ External Communication: Feishu โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ IPC / WebSocket
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Gateway (Session Management) โ”‚
โ”‚ โ€ข Session per Tab โ”‚
โ”‚ โ€ข Message queue & routing โ”‚
โ”‚ โ€ข Connector management โ”‚
โ”‚ โ€ข Cross-Tab message routing ๐Ÿ†• โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ–ผ โ–ผ โ–ผ
Session 1 Session 2 Session N
(Tab 1) (Tab 2) (Tab N)
โ”‚ โ”‚ โ”‚
โ–ผ โ–ผ โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Agent Runtime (one per Session) โ”‚
โ”‚ โ€ข Intelligent decision & orchestrationโ”‚
โ”‚ โ€ข Auto-continue (up to 100 times) โ”‚
โ”‚ โ€ข Operation tracking (max 3 retries) โ”‚
โ”‚ โ€ข Independent memory & context โ”‚
โ”‚ โ€ข Cross-Tab calling tool ๐Ÿ†• โ”‚
โ”‚ โ€ข Dynamic system prompt assembly ๐Ÿ†• โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ System Prompt Assembly Layer ๐Ÿ†• โ”‚
โ”‚ โ€ข Base Agent prompt (AGENT.md) โ”‚
โ”‚ โ€ข Tool instructions (TOOLS.md) โ”‚
โ”‚ โ€ข Custom tool instructions โ”‚
โ”‚ โ€ข Global memory (MEMORY.md) โ”‚
โ”‚ โ€ข Per-tab memory (memory-.md) โ”‚
โ”‚ โ€ข Skills instructions (SKILL.md) โ”‚
โ”‚ โ€ข Dynamic loading & live updates โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 14 Tools + Security Check โ”‚
โ”‚ ๐Ÿ”’ Path whitelist โ€ข Workspace isolationโ”‚
โ”‚ ๐Ÿ”„ Cross-Tab messaging tool ๐Ÿ†• โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ–ผ โ–ผ โ–ผ
Skills Scheduled Data Storage
Tasks
```

### Multi-Agent Collaboration ๐Ÿ†•

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Enterprise Multi-Agent System โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ–ผ โ–ผ โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Sales โ”‚ โ”‚ Gateway โ”‚ โ”‚Marketingโ”‚
โ”‚AI Agent โ”‚ โ”‚Message โ”‚ โ”‚AI Agent โ”‚
โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ”‚Router โ”‚ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
โ”‚ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ–ผ โ–ผ โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚Solutionsโ”‚ โ”‚Product โ”‚ โ”‚ R&D โ”‚
โ”‚AI Agent โ”‚ โ”‚AI Agent โ”‚ โ”‚AI Agent โ”‚
โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
โ”‚ โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚Project โ”‚
โ”‚Manager โ”‚
โ”‚AI Agent โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Architecture Overview

- **Gateway**: Manages all Sessions. Each Tab maps to an independent Session with cross-Tab message routing.
- **Session**: An isolated conversation unit with its own Agent Runtime, memory, and context.
- **Agent Runtime**: Built on `@mariozechner/pi-agent-core`, handles intelligent decision-making and tool orchestration.
- **System Prompt Assembly Layer**: Dynamically assembles system prompts from base prompts, tool instructions, memory files, and Skills.
- **Tools**: 14 built-in tools including a cross-Tab messaging tool for inter-Agent communication.
- **Security Check**: All file and command operations are validated against a path whitelist.
- **Multi-Agent Collaboration**: Agents in different Tabs can message each other to collaborate on complex tasks.

#### System Prompt Assembly Flow ๐Ÿ†•

```
Agent starts โ†’ Load base Agent prompt (AGENT.md)
โ†“
Load tool instructions (TOOLS.md + CUSTOM-TOOLS.md)
โ†“
Load global memory (MEMORY.md)
โ†“
Load per-tab memory (memory-.md)
โ†“
Load Skills instructions (SKILL.md files)
โ†“
Assemble complete system prompt
โ†“
Send to AI model
```

**Dynamic Updates**:
- When memory files change, all Agent system prompts reload automatically
- Installing or uninstalling Skills updates tool instructions in real time
- Hot updates are supported โ€” no app restart required

---

## ๐ŸŒ External Integrations (Connectors)

DeepBot connects to external platforms via the Connector system for cross-platform interaction.

### Supported Platforms

#### Feishu (Lark)

Interact with DeepBot through a Feishu bot, supporting both direct messages and group chats.

**Features**:
- โœ… Direct messages (requires pairing authorization)
- โœ… Group messages (supports @mention)
- โœ… Message deduplication (prevents duplicate responses)
- โœ… Independent session per conversation (each chat gets its own Tab)
- โœ… Send images and files to users
- โœ… Feishu document operations (create, read, edit, delete, comment)

**Setup**:

1. In DeepBot, go to "System Settings" โ†’ "External Connections" โ†’ "Feishu"
2. Enter your Feishu app credentials (App ID, App Secret, Bot Name)
3. Configure security policies (DM policy, group policy)
4. Click "Save" then "Start" the connector

**Detailed Configuration Guide**:

๐Ÿ“– [Feishu Bot Configuration Guide](docs/้ฃžไนฆๆœบๅ™จไบบ้…็ฝฎๆŒ‡ๅ—.md) (Chinese)

Covers the full Feishu Open Platform setup, permission configuration, and security policy details.

### Coming Soon

- ๐Ÿ”œ Discord
- ๐Ÿ”œ Slack
- ๐Ÿ”œ WeCom (WeChat Work)
- ๐Ÿ”œ DingTalk

---

## ๐Ÿ”ง 14 Built-in Tools

| Tool | Function | Typical Use Cases |
|------|----------|-------------------|
| **File Tool** | File read/write | Read configs, save data, search files |
| **Exec Tool** | Run shell commands | Execute scripts, system operations, install packages |
| **Browser Tool** | Browser automation | Screenshots, web automation, content extraction |
| **Calendar Tool** | Calendar management | Check dates, calculate time, schedule reminders |
| **Environment Check** | System inspection | Detect system info, verify dependencies, diagnose issues |
| **Image Generation** | AI image generation | Create images, design assets, visual content |
| **Web Search** | Web search | Real-time queries, research, data collection |
| **Web Fetch** | Fetch web content | Extract articles, download page data |
| **Memory Tool** | Memory management | Store preferences, retrieve historical context |
| **Skill Manager** | Skill management | Install, uninstall, and list skill packages |
| **Scheduled Task** | Task scheduling | Create and manage cron-based tasks |
| **Chat Tool** | AI conversation | Internal AI calls, backend processing, isolated from main Agent context |
| **Cross Tab Call** ๐Ÿ†• | Cross-Tab messaging | Inter-Agent communication for multi-Agent collaboration |
| **Feishu Doc Tool** | Feishu document ops | Create, read, append, update, delete blocks, add comments |

### Creating Custom Tools

All tools use the unified `ToolPlugin` interface and live in `src/main/tools/`.

#### Quick Start

1. **Create a tool file**

Create a new file in `src/main/tools/` (e.g., `my-tool.ts`):

```typescript
import { Type } from '@sinclair/typebox';
import type { ToolPlugin } from './registry/tool-interface';
import { TOOL_NAMES } from './tool-names';

export const myToolPlugin: ToolPlugin = {
// ๅทฅๅ…ทๅ…ƒๆ•ฐๆฎ๏ผˆ็”จไบŽ UI ๅฑ•็คบๅ’Œ็ฎก็†๏ผ‰
metadata: {
id: 'my-tool', // ๅ”ฏไธ€ๆ ‡่ฏ†๏ผŒkebab-case
name: 'My Tool', // ๆ˜พ็คบๅ็งฐ๏ผˆ็ป™็”จๆˆท็œ‹๏ผ‰
description: 'My custom tool',
version: '1.0.0',
author: 'DeepBot',
category: 'custom', // ๅˆ†็ฑป๏ผšfile | network | system | ai | custom
tags: ['custom'],
},

// ๅˆ›ๅปบๅทฅๅ…ทๅฎžไพ‹๏ผŒๆŽฅๆ”ถ่ฟ่กŒๆ—ถไธŠไธ‹ๆ–‡๏ผˆๅทฅไฝœ็›ฎๅฝ•ใ€ไผš่ฏ IDใ€้…็ฝฎ็ญ‰๏ผ‰
create: (options) => ({
name: TOOL_NAMES.MY_TOOL, // AI ่ฐƒ็”จๆ—ถไฝฟ็”จ็š„ๅทฅๅ…ทๅ๏ผˆๅฟ…้กปๅœจ tool-names.ts ไธญๆณจๅ†Œ๏ผ‰
label: 'My Tool', // ๆ‰ง่กŒๆญฅ้ชคไธญๆ˜พ็คบ็š„ๆ ‡็ญพ
description: 'Execute custom operations', // ๅ‘Š่ฏ‰ AI ่ฟ™ไธชๅทฅๅ…ทๅšไป€ไนˆ
// ๅ‚ๆ•ฐๅฎšไน‰๏ผˆไฝฟ็”จ TypeBox๏ผŒAI ไผšๆ นๆฎ description ่‡ชๅŠจๅกซๅ……ๅ‚ๆ•ฐ๏ผ‰
// ๅธธ่งๅ‚ๆ•ฐ็ฑปๅž‹็คบไพ‹๏ผš
// Type.String({ description: '...' }) โ€” ๅญ—็ฌฆไธฒ
// Type.Number({ description: '...' }) โ€” ๆ•ฐๅญ—
// Type.Boolean({ description: '...' }) โ€” ๅธƒๅฐ”ๅ€ผ
// Type.Optional(Type.String({ description: '...' })) โ€” ๅฏ้€‰ๅ‚ๆ•ฐ
// Type.Union([Type.Literal('a'), Type.Literal('b')]) โ€” ๆžšไธพ๏ผˆAI ๅช่ƒฝ้€‰ๅ…ถไธญไธ€ไธช๏ผ‰
parameters: Type.Object({
action: Type.Union([
Type.Literal('search'),
Type.Literal('create'),
Type.Literal('delete'),
], { description: 'Operation type' }),
query: Type.String({ description: 'Search keyword or target name' }),
limit: Type.Optional(Type.Number({ description: 'Max results (default 10)' })),
force: Type.Optional(Type.Boolean({ description: 'Skip confirmation' })),
}),

execute: async (toolCallId, params, signal) => {
// signal: AbortSignal๏ผŒ็”จๆˆทๅœๆญขๆ—ถไผš่งฆๅ‘
// params: ๅทฒ็ป่ฟ‡ schema ้ชŒ่ฏ็š„ๅ‚ๆ•ฐๅฏน่ฑก

return {
// content: ่ฟ”ๅ›ž็ป™ AI ็š„ๅ†…ๅฎน๏ผˆAI ไผšๅŸบไบŽๆญคๅ†ณๅฎšไธ‹ไธ€ๆญฅ๏ผ‰
content: [{ type: 'text', text: 'Success' }],
// details: ็ป“ๆž„ๅŒ–ๆ•ฐๆฎ๏ผŒ็”จไบŽ UI ๆธฒๆŸ“ๆˆ–ๆ—ฅๅฟ—่ฎฐๅฝ•๏ผˆAI ไธๅฏ่ง๏ผ‰
details: { success: true },
};
},
}),
};
```

2. **Register in tool-loader.ts**

Edit `src/main/tools/registry/tool-loader.ts`:

```typescript
import { myToolPlugin } from '../my-tool';

// Inside loadTools(), add with other plugins:
tools.push(...await resolvePluginTools(myToolPlugin.create(pluginOpts)));
```

3. **Add tool name constant**

Edit `src/main/tools/tool-names.ts`:

```typescript
export const TOOL_NAMES = {
// ...existing tools
MY_TOOL: 'my_tool',
};
```

Then use `TOOL_NAMES.MY_TOOL` in your tool definition instead of the hardcoded string.

4. **Add tool instructions**

Edit `src/main/prompts/templates/CUSTOM-TOOLS.md` to document how the AI should use your tool.

Using the Email tool as an example:

````markdown
## Email (Email Sending Tool)

### Core Principles
1. SMTP must be configured before use
2. The config file path is fixed โ€” don't give users incorrect paths
3. On failure, guide users to fix their config based on the error message
4. Don't retry repeatedly โ€” report the failure reason after one attempt

### Prerequisites

**Config file path** (searched in priority order):
1. Project-level: `/.deepbot/tools/email-tool/config.json`
2. User-level: `~/.deepbot/tools/email-tool/config.json`

**Config file format**:
```json
{
"user": "your-email@example.com",
"password": "your-password-or-auth-code",
"smtpServer": "smtp.example.com",
"smtpPort": 465,
"useSsl": true,
"fromName": "Your Name"
}
```

**Common provider notes**:
- QQ Mail: Use authorization code, not your QQ password
- Gmail: Use an app-specific password
- 163 Mail: Enable SMTP service and use an authorization code

### Use Cases
- โœ… Notification emails, report emails
- โœ… Emails with attachments
- โœ… HTML-formatted emails
- โŒ Bulk marketing emails (risk of account suspension)
- โŒ Sensitive information (emails are not encrypted)

### Examples

1. Plain text email:
```json
{
"to": "recipient@example.com",
"subject": "Test Email",
"body": "This is a test email"
}
```

2. HTML email:
```json
{
"to": "team@company.com",
"subject": "Project Progress Report",
"body": "

Progress

  • Feature A: Done
",
"html": true
}
```

3. Email with attachment:
```json
{
"to": "client@example.com",
"subject": "Contract Documents",
"body": "Please find the contract attached",
"attachments": ["~/Documents/contract.pdf"]
}
```

### Error Handling

| Error | Cause | Fix |
|-------|-------|-----|
| "nodemailer not installed" | Missing dependency | Ask user to install nodemailer |
| "Email tool not configured" | Config file missing | Ask user to create the config file |
| "Authentication failed" | Wrong credentials | Check account and authorization code |
````

**Documentation structure**:
- **Core Principles**: Rules the AI must follow
- **Prerequisites**: Required setup (config files, dependencies)
- **Use Cases**: When to use or avoid this tool
- **Examples**: Real usage from simple to complex
- **Error Handling**: Common errors and how to resolve them

#### Advanced Features

- **Config files**: Read from `~/.deepbot/tools//config.json`
- **External dependencies**: Use dynamic `require()` to avoid bundling
- **Cancellation**: Support user cancellation via `AbortSignal`
- **Prompt management**: Document tool behavior in `CUSTOM-TOOLS.md` so the AI uses it correctly

#### References

- ๐Ÿ“– [Full Development Guide](src/main/tools/registry/TOOL-DEVELOPMENT-GUIDE.md)
- ๐Ÿ“ [Example Tool Template](src/main/tools/registry/example-tool.ts)
- ๐Ÿ”ง [Email Tool Example](src/main/tools/email-tool.ts) โ€” complete example with config and external dependencies

---

## ๐Ÿ”’ Security

DeepBot enforces strict access controls so AI Agents can only reach directories you've explicitly authorized.

### Path Whitelist

Only the following directories (and their subdirectories) are accessible:

| Type | Default Path | Purpose | Configurable |
|------|-------------|---------|--------------|
| **Workspace** | `~` (home directory) | File read/write, command execution | โœ… |
| **Scripts** | `~/.deepbot/scripts` | Python script storage | โœ… |
| **Skills** | `~/.agents/skills` | Skill package installation | โœ… |
| **Images** | `~/.deepbot/generated-images` | AI-generated image storage | โœ… |

### Security Check Flow

```
Tool call โ†’ Path security check โ†’ Within whitelist?
โ”œโ”€ Yes โ†’ Allow execution
โ””โ”€ No โ†’ Reject, return error
```

---

## ๐Ÿง  Memory System

DeepBot supports persistent long-term memory to retain user preferences and important context across sessions.

### Global Memory

- **Location**: `~/.deepbot/memory/MEMORY.md`
- **Format**: Structured Markdown
- **Auto-injection**: Loaded into every conversation's system prompt
- **Live updates**: Memory changes automatically reload all active Agents
- **Scope**: Shared across all Tabs โ€” stores general preferences and shared context

### Per-Tab Memory (Multi-Agent Support)

Each Tab (Agent) can have its own independent memory file, enabling true multi-role collaboration:

- **Independent memory files**: Each Tab can have its own `memory-.md`
- **Independent role definitions**: Different Tabs can take on different roles (e.g., Product Manager, Developer, QA Engineer)
- **Independent work styles**: Each Agent can have its own domain expertise and preferences
- **Persistent storage**: Tab memory and role settings are saved across sessions

### Usage Examples

**Global memory**:
```
User: "Remember: I prefer concise code"
DeepBot: "Got it, I'll keep that in mind"
```

**Per-tab memory**:
```
User: "Create a Sales Analysis Agent"
DeepBot: "New Tab created. This Agent will focus on customer relationship management and sales data analysis"

User: "Remember: You are a Sales Expert responsible for customer follow-up and performance analysis"
Sales Agent: "Understood, I've saved my role and responsibilities"
```

### Multi-Agent Collaboration Example

1. **Sales Agent** โ€” Customer relationship management and sales pipeline; stores customer info and sales strategies
2. **Marketing Agent** โ€” Market analysis and campaigns; stores market data and promotion plans
3. **Solutions Agent** โ€” Technical solution design and requirements analysis; stores solution templates and specs
4. **Product Agent** โ€” Product planning and backlog management; stores roadmaps and user feedback
5. **R&D Agent** โ€” Technical development and implementation; stores technical docs and coding standards
6. **Project Manager Agent** โ€” Project coordination and progress tracking; stores project plans and resource allocation

Each Agent operates with independent memory and domain expertise, enabling efficient cross-department collaboration.

---

## โฐ Scheduled Tasks

Create and manage scheduled tasks to automate recurring work:

### Features

- โœ… Cron expression support
- โœ… Dedicated Tab execution (locked, cannot be closed)
- โœ… Context reset between runs (retains last run's output as context)
- โœ… Execution history tracking

### Example

```
User: "Check desktop files every day at 9 AM"
DeepBot: "Scheduled task created โ€” will run daily at 9:00"
```

---

## ๐ŸŽจ Skill Extensions

The Skills system lets you compose multiple tools into reusable, complex workflows.

### Install an Existing Skill

```bash
# Use the Skill Manager tool in DeepBot
"Install weather skill"
```

### Create a Custom Skill

A Skill is a directory containing a `SKILL.md` file using YAML frontmatter + Markdown format.

#### 1. Create the Skill directory

```bash
mkdir -p ~/.agents/skills/my-skill
cd ~/.agents/skills/my-skill
```

#### 2. Create SKILL.md

````markdown
---
name: my-skill
description: My custom skill for handling specific tasks
version: 1.0.0
author: Your Name
---

# My Custom Skill

## When to use this skill

Use this skill when the user needs to:
- Operation 1
- Operation 2

## How to use

### Step 1: Read file

Use the file_read tool:

```json
{
"path": "~/example.txt"
}
```

### Step 2: Process data

Process the data as needed...

### Step 3: Save results

Use the file_write tool to save results...

## Notes

- Note 1
- Note 2
````

#### 3. Install the Skill

**Option 1: Direct placement** (recommended)

Place the Skill directory under `~/.agents/skills/` and restart DeepBot โ€” it will be loaded automatically.

**Option 2: Use Skill Manager**

```bash
"Install local skill at path ~/.agents/skills/my-skill"
```

### Skill Directory

- **Default path**: `~/.agents/skills/`
- **Auto-discovery**: All installed Skills are loaded at startup
- **Dynamic management**: Install and uninstall at runtime

### Skill Capabilities

- ๐Ÿ“– Skills can call all 14 built-in tools
- ๐Ÿ“ Supports async operations and error handling
- ๐Ÿ”ง Compose multiple tools for complex multi-step workflows

---

## ๐Ÿค– Supported AI Models

- **Qwen** (Alibaba Cloud) โ€” default model
- **OpenAI** (GPT-4, GPT-3.5)
- **Claude** (Anthropic)

Configure your API keys in System Settings to get started.

### โš ๏ธ Important: Avoid Reasoning Models

DeepBot is optimized for standard conversational models. Models with built-in thinking/reasoning modes can cause display issues with `...` tags, slower responses, and unnecessary overhead for simple tasks.

**Not recommended:**
- โŒ QwQ-32B-Preview
- โŒ OpenAI o1, o1-mini, o1-preview
- โŒ DeepSeek-R1
- โŒ Any model with explicit reasoning/thinking steps

---

## ๐Ÿ“ฆ External Services

| Service | Purpose | Configuration |
|---------|---------|---------------|
| **Tavily API** | Web search | System Settings โ†’ Web Search |
| **Gemini** | Image generation (Imagen 3) | System Settings โ†’ Image Generation |

---

## ๐Ÿ› ๏ธ Development Guide

### Project Structure

```
deepbot/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ main/ # Main process
โ”‚ โ”‚ โ”œโ”€โ”€ gateway.ts # Session management
โ”‚ โ”‚ โ”œโ”€โ”€ agent-runtime/ # Agent runtime
โ”‚ โ”‚ โ”œโ”€โ”€ tools/ # Tool system
โ”‚ โ”‚ โ”œโ”€โ”€ scheduled-tasks/ # Scheduled tasks
โ”‚ โ”‚ โ”œโ”€โ”€ connectors/ # External connectors
โ”‚ โ”‚ โ””โ”€โ”€ database/ # Data storage
โ”‚ โ”œโ”€โ”€ renderer/ # Renderer process (React)
โ”‚ โ”œโ”€โ”€ shared/ # Shared utilities
โ”‚ โ””โ”€โ”€ types/ # Type definitions
โ”œโ”€โ”€ docs/ # Documentation
โ””โ”€โ”€ scripts/ # Build scripts
```

---

## ๐Ÿ“ License

This project is licensed under the [MIT License](LICENSE).

---

## ๐Ÿ™ Acknowledgments

DeepBot was inspired by:

- [Clawdbot](https://github.com/openclaw/openclaw) โ€” architectural reference
- [@mariozechner/pi-agent-core](https://github.com/badlogic/pi-agent) โ€” AI Agent Runtime

---

## ๐Ÿ“ง Contact

- **Author**: Kevin Luo @ Deepglint
- **Issues**: [GitHub Issues](https://github.com/kevinluosl/deepbot/issues)

---

**โญ If DeepBot is useful to you, a star goes a long way!**