# Repository Briefing: mateaix/mateclaw
> Source: https://repoforai.com/repo/mateaix/mateclaw (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/mateaix/mateclaw
- **Official Docs / Website**: https://claw.mate.vip
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Java
- **License**: Apache-2.0
- **Engineering Health**: A+ (96/100 · Maintenance 35/35 · Adoption 21/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v3.1.0 (2026-11-20) — https://github.com/mateaix/mateclaw/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted
- **Momentum**: 1,218 ★ total (+0 24h / +3 7d) · 368 forks
- **Topics**: `agent`, `agent-harness`, `agentscope-java`, `ai-agent`, `dingtalk-robot`, `feishu-bot`, `llm-wiki`, `loop-engineering`, `mcp-protocol`, `multi-agent`, `multiagent`, `openclaw`
- **When to Use**: Best for: Teams that want a self-hosted workspace for approved tool use, shared knowledge, model failover, and resumable work across chat channels. Skip if: You only need a lightweight personal CLI or IDE assistant, require verified multi-instance recovery, or cannot vet where configured models, channels, and tools send task content.

## Overview
```text
### Architecture & Core Mechanics
MateClaw is a Java 21, Spring Boot application built on Spring AI and AgentScope Java. The root Maven project separates `mateclaw-server`, `mateclaw-ui`, `mateclaw-webchat`, the Electron desktop app, and the Java plugin API, with Mem0 and sample plugins alongside them. `AgentRuntimeProvider` decouples an employee from its execution engine: the native runtime owns ReAct, Plan-and-Execute, persistent Goals, and Team Runs, while the managed DeepSeek Harness adapter launches `dsh --profile sdk` and normalizes SDK JSON-RPC events for reasoning, text, tools, usage, completion, and cancellation. Both paths share conversation state, workspace boundaries, Tool Guard, and lifecycle controls; that does not establish feature parity between the engines.

Extensions operate at different layers. `SKILL.md` packages combine prompts and tool declarations with reviewable lessons in `LESSONS.md`; MCP binds external tools per employee over stdio, SSE, or Streamable HTTP; ACP wraps external coding agents as employees. Tool Guard applies role-based access, approvals, and path protection. A Team Run links the objective, task DAG, worker executions, evidence, and deliverables under one `runId`, giving chat, live monitoring, and team history a common server-side view.

### Key Capabilities & Differentiators
Model routing uses an ordered provider chain with health tracking and cooldowns. When a provider fails, MateClaw can retry the current request on the next healthy option rather than requiring a manual switch. Options include OpenAI, Anthropic, Gemini, DashScope, DeepSeek, and Kimi, plus local endpoints such as Ollama, LM Studio, and MLX. Verify context and tool compatibility before putting providers in the same chain. LLM Wiki turns PDFs, Markdown, and web material into linked pages with citations back to source chunks. A hot cache injects Wiki context into employee prompts, while workspace files and daily notes support a separate memory lifecycle with extraction and scheduled consolidation.

Persistent Goals store leases, attempts, continuation state, and checkpoints so interrupted work can resume after a single backend instance restarts. Team Runs add dependency-aware parallel dispatch, prerequisite handoffs, cancellation, and approval gates. The web console exposes active runs and provider state, with force-recycle for stuck runs. Users can also reach the workspace through Electron desktop, an embeddable webchat widget, or eight IM integrations, including DingTalk, Feishu, WeChat Work, Telegram, and Slack.

### Trade-offs & Limitations
MateClaw is a better fit for teams that need role-based administration, approval gates, audit records, and a runtime console than for a single user tuning a CLI assistant. OpenClaw and Hermes Agent are worth comparing if channel breadth or a personal workflow is the priority; Claude Code and Cursor are more direct choices if most work stays in a terminal or IDE. MateClaw's integrated Wiki, model routing, and team execution reduce the number of separate tools to assemble, but operators still have to maintain the database, credentials, provider order, tool scopes, and approval policies.

Failover reduces dependence on one vendor, but requests may have different latency, cost, or data-handling implications on a fallback provider. Checkpoint recovery is not exactly-once execution: external sends, publishes, or destructive calls still need idempotency or human review. Remote inference keeps model compute off the application host, not task data inside it. Local inference can limit model-side egress, but it must be sized independently, and remote channels or tools can still carry content out. Apache-2.0 covers the application, not hosted inference charges or the terms of connected services.

### Hardware & Deployment Guide
The Docker Compose stack uses PostgreSQL 16. For a fresh install, start with `.env.example` and configure the database, workspace, and model endpoints. An upgrade from the old MySQL stack is not an in-place database conversion: Compose starts PostgreSQL on a fresh `postgres_data` volume and does not read `mysql_data`. Back up the database, workspace, plugins, and configuration, then test a cross-engine migration before cutover. Source builds use Java 21 and Maven; the local run path installs `mateclaw-plugin-api` and starts `mateclaw-server` with `spring-boot:run`, a file-backed H2 URL, and `MATECLAW_WORKSPACE_SANDBOX_ROOT`. Packaged desktop builds bundle JRE 21.

DSH is optional. The managed default is `0.2.0-rc.1` with Node.js 22 or 24; the opt-in `0.2.2-rc.1` candidate requires Node.js 24.9 or later within 24.x. The cited adapter checks cover macOS arm64; Linux x64 and persisted V3-to-V4 DSH history migration remain unverified. Release 3.0.0 focused on execution architecture; 3.1.0 added finer lesson review, restore previews, and execution fixes. The stable overview and the 3.1.0 change summary list different Spring Boot and Spring AI versions, so verify the actual artifacts or tagged POM before pinning dependencies. Reusable native employee templates and coordinator mode are 3.2.0-SNAPSHOT features, not part of stable 3.1.0.
```

## Key Capabilities
```text
- Execution: AgentRuntimeProvider separates native AgentScope execution from managed DeepSeek Harness via SDK JSON-RPC.
- Recovery: Persistent Goals record attempts, leases, and checkpoints; Team Runs tie the task DAG, worker evidence, and deliverables to one runId.
- Model routing: Ordered provider failover with health tracking and cooldowns can retry the current request on another healthy backend.
- Knowledge and memory: LLM Wiki links generated pages to source chunks, while workspace memory supports scheduled consolidation and precise edits.
- Tool governance: Per-employee MCP bindings and Tool Guard combine scoped access, approvals, path protection, and auditability.
- Skill lifecycle: v3.1.0 supports reviewing or withdrawing individual lessons, previewing snapshot restores, and canceling asynchronous skill installs.
```

## Quick Start / Clone
```bash
# Backend
# Java 21 and Maven required. Create a local JWT secret once and reuse it on restart.
[ -f .env.local ] || (umask 077; printf 'JWT_SECRET=%s\n' "$(openssl rand -hex 48)" > .env.local)
set -a
source .env.local
set +a
# From the repository root; use its configured models and workspace
mvn -pl mateclaw-plugin-api -am install -DskipTests
SPRING_DATASOURCE_URL="jdbc:h2:file:$PWD/data/mateclaw;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE" \
MATECLAW_WORKSPACE_SANDBOX_ROOT="$PWD/data/workspace" \
mvn -pl mateclaw-server spring-boot:run  # http://localhost:18088

# Frontend (new terminal, from the repository root)
cd mateclaw-ui
npm install && npm run dev -- --host 127.0.0.1    # http://localhost:5173
```
