CrabAgent - AI Agent Platform with dual-mode (CLI + Serve)
Project description
๐ฆ CrabAgent
Your AI Knowledge Work Platform โ Not another coding assistant. A platform where AI agents learn your projects, remember your decisions, and grow with you. Runs in terminal, browser, or desktop.
CrabAgent is a local-first platform for knowledge work. You bring your projects and API keys. It brings a team of AI agents that remember what you did, learn how you work, and get smarter the more you use them.
Why CrabAgent
Most AI tools are temporary workers โ they help with one task, then forget everything. CrabAgent is different:
| What makes it special | What it means for you |
|---|---|
| ๐ง Project Memory | It remembers what you did in each project. Open it tomorrow and it picks up where you left off. |
| ๐ Learns your style | The more you use it, the better it understands your preferences, your code style, your decision patterns. |
| ๐ค AI Team | Specialized agents (coder, researcher, analyst, writer) that collaborate. Delegate, parallelize, chain into workflows. |
| ๐ Local-first | All data stays on your machine. API keys encrypted. No telemetry. No vendor lock-in. |
The difference compounds over time:
Day 1: "It's a helpful AI tool."
Week 1: "It remembers my project. Nice."
Month 1: "My entire workflow runs through it. Can't go back."
๐ฌ 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 that knows the difference between a newsletter and a real to-do.
๐ฌ 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
Notification sync: When an email arrives, the summary pushes to WeChat with full context injected โ so you can say "reply to that email" and the Agent knows exactly who and what.
Project Memory โ The Foundation
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 ่ง่
====================
This is not a summary generated on the fly. It's built from lessons your agents have already learned โ zero extra token cost, zero context cache invalidation.
Self-Evolving Agents
Every task teaches your agents something. After each run, they reflect on what worked (and what didn't) and store the insight permanently.
Dual-engine reflection
Agent completes a task
โ
โโ Rule engine (instant)
โ โโ "Too many iterations โ break tasks into smaller steps"
โ
โโ LLM reflection (1-3s)
โโ Extracts actionable lessons:
โ "DuckDuckGo returns fewer Chinese results โ use English keywords"
โ "Prefer web_scrape over web_search for unstable sites"
โโ Auto-filters generic praise ("completed in X steps")
โโ Learns from failures โ captures error patterns
Persistent memory layers
| 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 |
View growth
# TUI
/agent_stats coder
# โ Tasks: 23 Success: 91% Avg time: 14s
# โ Lessons: 18 (rule: 3, LLM: 15)
# Web UI: Agent Team โ Learning Stats
AI Team
Built-in 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
Real-time monitoring
- ๐ฃ Running โ step count, elapsed time, tool calls
- ๐ข Done โ duration, tokens, iterations
- ๐ด Error โ error summary
- Web: sidebar task board with split-view result comparison
Quick Start
pip install crabagent
crabagent init
# TUI โ interactive REPL with slash commands
crabagent
# Web UI
crabagent --serve # โ http://localhost:5210
# 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.9.7-arm64.dmg
# Or from pip install:
crabagent --build-desktop
Or run directly in your browser:
crabagent --serve # โ http://localhost:5210
Features
๐ง Project Memory
Remembers your project context across sessions. Zero extra cost.
๐ Intelligent Document Processing
AI agents can read, create, edit, and preview Office documents (.docx, .xlsx, .pptx) directly in conversations.
> Read sales.xlsx and summarize the Q1 data
> Create a project proposal document
> Update slide 3 title to "Q2 Roadmap"
Document panel opens alongside chat โ drag to resize, maximize for full view.
๐ผ๏ธ Multi-modal
Paste/drop images into conversations. Auto-detects vision model support.
๐ Browser Automation
pip install 'crabagent[browser]'
playwright install chromium
> Open https://news.ycombinator.com and show top 5
> Search Google for "Python async", extract results
๐ 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.
/molt rollback <id>
๐ง 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.
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.10.2.tar.gz.
File metadata
- Download URL: crabagent-0.10.2.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fe9d1cb2357363c906ccd6ee7c0aed28aaaf06db4a6b936dc0f87a5028ea4a1
|
|
| MD5 |
dac8f2360c62c980c71c831ad12ab467
|
|
| BLAKE2b-256 |
cd81daedbcfca62bdd82ebea1a84ed3bbf656a1d3bc8646578f0719816cf8d49
|
File details
Details for the file crabagent-0.10.2-py3-none-any.whl.
File metadata
- Download URL: crabagent-0.10.2-py3-none-any.whl
- Upload date:
- Size: 1.9 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 |
f051b14b5c25114f7bb36b136aabe8d63154506737a25b7ab1d780c9726fe9b7
|
|
| MD5 |
d7ff769461793f1845b61048ae4c882a
|
|
| BLAKE2b-256 |
e58e83d74439fd93a4b6a91d4935962afcd35a1276022eedf4f3435fa229e6ee
|