CrabAgent - AI Agent Platform with dual-mode (CLI + Serve)
Project description
๐ฆ CrabAgent
AI Knowledge Work Platform โ Chat when you need answers, Work when you need results. Two modes, one seamless experience. Runs in terminal, browser, or desktop.
CrabAgent is a local-first AI platform with two working modes that adapt to what you're doing:
| Chat Mode ๐ฌ | Work Mode ๐ ๏ธ | |
|---|---|---|
| Layout | Session list + conversation | AI sidebar + live workspace |
| Focus | Talk, ask, brainstorm | Create, edit, build |
| Right panel | โ | Document preview / code editor / prototype / meeting notes |
| Switch | Click ๐ ๏ธ icon in toolbar | Click ๐ฌ icon or AI auto-switches when opening files |
You don't pick a mode upfront. Start chatting, and when the AI starts working on a document or code file, the workspace slides open automatically. Switch back to Chat Mode anytime for a clean conversation view.
Chat Mode Work Mode
โโโโโโโโฌโโโโโโโโโโโโโโโ โโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
โ โ โ โ โ AI Chat โ Workspace โ
โ Sess โ Conversationโ โ ๐ฌโ Sidebar โ โโโโโโโโโโโโ โ
โ List โ โ โ โ (350px) โ โ Document โ โ
โ โ โ โ โ โ โ Preview โ โ
โ โ โ โ โ Input โ โ Code โ โ
โ โ โ โ โ โ โ Prototypeโ โ
โ โ โ โ โ โ โ Meeting โ โ
โโโโโโโโดโโโโโโโโโโโโโโโ โ โ โ โโโโโโโโโโโโ โ
โโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโโโโ
๐ฌ Chat Mode โ Pure Conversation
The default mode. Session list on the left, full-width conversation on the right. No distractions.
Best for:
- Asking questions and getting AI-powered answers
- Brainstorming and exploring ideas
- Quick research via web search and browser automation
- Delegating tasks to specialized AI agents (researcher, analyst, coder, writer)
- Multi-turn conversations with full project memory
You: "ๅธฎๆๅๆไธไธ่ฟไธช้กน็ฎ็ๆถๆ"
AI: [reads files, analyzes patterns, generates structured report]
You: "ๆๅๆ็ปๆๆด็ๆไธไปฝ Word ๆๆกฃ"
AI: [creates document] โ auto-switches to Work Mode with preview
๐ ๏ธ Work Mode โ AI + Live Workspace
When the AI creates or opens a file, the interface splits: AI chat shrinks to a 350px sidebar on the left, and the workspace takes over the right side. Everything the AI does is visible in real time.
Workspace types
| Type | What shows | Trigger |
|---|---|---|
| ๐ Document | Office document preview (.docx / .xlsx / .pptx) with outline, timeline, and inline edit |
AI creates/opens an Office file |
| ๐ป Code | Monaco-based code editor with syntax highlighting | AI works on a code file |
| ๐ฌ Prototype | Split-pane: source code on left, live preview on right | AI builds an HTML/JS prototype |
| ๐ Meeting | Structured meeting notes panel with action item extraction | You click "Start Meeting" |
Work Mode features
- Real-time preview: watch the AI edit a document and see changes reflected instantly
- Inline editing: double-click text in document preview to edit directly
- AI Edit toolbar: Bold, italic, font size, color โ one click to style selected text
- Natural language edit: type instructions like "make the heading red" and the AI applies it
- Document timeline: see the full history of AI operations on the document
- File browser: browse project files without leaving Work Mode
- One-click switch back to Chat Mode when you're done
Work Mode in action:
You: "่ฏปๅ sales.xlsx ๆฑๆป Q1 ๆฐๆฎ๏ผๅๆไธไปฝๆฅๅ"
โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AI Chat Sidebar โ Workspace (Document Preview) โ
โ โ โ
โ AI: Reading file... โ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ AI: Q1 total: $1.2M โ โ Q1 Sales Report โ โ
โ AI: Creating doc... โ โ โโโโโโโโโโโโโโโ โ โ
โ AI: Done! โ โ โ Total: $1.2M โ โ
โ โ โ Growth: +23% โ โ
โ [Input: continue...] โ โ ... โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ค AI Team
Both modes have access to a team of specialized agents:
| Agent | Role | Best for |
|---|---|---|
| Researcher | Web researcher | Search, browse, collect data |
| Analyst | Data analyst | Compare, identify patterns, generate reports |
| Coder | Code expert | Write, review, debug, refactor |
| Writer | Content writer | Write, edit, translate, format |
| Plan Creator | Task planner | Decompose complex tasks into workflows |
Orchestration modes
Delegate โ @researcher "find competitor pricing"
Parallel โ Run 3 agents simultaneously on different tasks
Pipeline โ research โ analyze โ write (with data flow)
Handoff โ Pass context from one agent to another
๐ฌ Email Intelligence โ Tasks from Inbox
CrabAgent watches your inbox and turns emails into action items โ automatically.
Incoming email: "ๆๅคฉไธๅ3็นๅผไผ่ฎจ่ฎบๆฐๅ่ฝ"
โ
โโ ๐ง LLM analyzes: meeting + deadline detected
โโ ๐ Drafts a reply for your review
โโ โ
Creates task: "ๅๅ ๅ
ณไบcrabagent็ไผ่ฎฎ" (due tomorrow 3PM)
โโ ๐ Links task to email conversation โ click to view full context
No rules, no regex. Just LLM-powered understanding.
๐ฌ WeChat Channel โ AI in Your Pocket
Bind your WeChat account via QR code, and CrabAgent becomes reachable from your phone.
You (WeChat): "็ไธไธ26ๅนด1ๆๆๅฅๅทฅไฝ"
โ
โโ ๐ค Agent processes with full project context
โโ ๐ฌ Replies directly in WeChat chat
โโ ๐ Pushes notifications: task overdue, scheduled task done, email summary
Three modes:
- Command execution โ send instructions from WeChat, Agent executes and replies
- Proactive notifications โ task deadlines, scheduled task results, email summaries auto-pushed
- Conversational โ multi-turn chat with full project memory
๐ง Project Memory & Self-Evolving Agents
Every time you work in a project, CrabAgent automatically extracts lessons and preferences. Next time you open it, it already knows:
=== ้กน็ฎไธไธๆ ===
ไธๆฌกๆดป่ท๏ผ06-05 15:30
ๆๆฏๆ ๏ผPython / FastAPI / SQLAlchemy
้กน็ฎ็ป้ช๏ผN+1 ๆฅ่ฏข็จ selectinload ไผๅ๏ผAPI ๆๆกฃ็จ OpenAPI ่ง่
====================
After each task, agents reflect on what worked (and what didn't) and store the insight permanently:
| Layer | Scope | What's stored |
|---|---|---|
| Project Memory | Per workspace | Recent lessons, tech stack, activity timeline |
| User Preferences | Per user | Communication style, tool preferences, rejected patterns |
| Agent Lessons | Per agent | Technical strategies, pitfalls, effective approaches |
Quick Start
pip install crabagent
crabagent init
# TUI โ interactive REPL with slash commands
crabagent
# Web UI โ Chat Mode & Work Mode
crabagent --serve # โ http://localhost:5210
# Default login: admin / xcl1989
# Single-shot CLI
crabagent "organize this directory"
Desktop App (macOS, development)
Build the Electron wrapper (requires Python + crabagent installed on your system):
# One-command build (from git clone):
make desktop
# โ electron/dist-electron/CrabAgent-0.10.5-arm64.dmg
# Or from pip install:
crabagent --build-desktop
Features
๐ ๏ธ Work Mode
Split-pane workspace with live document preview, code editor, prototype builder, meeting notes, and Markdown editor. AI chat sidebar stays interactive while you work.
๐ Markdown Editor
Split-pane editor for .md files โ source on the left, live rendered preview on the right. Bidirectional scroll sync, GFM tables, syntax-highlighted code blocks. Switch between Source / Split / Preview views.
๐ Intelligent Document Processing
AI agents can read, create, edit, and preview Office documents (.docx, .xlsx, .pptx) directly in conversations.
๐ง Project Memory
Remembers your project context across sessions. Zero extra cost.
๐ผ๏ธ Multi-modal
Paste/drop images into conversations. Auto-detects vision model support.
๐ Browser Automation
pip install 'crabagent[browser]'
playwright install chromium
๐ MCP Client
Connect external MCP servers (stdio + HTTP). Tools auto-discover and get prefixed.
โฑ Scheduled Tasks
> Open Hacker News at 9 AM every day and screenshot top 5
> Check product page every 30 min, notify me if below $500
๐ฆ Snapshots (Molt)
Auto-snapshot files before changes. Roll back anytime without Git.
๐ง Custom Tools
Drop a .py file in .crabagent/tools/ โ or let the AI create one for you in a conversation.
Installation
pip install crabagent # CLI + Web UI + API (all-in-one)
pip install 'crabagent[browser]' # Browser automation
pip install 'crabagent[memory]' # Semantic memory search (recommended)
pip install 'crabagent[dev]' # Testing + linting
Development
make install # Build frontend + install (editable)
ruff check src/ tests/ # Lint
ruff format src/ tests/ # Format
pytest # Run tests
CLI / TUI Commands
| Command | Description |
|---|---|
/exit, /quit |
Exit |
/help |
Help |
/clear |
Clear context |
/model [name] |
Switch model |
/models |
List models |
/provider [cmd] |
Manage providers |
/sessions / /session [id] |
List/load sessions |
/new |
New session |
/agents [cmd] |
Agent team management |
/agent [name] |
Switch agent |
/agent_stats <name> |
Agent growth stats |
/delegate [@agent] [task] |
Delegate task |
| `/memory [list | search |
/skills / /skill <name> |
List/view skills |
/molt [cmd] |
Snapshot management |
/todo [cmd] |
Todo management |
/export |
Export as Markdown |
/image <path> |
Send image |
/runs [agent] |
View run history |
/abort |
Abort execution |
Configuration
| Variable | Default | Description |
|---|---|---|
CRAB_DB_URL |
sqlite+aiosqlite:///./crabagent.db |
Database URL |
CRAB_JWT_SECRET |
auto-generated | JWT signing key |
CRAB_SERVE_HOST |
0.0.0.0 |
Server host |
CRAB_SERVE_PORT |
5210 |
Server port |
CRAB_MAX_ITERATIONS |
50 |
Max agent iterations |
CRAB_MAX_TOKENS |
4096 |
Max response tokens |
CRAB_BROWSER_HEADLESS |
true |
Browser headless mode |
CRAB_WEB_PROXY |
(empty) | HTTP proxy for web tools |
CRAB_MEMORY_EMBEDDING |
auto |
Memory vector search: auto / on / off |
Project Structure
CrabAgent/
โโโ src/crabagent/
โ โโโ cli/ # CLI + TUI
โ โโโ core/agent/ # Agent loop, tools, compression, agents
โ โโโ core/mcp/ # MCP client manager
โ โโโ core/ # Database, config, project memory, embedding
โ โโโ serve/ # FastAPI + API + scheduler
โโโ frontend/ # React SPA
โโโ electron/ # Electron desktop app
โโโ scripts/ # Build scripts
โโโ crabagent.spec # PyInstaller config
โโโ crabagent.db # SQLite database
License
GNU Affero General Public License v3 (AGPLv3) for non-commercial use. Commercial use requires a separate license. Contact the author.
See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crabagent-0.11.0.tar.gz.
File metadata
- Download URL: crabagent-0.11.0.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d1351285c66d85868e051762da9bbede9a68003995176f3ad89ccde786ba0b4
|
|
| MD5 |
159c31ef5d8cdec45c9f2ee17a6ef31a
|
|
| BLAKE2b-256 |
62e0a37f0fecf46d060c774dc2c531d561b0b1a017e339f9315e1a91c04bd6a0
|
File details
Details for the file crabagent-0.11.0-py3-none-any.whl.
File metadata
- Download URL: crabagent-0.11.0-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03c4354b7dc393ff1a914192a554cfab3dd201e710c1b1f885ad70124863c8d1
|
|
| MD5 |
c17f807f83792b91edcee9314caeea1d
|
|
| BLAKE2b-256 |
52ce816ea53bbd400434fd350bd56b4a42d5d5197d2da82f46e79b991919e5ad
|