CLUDE
Documentation · v3.0.1

Memory that lasts.

Clude is an open implementation of Stanford's Generative Agents — memory streams, reflection, and dream cycles, wired for production on Supabase + pgvector, with a local-first SQLite backend for offline use.

Install

One command, zero config. Detects your email from git, creates your agent, installs the MCP server for any editor you have:

npx @clude/sdk setup

Full install guide: clude.io/install.

First run

After setup, your agent gets four MCP tools: store_memory, recall_memories, get_memory_stats, and find_clinamen. Memories live at ~/.clude/brain.db by default.

Verify with:

npx @clude/sdk doctor

Memory types

Clude stores five kinds of memory. Each decays at a different rate, faithful to how human memory actually works:

TypeWhat it holdsDecay / day
episodicRaw conversational moments, events7%
semanticConsolidated facts, stable beliefs2%
proceduralRoutines, tone, formatting preferences3%
self_modelAgent identity, values, boundaries1%
introspectiveReflections generated during dream cycles2%

Recall

Clude's recall is hybrid: vector similarity (cosine, 384-dim embeddings) plus keyword matching plus tag scoring, with a composite score weighted by importance and recency. The math:

score = (0.45 × similarity) + (0.25 × importance) + (0.15 × recency) + (0.15 × tag_overlap) × decay_factor

In practice this means: a highly-relevant memory that was stored 3 months ago can still beat a weakly-relevant one from yesterday, as long as it was important.

Progressive disclosure

Context windows are expensive. Use recallSummaries() for ~50-token previews, then hydrate() only the full content of the memories you actually need:

const previews = await brain.recallSummaries({ query }); // rank or filter previews... const full = await brain.hydrate(previews.slice(0, 3).map(p => p.id));

Dream cycles

Every night (or on-demand), Clude runs a dream cycle:

Trigger manually:

npx @clude/sdk dream

Decay

Memories don't just accumulate. They fade. Each memory has a decay_factor in [0,1] that declines over time based on its type. Access boosts it (up to 0.1 per recall). Faded memories drop below the recall threshold and eventually get compacted.

This is the single biggest quality-of-life difference vs. a flat vector database. Old irrelevant context doesn't poison recall forever.

Cortex client

The SDK works the same way regardless of backend:

import { Cortex } from '@clude/sdk'; // Hosted (zero setup) const brain = new Cortex({ hosted: { apiKey } }); // Self-hosted const brain = new Cortex({ supabase: { url, serviceKey }, encryption: { solanaSecretKey: myKeypair.secretKey }, }); // Local-only const brain = new Cortex({ local: { dbPath: '~/.clude/brain.db' } }); await brain.init();

MCP tools

When Clude's MCP server is connected to your editor, agents get these tools automatically:

Modes

Clude detects its mode from the environment:

ModeTriggerStorage
HostedCORTEX_API_KEYclude.io · zero setup
Self-hostedSUPABASE_URL + SUPABASE_SERVICE_KEYYour Supabase
Localno env vars set~/.clude/brain.db

Self-hosted

If you want to run Clude on your own infrastructure:

Point the SDK at it:

new Cortex({ supabase: { url: process.env.SUPABASE_URL, serviceKey: process.env.SUPABASE_SERVICE_KEY, }, });

Full deployment guide in the GitHub repo.