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."

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.4-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.

๐Ÿ–ผ๏ธ 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[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

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
โ”‚   โ””โ”€โ”€ 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.9.6.tar.gz (3.1 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.9.6-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file crabagent-0.9.6.tar.gz.

File metadata

  • Download URL: crabagent-0.9.6.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for crabagent-0.9.6.tar.gz
Algorithm Hash digest
SHA256 ae35769d9a39f2d3061dd8c76f178e8f06ed44fc27d81135a5660ad028a59287
MD5 d7c72204cbe51b2a69319cc553ac207d
BLAKE2b-256 9d883f728605cb1d35bb794495a4f7c5e354b4038081c0e5eb3c6f10a31bf81a

See more details on using hashes here.

File details

Details for the file crabagent-0.9.6-py3-none-any.whl.

File metadata

  • Download URL: crabagent-0.9.6-py3-none-any.whl
  • Upload date:
  • Size: 1.8 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.9.6-py3-none-any.whl
Algorithm Hash digest
SHA256 64565496b52f1cc77fed38c2e6ae1094f22c0c7d25dfd1f85749a2cde01b7f56
MD5 a6e510b0416d7617f8f1843a499cd229
BLAKE2b-256 b3860b58a59534670064cb63bb9a4e2df68f774ae0d263fb993412a32210cd41

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