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
The agent module orchestrates the core functionality of IronClaw:- Message routing from channels
- Job scheduling and execution
- Tool invocation with safety guardrails
- Self-repair for stuck jobs
- Proactive heartbeat execution
- Routine-based scheduled and reactive jobs
- Turn-based session management with undo
- Context compaction for long conversations
Core Types
Agent
The main agent orchestrator that processes incoming messages and manages execution.User identifier for the agent session
Current session state with threads and turns
Persistent memory storage for the agent
Available tools for the agent to use
Example
Session
A session contains one or more threads representing conversations with the agent.Unique session identifier
User who owns this session
Currently active thread ID
All threads in this session
Tools that have been auto-approved for this session
Methods
Create a new session for a user
Create a new thread in this session and make it active
Get the currently active thread
Check if a tool has been auto-approved
Add a tool to the auto-approved set
Example
Thread
A thread represents a conversation sequence with turns (request/response pairs).Unique thread identifier
Parent session ID
Conversation history as turns
Current state (Active, Interrupted, Completed)
Turn
A single request/response pair in a conversation.Unique turn identifier
User’s input message
Agent’s response (None if turn incomplete)
Tool invocations made during this turn
Current state (Pending, InProgress, Completed, Failed)
Routine
A scheduled or reactive job that runs automatically.Unique routine identifier
Human-readable routine name
When this routine should execute
What the routine should do
Trigger Types
Execute on a cron schedule (e.g., “0 9 * * *”)
Execute every N seconds/minutes/hours
Execute when a specific event occurs
Example
ContextCompactor
Compacts conversation history to save context window space.Compact a thread’s conversation history by summarizing old turns
Check if a thread should be compacted based on size
CompactionResult
Number of turns before compaction
Number of turns after compaction
Summary of compacted content
Approximate tokens saved by compaction
Example
UndoManager
Manages checkpoints and undo operations for sessions.Create a checkpoint of the current session state
Restore session to a previous checkpoint
List all available checkpoints
Example
SelfRepair
Detects and repairs stuck jobs and broken tools.Find jobs that have been running too long
Attempt to repair a stuck job or broken tool
RepairTask Types
A job that needs to be unstuck
A tool that failed and needs repair
Example
Related Modules
Workspace Module
Persistent memory storage for agents
Tools Module
Extensible tool system for agent capabilities
LLM Module
Language model integration and providers