Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nearai/ironclaw/llms.txt
Use this file to discover all available pages before exploring further.
Overview
IronClaw is built on a modular architecture that separates concerns while maintaining tight security boundaries. The system orchestrates agent reasoning, tool execution, multi-channel communication, and persistent memory through a set of core components.Architecture Diagram
Core Components
Agent Loop
The central orchestrator that coordinates all system activity.- Route incoming messages from channels
- Classify user intent (command vs query vs task)
- Delegate to appropriate handlers
- Coordinate session and thread management
- Trigger background systems (heartbeat, routines, self-repair)
Router
Classifies incoming messages to determine handling strategy.- Commands: Direct system operations (
/quit,/undo,/status) - Queries: Information retrieval from memory or knowledge
- Tasks: Complex work requiring planning and tool execution
- Conversation: General chat and interaction
Scheduler
Manages parallel job execution with priorities and resource limits.- Parallel job execution (configurable limit)
- Per-job worker isolation
- Subtask spawning for parallel tool execution
- Automatic cleanup on completion
- Job state tracking (pending, in_progress, completed, failed, stuck)
Worker
Executes individual jobs with LLM reasoning and tool calls.- Planning (optional): Generate action plan with LLM
- Tool Selection: Choose tools based on context
- Parallel Execution: Run independent tools concurrently
- Result Processing: Sanitize output, update context
- Iteration: Loop until job complete or max iterations
- Completion: Mark job as completed/failed/stuck
Routines Engine
Background automation for scheduled and reactive tasks.- Cron: Time-based schedules (daily reports, periodic checks)
- Event: Message pattern matching (alert on errors)
- Webhook: HTTP endpoint triggers (CI/CD integration)
- Daily standup summaries
- Alert monitoring and triage
- Periodic health checks
- Automated reporting
Orchestrator
Manages Docker sandbox containers for isolated code execution.- Per-job bearer tokens (ephemeral, in-memory only)
- Network-isolated containers
- Resource limits (CPU, memory, timeout)
- Credential injection at orchestrator boundary
- No direct database access from containers
Data Flow
Message Processing
Job Lifecycle
Self-Repair System
Automatic detection and recovery of stuck operations. Detection:- Jobs stuck in
InProgressbeyond threshold - Tools with high failure rates
- Unresponsive worker processes
Stuck Job Recovery
Stuck Job Recovery
- Detect job stuck > threshold (default 5min)
- Analyze context and last action
- Attempt recovery:
- Retry failed tool
- Restart worker with fresh context
- Escalate to manual intervention
- Notify user of outcome
Broken Tool Recovery
Broken Tool Recovery
- Track tool failure rates
- Identify consistently failing tools
- Recovery options:
- Clear tool cache
- Rebuild WASM tool
- Disable tool temporarily
- Suggest alternative tools
Context Management
Each job maintains isolated context for safe parallel execution.- Each job has independent memory
- No shared mutable state between jobs
- Tool execution scoped to job context
- LLM history isolated per job
- Detect: Monitor token count per thread
- Summarize: Use LLM to summarize old turns
- Preserve: Keep recent turns intact
- Replace: Swap old turns with summary
- Continue: Resume conversation with more tokens
Compaction triggers automatically at 75% of max context window. Recent turns (last 10) are always preserved.
Session Management
Multi-threaded conversations with undo/redo support. Features:- Multiple concurrent threads per user
- Turn-based checkpointing
- Undo/redo with state restoration
- Session persistence to database
- Automatic pruning of stale sessions
Performance Characteristics
Parallel Tool Execution
Tools with no dependencies execute concurrently:Resource Limits
| Resource | Default Limit | Configurable |
|---|---|---|
| Max parallel jobs | 10 | Yes (max_parallel_jobs) |
| Job timeout | 30 minutes | Yes (job_timeout) |
| Max iterations | 50 | Yes (per-job metadata) |
| Stuck threshold | 5 minutes | Yes (stuck_threshold) |
| Session idle timeout | 1 hour | Yes (session_idle_timeout) |
Next Steps
Security Model
Learn about defense-in-depth security layers
Channel System
Multi-channel communication architecture
Tool System
Extensible tool system and WASM sandbox
Workspace & Memory
Persistent memory and hybrid search