Skip to main content
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.

Architecture

Core Principles

Memory is Persistence

If you want to remember something, write it to a file

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

Key Operations

Reading Files

Writing Files

Directory Operations

Memory Operations

Identity Files

The workspace includes special files that shape the agent’s behavior:

MEMORY.md

Long-term curated notes loaded into the system prompt:
Keep MEMORY.md concise—it’s loaded on every session. Use daily logs for detailed session notes.

IDENTITY.md

Agent name, vibe, and personality:

SOUL.md

Core values and behavioral boundaries:

AGENTS.md

Session routine and operational instructions:

USER.md

Information about the user:

HEARTBEAT.md

Periodic background task checklist:
Keep HEARTBEAT.md empty to disable periodic checks and save API costs.

TOOLS.md

Environment-specific tool notes (guidance, not enforcement):

System Prompt Generation

The workspace builds the agent’s system prompt from identity files:

Group Chat Safety

Combines full-text (BM25) and semantic (vector) search using Reciprocal Rank Fusion:

Search Formula

Example

Search Result

Embedding Providers

Semantic search requires an embedding provider:

OpenAI

Ollama (Local)

NEAR AI

Mock (Testing)

Document Chunking

Files are automatically chunked for indexing:

Database Backends

The workspace supports multiple database backends:

PostgreSQL

Requires:
  • pgvector extension for vector search
  • Full-text search via ts_vector

libSQL (SQLite-compatible)

Local-first with optional sync to Turso.

Workspace API

Protected Files

Some files are read-only from tools to prevent prompt injection:
BOOTSTRAP.md is intentionally NOT protected so the agent can delete it after first-run onboarding.

Memory Hygiene

The workspace includes utilities for maintaining clean memory:

Next Steps

Routines

Automate periodic tasks with routines

Search API

API reference for hybrid search