The open-source managed agents platform. Turn coding agents into real teammates — assign tasks, track progress, compound skills. https://multica.ai
Find a file
Jiang Bohan 57f31b2f79 feat(tools): add tool policy system with 4-layer filtering
Implement a flexible tool policy system that supports:
- Tool groups (group:fs, group:runtime, group:web)
- Predefined profiles (minimal, coding, web, full)
- Global allow/deny lists
- Provider-specific rules
- Subagent restrictions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 02:25:22 +08:00
.github/workflows chore(ci): add GitHub Actions workflow (#28) 2026-01-30 13:51:05 +08:00
apps fix(web): remove max-width constraint on assistant messages 2026-01-30 23:52:11 +08:00
packages fix(ui): improve disabled state cursor and no-agent empty state 2026-01-30 22:45:53 +08:00
scripts feat(cli): add binary build support for interactive CLI 2026-01-30 15:22:53 +08:00
skills docs(skill-creator): explicitly state no .skill packaging needed 2026-01-30 17:43:59 +08:00
src feat(tools): add tool policy system with 4-layer filtering 2026-01-31 02:25:22 +08:00
.dockerignore Add Docker support for Gateway and SDK documentation 2026-01-28 17:56:22 +08:00
.env.example docs: add .env.example and environment configuration guide 2026-01-30 13:32:01 +08:00
.gitignore feat(cli): add binary build support for interactive CLI 2026-01-30 15:22:53 +08:00
CLAUDE.md docs: restore missing Atomic Commits details in CLAUDE.md 2026-01-30 23:20:16 +08:00
package.json fix: auto-load .env via --env-file flag in all tsx scripts 2026-01-30 21:50:07 +08:00
pnpm-lock.yaml feat(web): add @multica/sdk dependency and URL config module 2026-01-30 22:40:43 +08:00
pnpm-workspace.yaml feat(store): add shared Zustand store package with counter example 2026-01-30 11:34:09 +08:00
README.md docs: add custom skill creation section to README 2026-01-30 17:45:27 +08:00
tsconfig.json Implement WebSocket Gateway with NestJS and client SDK 2026-01-28 16:46:51 +08:00
turbo.json Add monorepo setup with Turborepo and Web client 2026-01-29 16:33:35 +08:00
vitest.config.ts chore: set up Vitest testing framework 2026-01-30 13:54:34 +08:00

Super Multica

A multi-component architecture for distributed agent systems.

Project Structure

src/
├── agent/              # Core agent module
│   ├── context-window/ # Token-aware context management
│   ├── profile/        # Agent profile management
│   ├── session/        # Session persistence with compaction
│   ├── skills/         # Modular skill system
│   └── tools/          # Agent tools
│       └── web/        # Web fetch and search tools
├── gateway/            # WebSocket gateway for distributed communication
├── hub/                # Multi-agent coordination hub
├── client/             # Client library
├── console/            # NestJS console application
└── shared/             # Shared types and gateway SDK
    └── gateway-sdk/    # Gateway client SDK

apps/
└── web/                # Next.js web application

packages/
└── sdk/                # SDK package for external use

skills/                 # Bundled skills (commit, code-review)

Getting Started

pnpm install

Environment Configuration

The Agent requires LLM provider credentials. Copy the example and fill in your values:

cp .env.example .env
# Edit .env with your API keys

Example .env for OpenAI:

export LLM_PROVIDER=openai
export OPENAI_API_KEY=sk-xxx
export OPENAI_BASE_URL=https://api.openai.com/v1
export OPENAI_MODEL=gpt-4o

Load the environment before starting services that use the Agent:

# Hub Console (requires LLM env vars)
source .env && pnpm dev:console

# Agent CLI
source .env && pnpm agent:cli "hello"

# Gateway (no LLM env vars needed)
pnpm dev:gateway

See .env.example for all supported providers (OpenAI, Anthropic, DeepSeek, Kimi, Groq, Mistral, etc.).

Configuration Priority

Each setting is resolved in order (first match wins):

  1. CLI argument--provider, --model, --api-key, --base-url
  2. Environment variableLLM_PROVIDER, OPENAI_MODEL, OPENAI_API_KEY, OPENAI_BASE_URL, etc.
  3. Session metadata — restored from previous session
  4. Defaultkimi-coding provider with kimi-k2-thinking model

Agent CLI

Use the agent module directly from the CLI for isolated testing.

# New sessions get a UUIDv7 ID (shown on start)
pnpm agent:cli "hello"
# [session: 019c0b0a-b111-765c-8bbd-f4149beac9c4]

# Continue a session
pnpm agent:cli --session 019c0b0a-b111-765c-8bbd-f4149beac9c4 "what did I say?"

# Or use a custom session name
pnpm agent:cli --session demo "remember my name is Alice"
pnpm agent:cli --session demo "what's my name?"

# Override provider/model
pnpm agent:cli --provider openai --model gpt-4o-mini "hi"

# Use an agent profile
pnpm agent:cli --profile my-agent "hello"

# Set thinking level
pnpm agent:cli --thinking high "solve this complex problem"

Sessions

Sessions persist conversation history to ~/.super-multica/sessions/<id>/. Each session includes:

  • session.jsonl - Message history in JSONL format
  • meta.json - Session metadata (provider, model, thinking level)

Sessions use UUIDv7 for IDs by default, providing time-ordered unique identifiers.

Context Window Management

The agent automatically manages context windows to prevent token overflow:

  • Token-aware compaction - Tracks token usage and compacts when approaching limits
  • Compaction modes: tokens (default), count (legacy), summary (LLM-generated)
  • Configurable safety margins - Ensures space for responses
  • Minimum message preservation - Keeps recent context intact

Agent Profiles

Agent profiles define identity, personality, tools, and memory for an agent. Profiles are stored as markdown files in ~/.super-multica/agent-profiles/<id>/.

Profile CLI

# Create a new profile with default templates
pnpm agent:profile new my-agent

# List all profiles
pnpm agent:profile list

# Show profile contents
pnpm agent:profile show my-agent

# Open profile directory in file manager
pnpm agent:profile edit my-agent

Profile Structure

Each profile contains:

  • identity.md - Agent name and role
  • soul.md - Personality and behavioral constraints
  • tools.md - Tool usage instructions
  • memory.md - Persistent knowledge
  • bootstrap.md - Initial conversation context

Skills

Skills are modular capabilities that extend agent functionality through SKILL.md definition files. For complete documentation, see Skills System Documentation.

Key Features

  • Multi-source loading - Bundled, user-installed, plugin-based, and profile-specific skills
  • GitHub installation - pnpm skills:cli add owner/repo to install from GitHub
  • Slash command invocation - /skill-name args in interactive mode
  • Eligibility filtering - Auto-filter by platform, binaries, and environment
  • Hot reload - File watcher for development
  • Plugin system - Auto-discover skills from npm packages with multica.plugin.json

Quick Start

# List all skills
pnpm skills:cli list

# Install skills from GitHub
pnpm skills:cli add anthropics/skills

# Check skill status with diagnostics
pnpm skills:cli status
pnpm skills:cli status pdf -v

# Remove installed skills
pnpm skills:cli remove skills

Built-in Skills

Located in /skills/:

  • commit - Git commit helper following conventional commits
  • code-review - Code review assistance
  • skill-creator - Create and manage custom skills (meta-skill for self-extension)

Creating Custom Skills

The agent can create new skills to extend its own capabilities. Simply ask the agent to create a skill:

User: Create a skill that helps me format JSON
Agent: [Creates ~/.super-multica/skills/json-formatter/SKILL.md]

Skills are automatically loaded via hot-reload. See the skill-creator SKILL.md for the complete guide.

Agent Tools

exec

Execute short-lived shell commands and return output. Commands running longer than the timeout are automatically backgrounded.

exec({ command: "ls -la", cwd: "/path/to/dir", timeoutMs: 30000 })

process

Manage long-running background processes (servers, watchers, daemons). Output is buffered (up to 64KB) and terminated processes are automatically cleaned up after 1 hour.

# Start a background process (returns immediately with process ID)
process({ action: "start", command: "npm run dev" })

# Check process status
process({ action: "status", id: "<process-id>" })

# Read process output
process({ action: "output", id: "<process-id>" })

# Stop a process
process({ action: "stop", id: "<process-id>" })

# Clean up terminated processes
process({ action: "cleanup" })

glob

Pattern-based file discovery using fast-glob.

glob({ pattern: "**/*.ts", cwd: "/path/to/dir" })

web_fetch

Fetch and extract content from URLs with intelligent content extraction.

# Basic fetch (returns markdown)
web_fetch({ url: "https://example.com" })

# With options
web_fetch({
  url: "https://example.com",
  outputFormat: "markdown",  # or "text"
  extractor: "readability"   # or "turndown" for full page
})

Features: SSRF protection, response caching, max 50KB output.

Search the web using Brave or Perplexity AI.

# Basic search
web_search({ query: "typescript best practices" })

# With provider options
web_search({
  query: "latest AI news",
  provider: "brave",     # or "perplexity"
  count: 5,
  freshness: "pw"        # past week (Brave: pd/pw/pm/py)
})

Distributed Architecture

Gateway

The WebSocket gateway enables distributed multi-agent communication:

  • Real-time message passing between agents
  • Streaming support for long-running operations
  • RPC-style request/response patterns

Hub

The Hub manages multiple agents and gateway connections:

  • Agent lifecycle management
  • Communication channel coordination
  • Device identification and tracking

Scripts

Agent Commands

  • pnpm agent:cli - Run the agent CLI for module-level testing
  • pnpm agent:interactive - Interactive REPL mode
  • pnpm agent:profile - Manage agent profiles

Development

  • pnpm dev - Run full stack in development mode
  • pnpm dev:gateway - Run gateway only
  • pnpm dev:console - Run console only
  • pnpm dev:web - Run web app only

Build & Test

  • pnpm build - Build for production
  • pnpm build:sdk - Build SDK package
  • pnpm start - Run production build
  • pnpm typecheck - Type check without emitting