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:8
What the model readsthe summary and every message after itWhat history keepsevery message, from 0
Historyweather-agent
Asleep
Oct 918:02Now
431YouWhat about this weekend?
432Agentweather({"city":"Lisbon"}) weather({"city":"Oslo"})
433·434ToolResult of weather ×2
435AgentFor 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%.
Asleep 8 days
Oct 109:14
426YouDo I need an umbrella in Lisbon or Oslo this weekend?
427Agentweather({"city":"Lisbon"}) weather({"city":"Oslo"})
428·429ToolResult of weather ×2
430AgentFor 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).
Sep 24
402–425YouIs it warmer in Lisbon or Oslo on Saturday?
Sep 17
378–401YouWill it rain in Oslo on Sunday?
Sep 10
353–377YouLisbon this weekend: beach or museums?
Aug toSep 3
Summary the model reads

The 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.

Messages 0 to 352 · kept in history
The model reads the summary and every message after it. History keeps every message.
What the model readsWhat history keeps

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);
~/weather-agent
Thu Oct 1 · 09:14

$ 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).

~/weather-agent
Fri Oct 9 · 18:02

$ 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.

Historyweather-agent
  • 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
/workspace/oslo-packing-list.md179 B · commit 2
464 · Oct 14write({"path":"/workspace/oslo-packing-list.md","content":"# Oslo trip, October 17–20\n\n- Waterproof jacket\n- Warm layers for 4–9°C\n- Walking shoes\n- Power adapter, type F\n"})
# Oslo trip, October 17–20

- Waterproof jacket
- Warm layers for 4–9°C
- Walking shoes
471 · Oct 16edit({"path":"/workspace/oslo-packing-list.md","old":"- Walking shoes\n","new":"- Walking shoes\n- Compact umbrella (rain Saturday)\n- Gloves for 3°C mornings\n"})
- Compact umbrella (rain Saturday)
- Gloves for 3°C mornings
464 · Oct 14
- Power adapter, type F
  • Idle dreaming into MEMORY.md

    Turn on dreaming so idle agents consolidate durable facts into /workspace/MEMORY.md, or trigger a pass anytime with POST /v2/agents/:key/dream.

  • Instant copy-on-write forks

    Call POST /v2/agents/:key/fork with an optional atSeq to branch both conversation history and the camelFS repo instantly—no copying files.

  • Shared repos and branches

    Point multiple agents at the same repoId on separate branches, inspect commits with /v2/repos/:repoId/history, and restore earlier versions anytime.

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.

Context and historyweather-agent
Summarizing
The model readsHistory keeps
753Agent22 km/h right now.
752ToolResult of weather
751Agentweather({"city":"Lisbon"})
750YouWindy in Lisbon right now?
749AgentOnly Thursday, at 40%.
748ToolResult of weather
747Agentweather({"city":"Lisbon"})
746YouAny rain in Lisbon this week?
745Agent21°C and a 10% chance of rain.
744ToolResult of weather
743Agentweather({"city":"Lisbon"})
742YouHow warm is Lisbon on Sunday?
706 to 741 · 36 more
353 to 705 · 353 more messages
Summary of messages 0 to 352

Weekends in Lisbon and Oslo: rain, warmth, what to pack.

Events · /v2/agents/weather-agent/events

id: 353 · data: {"seq":353,"type":"context_compacted","data": {"upToSeq":352,"reason":"idle"}}

  • Threshold and idle compaction

    Compact automatically at compactThresholdTokens, while idle with compactOnIdle, or on demand with POST /v2/agents/:key/compact.

  • Full paged history

    GET /v2/agents/:key/history pages through every stored turn in order, even after repeated compactions or POST /v2/agents/:key/reset-context.

  • Switch models, keep the memory

    Update model, instructions, or tools anytime with PUT /v2/agents/:key—your agent's history and camelFS repo carry right over.

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/history keeps every turn, and the agent maintains versioned files and /workspace/MEMORY.md in 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 camelFS repoId on 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/:key and 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 if compactOnIdle is turned on. You can also call POST /v2/agents/:key/compact or POST /v2/agents/:key/reset-context explicitly. Full conversation history remains readable through GET /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/files and /v2/repos/:repoId/history, and create an instant copy-on-write fork of both history and the camelFS repo at any step (atSeq) using POST /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/history and 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 with celld.

More on AI agent memory

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.

Historyweather-agent
Asleep
Tomorrow
754YouYour next message
Connect your coding agent (no key)

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.