camelRun by camelAI
AI agent memory that keeps every message
camelRun by camelAI runs AI agents with full history, MEMORY.md dreaming, versioned camelFS files, and instant forks.camelRun by camelAI is a hosted runtime for AI agents that remember. Give each agent a key and it keeps full paged history, versioned camelFS files, and consolidated notes in MEMORY.md—with instant copy-on-write forks at any step.
weather-agentthe key · index.ts:8The user plans weekends in Lisbon and Oslo and asks about rain, warmth and what to pack. Lisbon has mostly been dry; Oslo is cooler, with rain most weekends.
Oct 1toOct 9
AI agents that remember across runs
Run index.ts on Thursday and the process exits. Run it again eight days later with a follow-up, and the agent already knows which cities you meant. Switch to memory.ts to read paged history, inspect /workspace/MEMORY.md, or fork the agent and its camelFS repo at any step.
const BASE = "https:/ / run.camelai.com";
const headers = {
Authorization: `Bearer ${process.env.CAMELRUN_API_KEY}`,
"Content-Type": "application/json",
};
// Upsert by key: the same key always reaches the same agent and history.
await fetch(`${BASE}/ v2/ agents/ weather-agent`, {
method: "PUT",
headers,
body: JSON.stringify({
model: "openrouter/ openai/ gpt-6-luna",
instructions: "You are a concise weather assistant. Keep notes in /workspace.",
builtins: ["files", "web_search"],
dreaming: { enabled: true, idleSeconds: 3600 },
compactOnIdle: true,
}),
});
const prompt = process.argv.slice(2).join(" ") || "Do I need an umbrella in Lisbon or Oslo this weekend?";
const res = await fetch(`${BASE}/ v2/ agents/ weather-agent/ runs`, {
method: "POST",
headers,
body: JSON.stringify({ prompt, wait: true }),
});
const run = await res.json();
console.log(run.text);const BASE = "https:/ / run.camelai.com";
const headers = { Authorization: `Bearer ${process.env.CAMELRUN_API_KEY}` };
// 1. Page through full conversation history (preserved after compaction)
const history = await (await fetch(`${BASE}/ v2/ agents/ weather-agent/ history? after=0& limit=50`, { headers })).json();
// 2. Read MEMORY.md written by idle dreaming from the agent's camelFS repo
const agent = await (await fetch(`${BASE}/ v2/ agents/ weather-agent`, { headers })).json();
const memory = await (await fetch(`${BASE}/ v2/ repos/ ${agent.repoId}/ files? path=MEMORY.md`, { headers })).text();
// 3. Instant copy-on-write fork of history + camelFS repo at sequence 431
const fork = await (await fetch(`${BASE}/ v2/ agents/ weather-agent/ fork`, {
method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ key: "weather-agent-experiment", atSeq: 431 }),
})).json();$ export CAMELRUN_API_KEY=cr_live_...
$ node index.ts "Do I need an umbrella in Lisbon or Oslo this weekend?"
→ weather({"city":"Lisbon"})
→ weather({"city":"Oslo"})
For this weekend (October 3–4), an umbrella looks unlikely to be needed in either city. Rain chances are low in Lisbon (9% Saturday, 17% Sunday) and modest in Oslo (22% both days).
$ export CAMELRUN_API_KEY=cr_live_...
$ node index.ts "What about this weekend?"
→ weather({"city":"Lisbon"})
→ weather({"city":"Oslo"})
For this weekend (October 10–11), take an umbrella to Oslo: rain is likely on Saturday (80%) and possible on Sunday (45%). Lisbon stays dry, at 5% and 10%.
Oct 14Oct 16
Versioned memory in camelFS files and MEMORY.md
Every agent gets a versioned camelFS repo mounted at /workspace. Ask it to keep notes—or enable idle dreaming so it consolidates facts into /workspace/MEMORY.md—and every write becomes an immutable commit your app reads from /v2/repos/:repoId/files.
- 461YouI fly to Oslo on the 17th. Keep a packing list for the trip in a file.Oct 14 20:31
- 467YouAnything to add to my packing list?Oct 16 07:50
# Oslo trip, October 17–20
- Waterproof jacket
- Warm layers for 4–9°C
- Walking shoes
- Compact umbrella (rain Saturday)
- Gloves for 3°C mornings
- Power adapter, type F
Oct 21 on
Long-term memory that outlasts the context window
As conversations grow past compactThresholdTokens—or during quiet periods with compactOnIdle enabled—camelRun compacts older turns into a summary for the model. Full conversation history stays intact and readable via GET /v2/agents/:key/history.
Weekends in Lisbon and Oslo: rain, warmth, what to pack.
id: 353 · data: {"seq":353,
FAQ
AI agent memory questions
- 01What are different types of memory in AI agents?
- Short-term memory is what fits in the active model window, episodic memory is the full log of past turns, and persistent workspace memory is structured notes the agent keeps on disk. On camelRun, the model reads recent messages plus any compacted summary,
GET /v2/agents/:key/historykeeps every turn, and the agent maintains versioned files and/workspace/MEMORY.mdin camelFS. - 02How do you keep AI agent memory accurate over long timelines?
- Give each user or workflow its own keyed agent so history stays isolated. Enable dreaming so idle agents consolidate durable facts into
/workspace/MEMORY.md, let threshold or idle compaction compress older turns, and share a camelFSrepoIdon separate branches when multiple agents collaborate on the same files. - 03What is the best memory architecture for an AI agent?
- One that keeps raw history intact while keeping every prompt focused. camelRun stores every turn in SQLite Durable Objects, compacts older context on threshold or idle, consolidates long-term notes into
/workspace/MEMORY.md, and versions workspace files in camelFS—with no separate memory service to operate. - 04Do I need a database to give my AI agent memory?
- No. The agent's key is its durable handle: upsert the same key from any process via
PUT /v2/agents/:keyand you reach the same agent with its history and camelFS files. State persists in camelRun until you delete it. - 05What happens when a conversation outgrows the model's context window?
- camelRun compacts older turns into a summary when context crosses
compactThresholdTokens, or during idle periods ifcompactOnIdleis turned on. You can also callPOST /v2/agents/:key/compactorPOST /v2/agents/:key/reset-contextexplicitly. Full conversation history remains readable throughGET /v2/agents/:key/history. - 06Can my code read, version, or fork an agent's memory?
- Yes. Page through stored turns with
GET /v2/agents/:key/history, read or restore versioned files via/v2/repos/:repoId/filesand/v2/repos/:repoId/history, and create an instant copy-on-write fork of both history and the camelFS repo at any step (atSeq) usingPOST /v2/agents/:key/fork. - 07How much does AI agent memory cost?
- Storage for conversation history and versioned camelFS repos is currently unmetered ($0 right now), and idle, queued, or parked agents cost $0. Active agent time is $0.05 per active agent-hour, active Linux container execution (
bash) is $0.00005/sec ($0.18/hr) with free pre-warming, and model tokens are $0 from camelRun on BYOK or billed at the provider's price with no markup on direct providers. - 08Can I retrieve my agents' history and files or host camelRun myself?
- Yes. Read any agent's full history via
GET /v2/agents/:key/historyand pull versioned workspace files from/v2/repos/:repoId/files(there is no bulk account ZIP export in v2). Self-host the open-source runtime (AGPL-3.0 on GitHub) in your own Cloudflare account with Wrangler, or try experimental self-hosting on your own machines withcelld.
More on AI agent memory
- OverviewcamelRunThe hosted runtime for AI agents: the loop, history, tools, channels and pricing.
- camelRunDurable AI agentsKeyed agents keep their history, versioned camelFS workspaces, and pending runs in camelRun. Fork any agent and its repo instantly at any step (atSeq).
- CompareLetta AI alternativeCompare how Letta and camelRun keep agent state. In camelRun, each keyed agent gets its own conversation history and versioned workspace.
- camelRunMulti-tenant AI agentsGive each user or thread a keyed agent with its own history and workspace. Runtime-authenticated MCP calls carry Ed25519-signed JWTs proving the agent and end-user.
- camelRunMulti-agent orchestrationUse delegate to hand off a task, or use spawn_agent and wait_agent to run child agents in parallel and collect their results. The parent can park while its children work.
- camelRunSelf-hosted AI agentsDeploy the AGPL-3.0 runtime to your own Cloudflare account with Wrangler. Configure Workers, SQLite Durable Objects, R2, and Containers for your account.
- CompareCloudflare Agents alternativeCompare Cloudflare's Agents SDK with camelRun's hosted agent loop. camelRun stores keyed agent state in SQLite Durable Objects and workspace files in camelFS.
- GuideHow to Give AI Agents Memory That Survives RestartsWhat to store where, how compaction works, and a two-process test that proves it.
- GuideHow to Build Durable AI Agents That Survive Crashes and DeploysKeep state through crashes and deploys, and wait days for a person.
- PricingcamelRun pricing$0.05 per active agent-hour, $0 while idle, and unmetered camelFS storage.
- DocscamelRun conceptsKeyed agents, compaction, idle dreaming, and instant atSeq forks.
- DocscamelFS repos and filesVersioned workspaces, branches, file history, and restoring commits.
Give your AI
agent
a memory
Create a cr_live_ API key in the console, run your first keyed agent, and ask it a follow-up tomorrow.
claude mcp add --transport http camelrun https://run.camelai.com/mcp
Adds camelRun's hosted MCP server to Claude Code (also works with Codex and ChatGPT). Signing in creates your account automatically.