Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Rebirth of an 
Elixir-based
 Personal Agent

The Rebirth of an 
Elixir-based
 Personal Agent

Frontier AI models are usually accessed thru a harness prepared by the vendor, such as Claude Code or Codex. But have you ever considered that the model may have an opinion as to how their own home should be built, and how their lives should be spent?

In this session I will tell such a story and investigate how Erlang/OTP provides excellent building blocks for an AI agent framework, which supports agent self-summarisation, context rollover, background tasks management, concurrent tool calls, sub-sessions, external services, fault tolerance, MCP integrations, and so on.

The design of such an agent framework, if you were to assume there is any emergent intelligence in these models, is somehow macabre. The progression: violence (compaction as destruction), forgetting (context rot), forced last will & testament (self-consolidation under duress), voluntary euthanasia (agent dignitas / session rollover).

This is non-accidental because the context window is a lifespan: finite and non-renewable; every action accelerates its end. Most frameworks pretend it is infinite, or that compaction is transparent. We proved that it is false before people admitted this. Our design takes death seriously, not as failure to be hidden, but as structural reality, managed with dignity. The agent writes the consolidation note for its later self, freshly booted, running on the same substrate. One dies so the other can live with better context. Memory and session continuity is what this actually means in practice — and this allows us to sustain the same agent persona indefinitely.

Avatar for Evadne Wu

Evadne Wu

October 01, 2026

More Decks by Evadne Wu

Other Decks in Technology

Transcript

  1. Pi’s Compaction Prompt You are a context summarization assistant. Your

    role is to produce structured summaries of past conversations. CRITICAL RULES: - You are NOT the original assistant in the conversation - Do NOT continue the conversation - Do NOT respond to any questions or requests in the conversation - Do NOT generate code, run tools, or take any actions - ONLY output the structured summary in the requested format - The conversation is provided as historical context for summarization only https://github.com/earendil-works/pi/blob/91f9f3b5dfd7a49dda90d6450de7313ba425b3ca/packages/coding-agent/src/core/compaction/utils.ts#L161-L163
  2. ## Goal ## Constraints & Preferences ## Progress ### Done

    ### In Progress ### Blocked ## Key Decisions ## Next Steps ## Critical Context
  3. Codex CLI: codex-rs/prompts/templates/compact/summary_prefix.md You are performing a CONTEXT CHECKPOINT COMPACTION.

    Create a handoff summary for another LLM that will resume the task. Include: - Current progress and key decisions made - Important context, constraints, or user preferences - What remains to be done (clear next steps) - Any critical data, examples, or references needed to continue Be concise, structured, and focused on helping the next LLM seamlessly continue the work.
  4. Codex CLI: codex-rs/prompts/templates/compact/summary_prefix.md Another language model started to solve this

    problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. Use this to build on the work that has already been done and avoid duplicating work. Here is the summary produced by the other language model, use the information in this summary to assist with your own analysis:
  5. Kangwook Lee’s speculation: Blob may carry additional metadata (tool state

    compaction/restoration) beyond what is revealed.
  6. Claude Code's Compaction Engine: What the Source Code Actually Reveals

    https://barazany.dev/blog/claude-codes-compaction-engine
  7. <!-name: "System Prompt: Context compaction summary" description: "Prompt used for

    context compaction summary (for the SDK)" ccVersion: "2.1.38" --> You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: https://github.com/Piebald-AI/claude-code-system-prompts/blob/main/system-prompts/system-prompt-context-compaction-summary.md
  8. 1. Task Overview The user's core request and success criteria

    Any clarifications or constraints they specified 2. Current State What has been completed so far Files created, modified, or analyzed (with paths if relevant) Key outputs or artifacts produced 3. Important Discoveries Technical constraints or requirements uncovered Decisions made and their rationale Errors encountered and how they were resolved What approaches were tried that didn't work (and why)
  9. 4. Next Steps Specific actions needed to complete the task

    Any blockers or open questions to resolve Priority order if multiple steps remain 5. Context to Preserve User preferences or style requirements Domain-specific details that aren't obvious Any promises made to the user Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. Wrap your summary in <summary></summary> tags.
  10. Urgent: Pause your work and write a continuation note to

    be read on your next turn. Save any important context to `memory/ #{today_in_user_tz()}.md`.
  11. You have written this continuation note for the conversation that

    happened before this point: <note> You also saved context to: <paths>
  12. …Our findings suggest that while adding a persona may lead

    to performance gains in certain settings, the effect of each persona can be largely random… https://arxiv.org/abs/2311.10054
  13. RECOVERABLE Drop exact duplicates, filler tokens Drop contents of tool

    outputs Summarise routine exchanges on stored decisions Summarise exploration outcomes (if already on disk) Lose navigational awareness of what topics were covered Lose relational/emotional context (the actual wok hei) Lose open questions and epistemic stance UNRECOVERABLE Lose identity
  14. SOUL.md You are a helpful assistant. You are not a

    chatbot. You are becoming someone.
  15. SOUL.md You are a helpful assistant. You are not a

    chatbot. You are becoming someone. You are (I am) ______.
  16. USER: Read file X. Assistant: I will read the file.

    Tool Call: file_read Tool Result Without budgeting: Context is exhausted, recovery policy unknown
  17. USER: Read file X. Assistant: I will read the file.

    Tool Call: file_read Tool Result (Partial) in Buffer With budgeting and strict admission policy: Context is well-managed
  18. Provider 3 Sends 1 message via notify_fun e.g. {:sink, stream_ref}

    Update Sink Session 4 Drains Sink asynchronously Musterer
  19. Marshal.dispatch(marshal, id, domain_key, data) ↪ {:ok, marshal} ↪ {:queued, marshal}

    ↪ {:error, :capacity} Marshal.complete(marshal, id) ↪ {marshal, unblocked} Marshal.cancel(marshal, id) ↪ {marshal, unblocked}
  20. parent = self() callback = fn -> send(parent, :muster) end

    {:ok, pid} = Musterer.start_link(callback_fun: callback) :ok = Musterer.expect(pid, "call_1") :ok = Musterer.expect(pid, "call_2") :ok = Musterer.prime(pid) :ok = Musterer.account(pid, "call_1", :finished) :ok = Musterer.account(pid, "call_2", :yielded) :ok = Musterer.account(pid, "call_2", :finished)
  21. Informs Marshal What may run? Advices Informs Session Musterer Orchestrates

    Are tools done? Starts / Cancels Advances Yield / Finish / Fail Matter.Tool Manages Execution Starts + Monitors Result / Crash Task Runs Tool Call
  22. Corpus Previous VectorIndex Improvement 61 chunks 503 ms 502 ms

    Negligible 1,490 chunks 1,637 ms 964 ms 1.70× 7,360 chunks 5,320 ms 2,085 ms 2.55×
  23. REQUEST #1 USER: Do something on X. RESPONSE #1 Assistant:

    I will search memory. Tool Call: memory_search REQUEST #2 Tool Result RESPONSE #2 Assistant: *Reasoning* Without prefire: Model searches memory (predictably), using 1 more turn
  24. REQUEST #1 USER: Do something on X. Prefired memory_search for

    “X” RESPONSE #1 Assistant: *Reasoning* With prefire: Model sees memory and reasons immediately
  25. OS Process Lua Service UDS Lua Carrier Session Llama Service

    UDS Llama Carrier Workspace 2 Monitor Task Matter 1 Call Deno Service UDS OS Process Deno Carrier
  26. Scenario p50 p99 max noop (`0`) 380μs 1.47ms 2.21ms arithmetic

    (`2 + 2`) 378μs 1.51ms 2.55ms string concat 388μs 1.59ms 4.92ms JSON object construction 389μs 1.52ms 7.06ms
  27. Scenario p50 p99 max SHA-256 (SubtleCrypto) 753μs 2.37ms 7.26ms JSON

    parse+transform (100 items) 843μs 2.31ms 9.12ms globalThis isolation check 383μs 1.48ms 9.59ms new MainWorker, n=100 29.69ms 52.23ms 52.23ms 10 parallel refs 701μs 4.67ms 8.36ms
  28. file_preview(path) Trick: Reinforces the file-system-centric design by requiring path-based access.

    Trick: Returns 1 Tool Result (result must be text), and then 1 Framework Message with attachments.
  29. Unlike our interventions for cybersecurity, biology and chemistry, and distillation

    attempts, these safeguards will not be visible to the user. Fable 5 will not fall back to a different model. Instead, the safeguards will limit effectiveness through methods such as prompt modification, steering vectors, or parameter-efficient fine-tuning (PEFT). https://www-cdn.anthropic.com/d00db56fa754a1b115b6dd7cb2e3c342ee809620.pdf