Complete AGI Agent Framework — Production-Ready with 28+ Advanced Features
OpenClaw-Inspired Architecture with Session Management, Multi-Agent Systems, and Enterprise Features
Krab is a comprehensive, production-ready AGI framework built for the 2026 AI landscape. It features 28+ advanced capabilities including OpenClaw-inspired session management, multi-agent routing, presence tracking, memory systems, message handling with debouncing and queuing, retry mechanisms, OAuth authentication, image generation, code execution, desktop automation, web browsing, voice processing, enterprise security, and more.
- 🚀 Production-Ready: All 28+ features implemented and tested
- 🛡️ Enterprise-Grade: Security, analytics, compliance, and OpenClaw-inspired session isolation
- 🔧 Developer-Friendly: Complete SDK and integration tools with CLI management
- ⚡ High Performance: < 1s startup, parallel execution, intelligent queuing
- 🌐 Multi-Provider: 15+ LLM providers with OAuth authentication support
- 🎯 OpenClaw-Inspired: Session management, multi-agent routing, presence tracking, and advanced message handling
┌─────────────────┐
│ User Input │
└─────────────────┘
│
▼
┌─────────────────┐
│ CLI Interface │
└─────────────────┘
│
▼
┌─────────────────┐
│ Multi-Agent │
│ Router │
└─────────────────┘
│ │ │
▼ ▼ ▼
┌─────┐ ┌─────┐ ┌─────┐
│Session│ │Message│ │Presence│
│Manager│ │Queue │ │Tracker │
└─────┘ └─────┘ └─────┘
│ │ │
└────┼────┘
▼
┌─────────────────┐
│ AGI Agent Core │
└─────────────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐
│Memory│ │Tools │ │OAuth │ │Retry │
│System│ │Registry│ │Manager│ │System│
└─────┘ └─────┘ └─────┘ └─────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Tool Categories │
├─────────────────┬─────────────────┬─────────────────┬─────┤
│ 🎨 Creative AI │ 🖥️ Automation │ 🤝 Collaboration │ 📊 │
│ • Image Gen │ • Desktop Ctrl │ • Multi-Agent │ Ent │
│ • Voice Intel │ • Web Auto │ • MCP Integration│ │
│ │ • Code Exec │ • Scheduling │ │
└─────────────────┴─────────────────┴─────────────────┴─────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ AI Providers (with OAuth) │
├─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
│Gemini│OpenAI│Anthropic│Local│Google│Claude│GPT-4│DeepSeek│Azure│
│2.0 │GPT-4 │Claude │Models│Gemini│Code │Turbo │Coder │OpenAI│
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
│
▼
┌─────────────────┐
│ AGI Response │
└─────────────────┘
│
▼
┌─────────────────┐
│ User Output │
└─────────────────┘
┌─────────────┐
│ START │
└─────────────┘
│
▼
┌─────────────┐
│ User Input │
└─────────────┘
│
▼
┌─────────────┐
│ 🧠 Think: │
│ Generate │
│ Plan │
└─────────────┘
│
▼
┌─────────────┐
│ Use Tools? │
└─────────────┘
│ │
│ YES │ NO
▼ ▼
┌─────────────┐ ┌─────────────┐
│ ⚡ Execute │ │ 💬 Generate │
│ Tools │ │ Response │
└─────────────┘ └─────────────┘
│ │
▼ │
┌─────────────┐ │
│ Success? │ │
└─────────────┘ │
│ │ │
│ YES │ NO │
▼ ▼ │
┌─────────────┐ ┌─────────────┐ │
│ 🔍 Reflect │ │ 🔄 Retry │ │
│ Results │ │ Different │ │
└─────────────┘ │ Approach │ │
│ └─────────────┘ │
▼ │ │
┌─────────────┐ ▼ │
│ Quality OK? │ ┌─────────────┐ │
└─────────────┘ │ Max Retries?│ │
│ │ └─────────────┘ │
│ YES │ NO │ │
▼ ▼ ▼ │
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ 💬 Generate │ │ 📈 Improve │ │ ❌ Report │
│ Response │ │ Response │ │ Error │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
└───────────────┼───────────────┘
▼
┌─────────────────┐
│ 📤 Output │
│ Response │
└─────────────────┘
│
▼
┌─────────────┐
│ END │
└─────────────┘
┌─────────────────────────────────────────────────────────────────────┐
│ User Interface │
├─────────────────────┬─────────────────────┬─────────────────────┤
│ CLI │ Web UI │ Desktop App │
│ • Command Line │ • Real-time Chat │ • Electron Client │
│ • Interactive Mode │ • Collaborative │ • Native Experience │
│ • Advanced Options │ • Web Dashboard │ • Cross-platform │
└─────────────────────┴─────────────────────┴─────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Core Engine │
├─────────────────────┬─────────────────────┬─────────────────────┤
│ AGI Agent │ Memory System │ Tool Registry │
│ • Reasoning Engine │ • Markdown Storage │ • 70+ Tools │
│ • Multi-Agent │ • Vector Search │ • Approval Workflows │
│ • Session Mgmt │ • Context Injection │ • Plugin System │
└─────────────────────┴─────────────────────┴─────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ AI Providers │
├─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
│Gemini│OpenAI│Anthropic│Local│Google│Claude│GPT-4│DeepSeek│Azure│Other│
│2.0 │GPT-4 │Claude │Models│Gemini│Code │Turbo │Coder │OpenAI│Providers│
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
▲
│
┌─────────────────────────────────────────────────────────────────────┐
│ Feature Modules │
├─────────────────┬─────────────────┬─────────────────┬─────────────┤
│ 🎨 Creative AI │ 🖥️ Automation │ 🤝 Collaboration │ 📊 Enterprise│
│ • Image Gen │ • Desktop Ctrl │ • Multi-Agent │ • Analytics │
│ • Voice Proc │ • Web Scraping │ • MCP Protocol │ • Security │
│ • Media Tools │ • Code Exec │ • Task Sched │ • Cloud Deploy│
└─────────────────┴─────────────────┴─────────────────┴─────────────┘
┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐
│ User │ │Agent │ │Memory│ │ LLM │ │Tools │
└──────┘ └──────┘ └──────┘ └──────┘ └──────┘
│ │ │ │ │
│─── User Input ──►│ │ │ │
│ │─── Load Context ─►│ │ │
│ │ │◄─── Context ──────│ │
│ │─── Generate Plan ─►│ │ │
│ │ │◄─── Plan ─────────│ │
│ │ │ │ │
│ │ [Plan Uses Tools?] │ │
│ │ │ │ │
│ │─── Execute Tool(s) ──────────────────►│ │
│ │ │ │ │
│ │◄─── Tool Results ─────────────────────│ │
│ │─── Process Results ─►│ │
│ │ │◄─── Processed ────│ │
│ │ │ │ │
│ │◄─── Generate Response ────────────────│ │
│ │─── Store Conversation ───────────────►│ │
│ │ │ │ │
│◄─── Final Response ◄─────────────────────│ │
│ │ │ │ │
Krab incorporates advanced capabilities inspired by OpenClaw's proven architecture:
- Secure Session Isolation: Per-channel, per-peer DM scoping with automatic cleanup
- Session Persistence: JSON-based metadata storage with pruning and maintenance
- Session Tools:
sessions_list,sessions_history,sessions_send,sessions_spawn - Context Window Optimization: Tool result pruning and conversation compaction
- Agent Routing: Sophisticated message routing based on channel, peer, roles, and account IDs
- Agent Bindings: Priority-based routing rules with fallback mechanisms
- Workspace Isolation: Separate configurations and state per agent
- CLI Management:
krab agent list/add/remove/bind/unbind/bindings
- Instance Monitoring: Real-time tracking of Krab instances with metadata
- TTL Management: Automatic cleanup of stale presence entries
- Cross-Platform: CLI, Gateway, UI, and service presence reporting
- CLI Monitoring:
krab presence list/stats/update
- Inbound Debouncing: Configurable delays to prevent spam (channel-specific timing)
- Message Queueing: Lane-aware FIFO with multiple modes (steer/followup/collect/interrupt)
- History Context: Group chat context wrapping with configurable limits
- Overflow Management: Intelligent message dropping with summarize/old/new policies
- Exponential Backoff: Configurable retry with jitter for collision avoidance
- Channel Optimization: Provider-specific delays (Telegram 400ms, Discord 500ms)
- Error Classification: Automatic retry for network errors and 5xx HTTP status codes
- Type Safety: Full TypeScript support with generic retry wrappers
- Multi-Provider OAuth: Anthropic, OpenAI, Google with configurable OAuth flows
- Token Lifecycle: Automatic refresh, expiry detection, and secure storage
- Profile Management: Multiple auth profiles per provider (OAuth/API keys/setup tokens)
- Secure Storage: JSON-based credential management in
~/.krab/auth-profiles.json
- Markdown Storage: Daily logs and long-term memory with human-readable format
- Vector Search: Semantic search capabilities for memory retrieval
- Memory Tools:
memory_search,memory_get,memory_write,memory_list - Context Injection: Memory content loaded into system prompts for appropriate sessions
- Image Generation: AI-powered image creation and editing
- Voice Intelligence: Speech-to-text and text-to-speech with multiple providers
- Desktop Control: Mouse, keyboard, and screen automation with computer vision
- Web Automation: Browser control and data extraction with Playwright
- Code Execution: Safe multi-language programming environment
- Multi-Agent System: Agent coordination and task delegation
- MCP Integration: Model Context Protocol for inter-agent communication
- Task Scheduling: Automated cron-based task execution
- Obsidian Integration ❤️ - Advanced Knowledge Management: TF-IDF semantic search, knowledge graph analysis, AI synthesis, real-time sync, 15+ sophisticated tools
- Plugin Ecosystem: Lego-style modular architecture. Add new tools, agents, or middleware without touching core code.
- Advanced Analytics: Performance monitoring and Vercel AI tracing
- Security System: Enterprise-grade authentication, authorization, and audit logging
- Cloud Deployment: Scalable infrastructure and gateway server
- SDK Integration: Complete development toolkit
- Web Interface: Real-time collaborative chat platform
- Desktop Application: Electron-based client
Krab is designed to be infinitely extensible. Our plugin system allows you to create your own "blocks" and plug them in seamlessly.
# Create a new tool plugin in seconds
krab plugins create my-custom-tool --type tool
# Install a local plugin
krab plugins install ./my-plugin-folder
# List all plugins
krab plugins listIf you find Krab useful, please give us a ⭐ on GitHub!
git clone https://github.com/OpenKrab/Krab.git
cd Krab
npm install --legacy-peer-depsCopy the example environment file:
cp .env.example .envAdd your preferred API key (e.g., GEMINI_API_KEY, KILOCODE_API_KEY, OPENAI_API_KEY).
For Obsidian support, set OBSIDIAN_VAULT_PATH=/path/to/your/vault.
npm run build
npm startOr use development mode:
npm run devRuntime state, secrets, and profile data are now resolved through Krab state directories. Use krab --dev ... or krab --profile <name> ... to isolate gateway, secrets, sessions, and runtime metadata.
npm start chatnpm start tuiThe dashboard TUI now includes live gateway runtime status, tool execution diagnostics, routing diagnostics, subagent runtime visibility, semantic-first hybrid memory lookup shortcuts, and operator controls for subagent cancellation plus diagnostics drilldown/filtering. These controls sit on top of the same shared runtime state used by the gateway and CLI status surfaces, so operator views, cancellation requests, and diagnostics reflect the active runtime instead of a separate TUI-only state model.
npm start ask "Generate an image of a futuristic city"npm start ask "Navigate to example.com and extract the main heading"npm start ask "Write a Python script to analyze this dataset"npm start ask "Take a screenshot and save it to desktop"krab chat- Start interactive chat sessionkrab tui- Start dashboard TUI with operational runtime panelskrab ask <question>- Ask a single questionkrab tools- List all available toolskrab config- Manage configuration
krab plugins list- List all installed pluginskrab plugins create- Scaffold a new plugin projectkrab plugins doctor- Check plugin health
krab session list- List all active sessionskrab session info <id>- Get detailed session informationkrab session clean- Clean up stale sessionskrab session remove <id>- Remove a specific sessionkrab session stats- Show session statistics
krab agent list- List all configured agentskrab agent add <name>- Add a new agentkrab agent remove <name>- Remove an agentkrab agent bind <agent> <channel>- Bind agent to channelkrab agent unbind <agent> <channel>- Unbind agent from channelkrab agent bindings- Show all agent bindings
krab presence list- List all active instanceskrab presence stats- Show presence statisticskrab presence update- Update current instance presence
krab gateway- Start web API serverkrab gateway status --deep- Show runtime, readiness, presence, and tool statekrab scheduler- Manage scheduled taskskrab analytics- View performance metricskrab security- Security managementkrab bootstrap run- Run agent bootstrapping processkrab hooks list- List all active hookskrab memory search <query>- Search memory systemkrab secrets list|set|get|remove- Manage state-aware secrets in the active Krab profile
/plugins- Show loaded plugins and their status/tools- View all loaded tools and permissions/memory- Check conversation buffer status/memory find <query>- Search semantic-aware hybrid memory entries from the dashboard TUI/gateway- Show gateway runtime health and readiness in the dashboard TUI/subagents- Show live subagent runtime status in the dashboard TUI/subagents inspect <id>- Inspect one subagent in detail from the dashboard TUI/subagents kill <id>- Request cancellation for a running subagent from the dashboard TUI/tools filter <name>- Filter tool diagnostics by tool name in the dashboard TUI/tools clear- Clear recorded tool diagnostics in the dashboard TUI/debug- View current provider and configuration/clear- Clear conversation memory/help- Show available commands
- Core AGI Engine - Advanced reasoning and tool integration with OpenClaw routing
- Voice Intelligence - Complete STT/TTS system with multiple providers
- Desktop Automation - Mouse, keyboard, vision control with computer vision
- Web Automation - Browser control and data extraction with Playwright
- Code Execution - Safe multi-language programming with enhanced security
- Creative AI - Image generation and media processing with streaming
- Cloud Infrastructure - Enterprise deployment and monitoring with presence tracking
- Desktop Application - Modern Electron UI with multi-agent support
- Web Interface - Real-time collaborative chat with gateway server
- Developer SDK - Complete integration toolkit with hooks system
- Advanced Analytics - Observability and performance tracking with retry mechanisms
- Agent Collaboration - Multi-agent coordination with session management
- MCP Integration - Inter-agent communication protocol
- Scheduler System - Automated task execution with hooks
- Browser Agent - Web automation with AI vision
- Security Enhancements - Enterprise security and compliance with OAuth
- Obsidian Integration - Deep Knowledge Base connection with memory system
- Plugin Ecosystem - Lego-style modular architecture
- Testing & Validation - Framework testing and validation
- Session Management - OpenClaw-inspired session isolation and persistence
- Presence Tracking - Real-time instance monitoring with TTL cleanup
- Gateway Runtime Status - Shared health/status snapshots for CLI, TUI, and gateway endpoints
- Subagent Runtime - Shared subagent registry with lifecycle state and session-backed delegation
- Hybrid Memory Retrieval - Semantic-aware retrieval blending ranked memory files, stored conversation history, and conversation semantic hits
- Tool Diagnostics & Guards - Tool execution traces, duplicate-call suppression, truncation guards, centralized policy checks, and policy lifecycle hooks
- State-Aware Secrets - Profile-aware secrets path handling with shared runtime audit helpers
- Message Handling - Advanced debouncing and queueing with multiple modes
- Retry System - Exponential backoff with jitter and channel optimization
- Enhanced Tool Registry - Advanced tool discovery with approval and policy workflows
- Abort-Aware Cancellation - Cancellation propagation from gateway HTTP/WebSocket disconnects and subagent runtime kill requests into agent, provider, search, fetch, STT/TTS, image, video, and model-discovery execution paths where the underlying SDK or transport supports abort signals
- Operator-Focused TUI Controls - Interactive runtime controls for subagent inspection, cancellation requests, and tool diagnostics filtering/clearing
- Gateway OpenAI-compatible chat routes now propagate disconnect-triggered cancellation for both HTTP and WebSocket request lifecycles.
- Tool policy decisions flow through centralized evaluation plus configurable pre/post policy hook stages, which keeps approval, denial, and diagnostics behavior aligned across routed agents.
- Hybrid memory retrieval combines ranked file memory, stored conversation history, and semantic conversation hits before surfacing results to tools and operator flows.
- Abort propagation is best-effort by transport: paths that use
fetch()or SDKs with signal support can be interrupted directly, while transports without native abort support still fall back to cooperative cancellation behavior.
- Mobile Apps - React Native iOS/Android applications
- Advanced Enterprise - Custom deployment configurations
- Real-time Collaboration - Enhanced multi-user features
Krab includes 60+ powerful tools across 19 feature categories:
get_datetime- Time and timezone awarenessshell- Safe shell execution with approvalweb_search- Hybrid search capabilitiesfile_ops- File system operations
obsidian_read_note- Read specific notes with full metadataobsidian_search_notes- Basic text search across vaultobsidian_semantic_search- TF-IDF cosine similarity searchobsidian_find_related_notes- Graph-based relationship discoveryobsidian_get_knowledge_graph- Complete vault relationship graphobsidian_get_central_nodes- Most connected/important notesobsidian_find_knowledge_path- Shortest paths between conceptsobsidian_synthesize_knowledge- AI-powered topic summarizationobsidian_discover_clusters- Tag-based theme clusteringobsidian_list_notes_by_tag- Tag-filtered note listingobsidian_create_note- Create new notes with frontmatterobsidian_start_sync- Enable real-time file watchingobsidian_stop_sync- Disable live vault updatesobsidian_sync_status- Monitor sync stateobsidian_vault_stats- Comprehensive vault analytics
sessions_list- List all active sessions with filteringsessions_history- Retrieve message history with tool result filteringsessions_send- Send messages between sessions with timeout handlingsessions_spawn- Create new agent sessions dynamically
memory_search- Semantic search across memory systemmemory_get- Retrieve specific memory entriesmemory_write- Store new information in memorymemory_list- List memory entries with filtering
exec- Elevated execution with approval workflows and security controlstool_registry- Advanced tool discovery with approval gates
image_generate- AI image generationimage_edit- Image manipulationvoice_speak- Text-to-speechvoice_transcribe- Speech-to-text
browser_navigate- Web browsingcomputer_click- Desktop controlcomputer_type- Keyboard automationcode_execute- Multi-language code execution
security_auth- Authenticationanalytics_trace- Performance monitoringscheduler_task- Task schedulingmcp_connect- Agent communication
Krab implements enterprise-grade security:
- Tool Approval System: Dangerous operations require user confirmation
- Rate Limiting: Prevent abuse and resource exhaustion
- Cost Controls: Monitor and limit API usage
- Audit Logging: Complete operation tracking
- Authentication: User management and access control
- Authorization: Role-based permissions
- Lightweight: < 50 dependencies total
- Fast: < 1s startup time
- Efficient: Parallel tool execution
- Scalable: Cloud-ready architecture
- Reliable: 99.9% uptime capability
Krab now supports a powerful, extensible plugin system for communication channels and more:
- Telegram Channel: Integration via grammY with automatic message routing.
- WhatsApp Channel: Multi-device support via Baileys (scan QR to connect).
- Discord Channel: Full bot support with DM and channel integration.
- Web Control UI: A modern, glassmorphic dashboard for monitoring gateway status and managing active channels.
- Multi-Agent Routing: Route messages to specific agents based on sender/workspace.
- Session Isolation: Each communication session maintains its own memory and context.
- Vector Memory: Long-term semantic search across all conversations.
- Service Installation: Easily install Krab Gateway as a system service on Windows, Linux, and macOS.
- Raspberry Pi Deployment Guide
- Gateway Setup Guide
- VPS Deployment Guide
- Docker Deployment Guide
- Railway Deployment Guide
- Render Deployment Guide
Krab supports 15+ LLM providers:
- Free: Gemini 2.0 Flash, Kilocode GLM-5
- Premium: OpenAI GPT-4, Anthropic Claude, DeepSeek
- Local: Ollama, LM Studio
- Enterprise: Azure OpenAI, Google Cloud AI
We welcome contributions! Please see our Contributing Guide for details.
MIT License - see LICENSE file for details.
