CrabAgent - AI Agent Platform with dual-mode (CLI + Serve)
Project description
๐ฆ CrabAgent
AI Team Command Center โ Build a team of specialized AI agents that learn and improve over time. Delegate, parallelize, and watch them work in real-time from terminal or browser.
CrabAgent is a local-first AI agent platform. Run it from any project directory via CLI or browser. Your data stays local, your API keys are encrypted, and you pick any LLM provider.
Why CrabAgent
Unlike other agent platforms where agents are "temporary workers who forget everything," CrabAgent's agents learn and evolve:
| Capability | What it means |
|---|---|
| ๐ง Self-Evolving Agents | Agents auto-extract lessons from every task โ rule engine catches patterns, LLM reflection analyzes strategies. The more you use them, the smarter they get. |
| ๐ค AI Team | Custom agent profiles with per-agent tool whitelists and model overrides. Delegate, parallelize, or run multi-step pipelines. |
| ๐ Agent Growth Tracking | View each agent's stats: task count, success rate, lessons learned, common task categories. ctrl+space agent_stats |
| โฑ Scheduled + Real-time | Agents run on cron schedules or react to @mentions. Real-time streaming of every agent's output. |
| ๐ฆ Snapshots | Auto-snapshot files before changes. Roll back anytime without Git. |
| ๐ Local-first | All data stays on your machine. API keys encrypted at rest. No telemetry. |
Quick Start
pip install 'crabagent[serve]'
crabagent init
# TUI โ interactive REPL with slash commands
crabagent
# Web UI
crabagent --serve # โ http://localhost:5210
# Default login: admin / xcl1989
# Single-query CLI
crabagent "organize this directory"
crabagent -p deepseek -m deepseek-chat "write a Python script"
Self-Evolving Agents
This is CrabAgent's core differentiator. Agents don't just execute tasks โ they learn from every execution.
How it works
Sub-agent completes task
โ
โโ Rule Engine (instant)
โ โโ High iterations โ "Consider breaking tasks into smaller steps"
โ โโ Low iterations โ "Efficient execution pattern recorded"
โ โโ Source: rule
โ
โโ LLM Reflection (best-effort, ~1s)
โโ Analyzes strategy: what worked, what didn't
โโ Classifies task category: code / research / analysis / writing
โโ Source: llm
Knowledge persistence
- Team Knowledge: Tech stack, architecture decisions, user preferences โ auto-injected into every session
- Agent Lessons: Per-agent behavioral patterns โ loaded before similar tasks
- Task Records: Every execution logged (success, elapsed time, tokens, iterations)
Tracking growth
# TUI
/agent_stats coder
# โ ๆปไปปๅก: 23 ๆๅ็: 91% ๅนณๅ่ๆถ: 14s
# โ lessons: 18 (่งๅ: 7, LLM: 11)
# โ ๅธธ็จ็ฑปๅซ: code(14), analysis(4)
/memory list # Browse all knowledge
/memory search api # Keyword search
AI Team
Built-in agents
| Agent | Role | Best For |
|---|---|---|
| ๐ Researcher | Web research | Search, browse, data collection |
| ๐ Analyst | Data analysis | Comparison, pattern detection, reports |
| ๐ป Coder | Code expert | Write, review, debug, refactor |
| ๐ Writer | Content writer | Write, edit, translate, format |
Delegation
@researcher find competitor pricingโ @mention auto-delegates- Click an agent from the toolbar to insert a mention
/delegatecommand for interactive agent selectiondelegate_parallelruns multiple agents simultaneouslyrun_pipelinechains agents with dependencies
Real-time monitoring
- ๐ฃ Running โ live step count and timer
- ๐ข Done โ elapsed time, tokens, iterations
- ๐ด Error โ error summary
- Web: right-side Task Board with split-pane result comparison
More Features
๐ผ๏ธ Multimodal
Paste, upload, or drag images. Auto-detects vision models.
๐ Browser Automation
pip install 'crabagent[browser]' + playwright install chromium
> Open https://news.ycombinator.com and show top 5 stories
> Search "Python async" on Google
๐ MCP Client
Connect external MCP servers (stdio + HTTP). Tools auto-discover.
๐ Scheduled Tasks
> Remind me every day at 11:00 to drink water
> Check product page every 30 minutes, notify if price drops
๐ฆ Snapshots
Auto-snapshot before file changes. Roll back with /molt rollback <id>.
๐ง Custom Plugins
Drop a .py file in .crabagent/tools/:
name = "hello"
description = "Say hello"
parameters = {"type": "object", "properties": {"name": {"type": "string"}}, "required": ["name"]}
requires_permission = False
def run(name: str) -> str:
return f"Hello, {name}!"
CLI / TUI Commands
| Command | Description |
|---|---|
/exit, /quit |
Exit |
/help |
Show help |
/clear |
Clear context |
/model [name] |
Switch model |
/models |
List models |
/provider [cmd] |
Manage providers |
/sessions / /session [id] |
List / load sessions |
/new |
New conversation |
/agents [cmd] |
Agent team management |
/agent_stats <name> |
Agent growth stats |
/delegate [@agent] [task] |
Delegate task |
/memory [list|search|clear] |
Team memory |
/skills / /skill <name> |
List / show skills |
/molt [cmd] |
Snapshots |
/todo [cmd] |
Task list |
/export |
Export to Markdown |
/image <path> [msg] |
Send image |
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 |
Serve host |
CRAB_SERVE_PORT |
5210 |
Serve port |
CRAB_MAX_ITERATIONS |
50 |
Max agent iterations |
CRAB_MAX_TOKENS |
4096 |
Max response tokens |
CRAB_BROWSER_HEADLESS |
true |
Browser headless mode |
Installation
pip install 'crabagent[serve]' # Web UI + API
pip install 'crabagent[browser]' # Browser automation
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
Project Structure
CrabAgent/
โโโ src/crabagent/
โ โโโ cli/ # CLI entrypoint + TUI
โ โโโ core/agent/ # Agent loop, tools, compression, agents
โ โโโ core/mcp/ # MCP client manager
โ โโโ serve/ # FastAPI + API + scheduler
โโโ frontend/ # React SPA
โโโ 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.6.3.tar.gz.
File metadata
- Download URL: crabagent-0.6.3.tar.gz
- Upload date:
- Size: 323.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91ddcce1021ebb58c7d8f0377bf4521c466e509459169a270a3788555937169f
|
|
| MD5 |
9f83a5b94f3b0af48b4b1a87f108aa01
|
|
| BLAKE2b-256 |
4fcf4e779dff97d074eedcfe5f6b5eedbbb27155153b9f5e3e1a73580a76a4c2
|
File details
Details for the file crabagent-0.6.3-py3-none-any.whl.
File metadata
- Download URL: crabagent-0.6.3-py3-none-any.whl
- Upload date:
- Size: 280.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0df51a348c5dda8918744ef447f38f83303dff72a957f7652e8dc0c3c1e4921b
|
|
| MD5 |
3e7160b669589fe4e99c7f6379a253b5
|
|
| BLAKE2b-256 |
607fcf5f05ef12819733eaa5d9e7d7ce0ca995f554a7049df7c603e8a00836c7
|