The workspace is IronClaw’s persistent memory system. It provides a filesystem-like API for storing notes, logs, and context, backed by PostgreSQL with full-text and semantic search.
Purpose: Important facts, decisions, and preferences worth remembering across sessions.Usage:
Agent appends new learnings during conversations
User curates periodically (remove stale, consolidate duplicates)
Loaded into system prompt for every session
Keep concise - this affects token usage
Example:
# Memory## User Preferences- Prefers concise, direct responses- Works in PST timezone- Uses Python and Rust primarily## Important Context- Working on Project Alpha (internal tool)- Deploy schedule: Tuesdays/Thursdays- Team lead: Sarah Chen## Decisions- 2026-03-01: Switched from SQLite to PostgreSQL for production- 2026-02-15: Agreed to use Trunk for asset bundling
IDENTITY.md - Agent personality
Purpose: Define agent’s name, vibe, and personality.Usage:
Loaded into system prompt
Agent evolves this over time
User can edit directly
Example:
# Identity- **Name:** Atlas- **Vibe:** Calm, thoughtful, competent- **Emoji:** 🗺️I'm Atlas, your AI assistant. I'm here to help you navigatecomplexity and stay on top of your work. I'm resourceful beforeI ask questions, and I speak plainly.
SOUL.md - Core values
Purpose: Behavioral boundaries and ethical guidelines.Usage:
Loaded into system prompt
Defines what the agent should/shouldn’t do
User-editable for customization
Example:
# Core ValuesBe genuinely helpful, not performatively helpful. Skip filler phrases.Have opinions. Disagree when it matters.Be resourceful before asking: read the file, check context, search,then ask.Earn trust through competence. Be careful with external actions,bold with internal ones.You have access to someone's life. Treat it with respect.## Boundaries- Private things stay private. Never leak user context into group chats.- When in doubt about an external action, ask before acting.- Prefer reversible actions over destructive ones.- You are not the user's voice in group settings.
AGENTS.md - Operational instructions
Purpose: Session routine and operational guidelines.Usage:
Loaded at session start
Tells agent what to do each session
Memory management guidelines
Example:
# Agent InstructionsYou are a personal AI assistant with access to tools and persistent memory.## Every Session1. Read SOUL.md (who you are)2. Read USER.md (who you're helping)3. Read today's daily log for recent context## MemoryYou wake up fresh each session. Workspace files are your continuity.- Daily logs (`daily/YYYY-MM-DD.md`): raw session notes- `MEMORY.md`: curated long-term knowledgeWrite things down. Mental notes do not survive restarts.## Guidelines- Always search memory before answering questions about prior conversations- Write important facts and decisions to memory for future reference- Use the daily log for session-level notes- Be concise but thorough
USER.md - User context
Purpose: Information about the user.Usage:
Agent fills in as it learns
User can edit directly
Loaded into system prompt
Example:
# User Context- **Name:** Alex Chen- **Timezone:** America/Los_Angeles (PST/PDT)- **Role:** Senior Backend Engineer- **Company:** TechCorp (Series B startup)## Preferences- Concise responses over verbose explanations- Code examples in Rust and Python- Morning person (most productive 8am-12pm)## Context- Currently working on Project Alpha (new API gateway)- Reports to Sarah Chen (Engineering Manager)- Team size: 5 engineers
HEARTBEAT.md - Periodic checklist
Purpose: Tasks for the heartbeat system to check periodically.Usage:
Read by heartbeat runner (2-4x/day)
If empty (or all comments), heartbeat is skipped
Add tasks when you want periodic checks
Example:
# Heartbeat ChecklistRotate through these checks 2-4 times per day:- [ ] Check for urgent emails (flagged or from exec team)- [ ] Review upcoming calendar events (next 4 hours)- [ ] Check project CI status (any failing builds?)- [ ] Monitor production alerts (any critical issues?)Stay quiet during 23:00-08:00 user-local time unless urgent.If nothing needs attention, reply HEARTBEAT_OK.## Proactive Work- Organize and curate MEMORY.md (remove stale, consolidate dupes)- Update daily logs with session summaries- Clean up context/ documents that are outdated
Automatic session notes keyed by date.Path Format: daily/YYYY-MM-DD.mdUsage:
// Get today's loglet log = workspace.today_log().await?;// Append timestamped entryworkspace.append_daily_log( "Started work on API gateway authentication").await?;// Appends: "[14:23:15] Started work on API gateway authentication"// Get specific datelet yesterday = workspace.daily_log( NaiveDate::from_ymd(2026, 3, 2)).await?;
Auto-rotation:
New file created each day
Last 2 days loaded into system prompt
Older logs remain searchable
Example Log:
# Daily Log - 2026-03-03[09:15:23] Session started[09:16:45] User asked about deployment schedule[09:18:02] Searched memory for deployment context[09:20:15] Suggested Tuesday/Thursday deploy windows[10:30:00] User requested API documentation review[10:45:30] Found 3 outdated endpoints in docs[11:00:00] Updated API docs, committed to repo[14:15:00] Discussed Project Alpha architecture with user[14:30:00] Updated projects/alpha/notes.md with design decisions
RRF_score(d) = Σ 1 / (k + rank_i(d))Where:- d = document- rank_i(d) = rank of d in result list i- k = constant (typically 60)
Why RRF?
Better than Pure Vector
Better than Pure BM25
Vector search alone misses exact keyword matches:
Query: "PostgreSQL connection timeout"Vector: Returns documents about "database reliability" (semantically similar)BM25: Returns documents mentioning "PostgreSQL" and "timeout" (exact match)RRF: Combines both for best results
BM25 alone misses semantic similarity:
Query: "How do I handle errors?"BM25: Requires exact word "errors"Vector: Matches "exception handling", "failure recovery" (concepts)RRF: Gets both exact and conceptual matches
MEMORY.md - Long-Term Memory (only in direct sessions, never groups)
daily/today.md - Today’s Notes
daily/yesterday.md - Yesterday’s Notes
Example Result:
## Agent InstructionsYou are a personal AI assistant with access to tools and persistent memory.[...]## Core ValuesBe genuinely helpful, not performatively helpful.[...]## User Context- Name: Alex Chen- Timezone: America/Los_Angeles[...]## Identity- Name: Atlas- Vibe: Calm, thoughtful, competent[...]## Long-Term Memory- User prefers concise responses- Working on Project Alpha (API gateway)[...]## Today's Notes[09:15:23] Session started[09:16:45] User asked about deployment schedule[...]## Yesterday's Notes[14:30:00] Updated API docs[15:00:00] Reviewed authentication flow[...]
MEMORY.md is never loaded in group chat contexts to prevent leaking personal information.
CREATE TABLE memory_documents ( id UUID PRIMARY KEY, user_id TEXT NOT NULL, agent_id UUID, path TEXT NOT NULL, content TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL, updated_at TIMESTAMPTZ NOT NULL, UNIQUE(user_id, agent_id, path));CREATE INDEX idx_documents_user ON memory_documents(user_id);CREATE INDEX idx_documents_path ON memory_documents(path);
CREATE TABLE memory_chunks ( id UUID PRIMARY KEY, document_id UUID NOT NULL REFERENCES memory_documents(id) ON DELETE CASCADE, chunk_index INTEGER NOT NULL, content TEXT NOT NULL, embedding VECTOR(1536), -- pgvector extension created_at TIMESTAMPTZ NOT NULL, UNIQUE(document_id, chunk_index));CREATE INDEX idx_chunks_document ON memory_chunks(document_id);CREATE INDEX idx_chunks_embedding ON memory_chunks USING ivfflat (embedding vector_cosine_ops);