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 workspace provides persistent memory for agents with a flexible filesystem-like structure. Agents can create arbitrary markdown file hierarchies that get indexed for full-text and semantic search. Inspired by OpenClaw, the workspace gives agents long-term memory across sessions.Filesystem-like Structure
Core Types
Workspace
Database-backed memory storage scoped to a user and optionally an agent.User identifier from the channel
Optional agent ID for multi-agent isolation
Embedding provider for semantic search
Constructors
Create a new workspace backed by PostgreSQL (requires
postgres feature)Create a workspace with any Database implementation (libSQL, etc.)
Set a specific agent ID for multi-agent isolation
Set the embedding provider for semantic search
Example
File Operations
Workspace provides a simple filesystem-like API for document management.read
Read a file by path. Returns error if file doesn’t exist.
write
Create or update a file. Creates parent directories implicitly. Re-indexes for search.
append
Append content to a file. Creates the file if it doesn’t exist. Adds newline separator.
exists
Check if a file exists at the given path.
delete
Delete a file and its associated search chunks.
list
List files and directories at a path. Returns immediate children (not recursive). Use empty string or ”/” for root.
list_all
List all files recursively as a flat list of paths.
Convenience Methods
memory
Get the main MEMORY.md document (long-term curated memory). Creates if it doesn’t exist.
today_log
Get today’s daily log (append-only, keyed by date).
daily_log
Get a daily log for a specific date.
append_memory
Append an entry to MEMORY.md with double newline separation. For important facts and decisions.
append_daily_log
Append a timestamped entry to today’s daily log.
heartbeat_checklist
Get the HEARTBEAT.md checklist for periodic background tasks. Returns seed template if not yet created.
System Prompt
system_prompt
Build the system prompt from identity files (AGENTS.md, SOUL.md, USER.md, IDENTITY.md, MEMORY.md). Includes last 2 days of daily logs.
system_prompt_for_context
Build system prompt with option to exclude MEMORY.md for group chats (privacy protection).
Search
search
Hybrid search combining full-text (BM25) and semantic (vector) search using Reciprocal Rank Fusion.
search_with_config
Search with custom configuration for ranking weights and limits.
Seeding
seed_if_empty
Seed missing core identity files (README, MEMORY, IDENTITY, SOUL, AGENTS, USER, HEARTBEAT). Only creates files that don’t exist - never overwrites. Returns number of files created.
backfill_embeddings
Generate embeddings for chunks that don’t have them yet. Useful after enabling embedding provider. Returns number of chunks processed.
Data Types
MemoryDocument
A document stored in the workspace.Unique document identifier
Owner user identifier
Optional agent ID for isolation
File path (e.g., “context/vision.md”)
Full document content
Creation timestamp
Last update timestamp
WorkspaceEntry
An entry in a directory listing.Relative path from listing directory
True if this entry has children
Last update time (latest among children for directories)
First ~200 characters (None for directories)
SearchResult
A search result with ranking score.Document path
Matched chunk content
Combined relevance score (0.0 to 1.0)
Preview text with context
SearchConfig
Configuration for hybrid search ranking.Maximum results to return
Weight for semantic similarity (0.0 to 1.0)
Weight for BM25 full-text score (0.0 to 1.0)
RRF constant (higher = less aggressive fusion)
Embedding Providers
Workspace supports multiple embedding providers for semantic search.OpenAiEmbeddings
OllamaEmbeddings
NearAiEmbeddings
MockEmbeddings
For testing without external dependencies.Key Patterns
- Memory is persistence: If you want to remember something, write it to the workspace
- Flexible structure: Create any directory/file hierarchy you need
- Self-documenting: Use README.md files to describe directory structure
- Hybrid search: Vector similarity + BM25 full-text via RRF for best results
- Privacy boundaries: Use
system_prompt_for_context(true)to exclude personal memory in group chats
Related Modules
Agent Module
Core agent orchestration and session management
LLM Module
Language model integration for reasoning