Skip to main content

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.

Python 3.12+ License

English | ไธญๆ–‡


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.

See LICENSE. ee LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crabagent-0.10.2.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crabagent-0.10.2-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

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

Hashes for crabagent-0.10.2.tar.gz
Algorithm Hash digest
SHA256 2fe9d1cb2357363c906ccd6ee7c0aed28aaaf06db4a6b936dc0f87a5028ea4a1
MD5 dac8f2360c62c980c71c831ad12ab467
BLAKE2b-256 cd81daedbcfca62bdd82ebea1a84ed3bbf656a1d3bc8646578f0719816cf8d49

See more details on using hashes here.

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

Hashes for crabagent-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f051b14b5c25114f7bb36b136aabe8d63154506737a25b7ab1d780c9726fe9b7
MD5 d7ff769461793f1845b61048ae4c882a
BLAKE2b-256 e58e83d74439fd93a4b6a91d4935962afcd35a1276022eedf4f3435fa229e6ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page