<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Fenix</title>
    <description>The latest articles on Forem by Fenix (@fenix_23505d14df386c00ced).</description>
    <link>https://forem.com/fenix_23505d14df386c00ced</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3823217%2F42aca0c2-69b9-4be7-b0f2-519a6b241dc4.jpg</url>
      <title>Forem: Fenix</title>
      <link>https://forem.com/fenix_23505d14df386c00ced</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/fenix_23505d14df386c00ced"/>
    <language>en</language>
    <item>
      <title>Codex /goal and OpenGUI: long-running tasks need state</title>
      <dc:creator>Fenix</dc:creator>
      <pubDate>Tue, 05 May 2026 01:55:19 +0000</pubDate>
      <link>https://forem.com/fenix_23505d14df386c00ced/codex-goal-and-opengui-long-running-tasks-need-state-1c61</link>
      <guid>https://forem.com/fenix_23505d14df386c00ced/codex-goal-and-opengui-long-running-tasks-need-state-1c61</guid>
      <description>&lt;p&gt;Long-running agents tend to fail in the second half.&lt;/p&gt;

&lt;p&gt;The first step is often fine. Fix a CI failure, open an app, tap a button, search for a keyword. Models can produce a reasonable first action. The trouble starts around step ten: what has already happened, where the task is stuck, what the original boundary was, and when the task is allowed to stop. Those details slide out of context.&lt;/p&gt;

&lt;p&gt;Codex CLI 0.128.0 added &lt;code&gt;/goal&lt;/code&gt;. The release note describes a persisted goal workflow: app-server APIs, model tools, runtime continuation, and TUI controls for create, pause, resume, and clear. Simon Willison compared it to OpenAI's version of a Ralph loop: set a goal for Codex, then let it keep executing, checking, and correcting until the goal is done or the budget runs out.&lt;/p&gt;

&lt;p&gt;In the context of long-running tasks, the change is about where the goal lives. It moves from text in a single prompt to state that can be resumed, paused, cleared, and referenced again later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why coding agents need goal
&lt;/h2&gt;

&lt;p&gt;Take a CI failure. The immediate failure may be one broken test. The agent changes the test, then the implementation, then adjusts a type because the code now feels awkward. Each step can be justified, but the final diff is much larger than the original problem.&lt;/p&gt;

&lt;p&gt;Code generation is rarely the hard part here. The run has no stable constraint attached to it. The original goal may have been as small as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/goal 修复当前 failing tests，保持 diff 尽量小，最后跑完 npm test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/goal 处理这个 PR 的 review comments，不改无关文件，最后给出改动摘要
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That kind of goal carries the target, the boundary, and the acceptance condition. It tells the agent where to go, what not to touch, and when to stop.&lt;/p&gt;

&lt;p&gt;Without that state, the agent is easily pulled around by the current error. A type looks awkward, so it changes the type. A test is hard to write, so it changes the test. The structure feels messy, so it refactors. Each local move can make sense, while the whole task drifts.&lt;/p&gt;

&lt;h2&gt;
  
  
  On phones, the hard part is screen state
&lt;/h2&gt;

&lt;p&gt;OpenGUI works on a different kind of long-running task: letting AI operate a real Android phone.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/Core-Mate/open-gui" rel="noopener noreferrer"&gt;https://github.com/Core-Mate/open-gui&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a codebase, state can still land in files, tests, and diffs. On a phone, state is a live screen.&lt;/p&gt;

&lt;p&gt;For example, ask the phone to open X, search for discussions about mobile AI agents, collect the main points, and summarize what people care about. As a sentence, this looks simple. On the phone, it becomes a series of state checks: is the app open, is this the home page, is the search box focused, did the results finish loading, did a login prompt, permission prompt, or follow recommendation appear in the middle.&lt;/p&gt;

&lt;p&gt;The loop of screenshot, tap, screenshot can only carry short tasks. If the screen does not change, the system has to decide whether the tap missed, the network is slow, the page is loading, or the action has no visible feedback. If the page jumps somewhere else, it also has to decide whether to go back, retry, or continue from the new page.&lt;/p&gt;

&lt;p&gt;So a goal on mobile has to answer a few concrete questions: which step is the task on, whether the current screen supports the next step, where to recover after a failure, and when the run can end.&lt;/p&gt;

&lt;h2&gt;
  
  
  OpenGUI turns the goal into a state flow
&lt;/h2&gt;

&lt;p&gt;I ran OpenGUI and read through the source. It connects the backend graph, device connection, and Android-side action execution instead of leaving phone automation as a script.&lt;/p&gt;

&lt;p&gt;On the backend, the main entry point is &lt;code&gt;server/apps/backend/src/modules/graph-agent/graph/mobile-agent.graph.ts&lt;/code&gt;. Complex tasks go through &lt;code&gt;Plan Supervisor&lt;/code&gt;, where the plan is split into executable subtasks. Concrete actions enter &lt;code&gt;executor.graph.ts&lt;/code&gt;, the device execution subgraph. The execution result goes back to the supervisor, which decides whether to continue, retry, replan, or hand off to &lt;code&gt;Summarizer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On Android, actions are applied to the real device. &lt;code&gt;client/core_accessibility/.../GestureService.kt&lt;/code&gt; executes GUI actions such as taps and typing. The device keeps a WebSocket connection to the backend, and &lt;code&gt;client/core_network/.../StandbySocketManager.kt&lt;/code&gt; handles the standby connection. Feishu/Lark, Telegram, and REST API can sit outside this as remote task entry points, turning the phone from a local demo device into something that can receive work.&lt;/p&gt;

&lt;p&gt;OpenGUI spreads the goal across several pieces of state: the plan document, current subtask, device screenshot, execution result, failure classification, and final summary. After each device action, the backend gets fresh device state and decides the next move.&lt;/p&gt;

&lt;p&gt;A simple script assumes the page will follow the expected order. OpenGUI assumes the page will change, so the executor has to keep reporting real state back to the backend.&lt;/p&gt;

&lt;h2&gt;
  
  
  The cost
&lt;/h2&gt;

&lt;p&gt;Putting the goal into a graph makes the system heavier.&lt;/p&gt;

&lt;p&gt;You have to maintain task state, keep WebSocket connections alive, handle device standby, send execution results and screenshots back, and design state transitions for continue, retry, cancel, and summarize. Model calls and screenshot analysis also cost money. The longer the task runs, the more that cost becomes an engineering concern instead of a small detail.&lt;/p&gt;

&lt;p&gt;But on mobile, it is hard to avoid this cost. Real apps show popups, hang on loading screens, misread taps, and send users to completely different pages. A prompt loop alone quickly turns into screenshot-based &lt;code&gt;while true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;OpenGUI puts that complexity into the system. A bad tap becomes an execution result for the supervisor to consume. The device keeps reporting state. It behaves more like a worker than a screen being clicked. The design is heavier, but it gives long-running tasks a place to be debugged, recovered, and reviewed.&lt;/p&gt;

&lt;p&gt;The first use cases I would try are community research, mobile flow testing, ops tasks, and App-only workflows that web automation cannot reach. These tasks may not need the strongest model, but they do need an execution system that can keep following the goal, see failure, and send state back.&lt;/p&gt;

&lt;p&gt;In coding agents, Codex &lt;code&gt;/goal&lt;/code&gt; keeps the goal as recoverable state. On phones, OpenGUI connects task progress, device feedback, and failure handling into a state flow. A long-running agent has to keep track of the run, not only execute the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OpenAI Codex 0.128.0 release: &lt;a href="https://github.com/openai/codex/releases/tag/rust-v0.128.0" rel="noopener noreferrer"&gt;https://github.com/openai/codex/releases/tag/rust-v0.128.0&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Simon Willison: &lt;a href="https://simonwillison.net/2026/Apr/30/codex-goals/" rel="noopener noreferrer"&gt;https://simonwillison.net/2026/Apr/30/codex-goals/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OpenGUI: &lt;a href="https://github.com/Core-Mate/open-gui" rel="noopener noreferrer"&gt;https://github.com/Core-Mate/open-gui&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>cli</category>
      <category>llm</category>
    </item>
    <item>
      <title>OpenGUI：手机上的 OpenClaw</title>
      <dc:creator>Fenix</dc:creator>
      <pubDate>Mon, 04 May 2026 13:24:24 +0000</pubDate>
      <link>https://forem.com/fenix_23505d14df386c00ced/openguishou-ji-shang-de-openclaw-38od</link>
      <guid>https://forem.com/fenix_23505d14df386c00ced/openguishou-ji-shang-de-openclaw-38od</guid>
      <description>&lt;p&gt;OpenGUI 是一个让 AI 操作真实 Android 手机的项目。&lt;/p&gt;

&lt;p&gt;项目地址：&lt;a href="https://github.com/Core-Mate/open-gui" rel="noopener noreferrer"&gt;https://github.com/Core-Mate/open-gui&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OpenClaw 把 AI 接到桌面环境，OpenGUI 则把类似的执行层放到了 Android 手机上。它面向的是手机 App 里的任务：点击、输入、截图、阅读页面、执行流程、返回结果。&lt;/p&gt;

&lt;p&gt;很多任务天然发生在移动端：X、Reddit、Hacker News、Telegram、微信、小红书，还有不少只在 App 内完整存在的业务流程。网页自动化覆盖不到这些场景。&lt;/p&gt;

&lt;h2&gt;
  
  
  基本架构
&lt;/h2&gt;

&lt;p&gt;OpenGUI 由后端和 Android 客户端两部分组成。&lt;/p&gt;

&lt;p&gt;后端负责理解任务、生成计划、监督执行和总结结果；Android 客户端连接后端，在真实设备上执行 GUI 操作。除了点屏幕，它还要处理任务状态、设备状态和失败后的恢复。&lt;/p&gt;

&lt;p&gt;仓库里能看到几块代码：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;后端的任务规划、Executor Graph、复核和总结&lt;/li&gt;
&lt;li&gt;Android 端的 AccessibilityService 动作执行&lt;/li&gt;
&lt;li&gt;设备通过 WebSocket 保持连接&lt;/li&gt;
&lt;li&gt;飞书/Lark、Telegram、REST API 等远程触发入口&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;这样跑起来后，手机可以保持待命，像一个远程 worker 一样接任务、执行任务、回传结果。&lt;/p&gt;

&lt;h2&gt;
  
  
  本地启动
&lt;/h2&gt;

&lt;p&gt;本地需要先准备 Android 开发环境，并连接一台 Android 设备。&lt;/p&gt;

&lt;p&gt;启动后端：&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;server
./start.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;启动 Android 客户端：&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;client
./start.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;后端脚本会准备依赖服务、数据库和 API；客户端脚本会构建 APK、安装到连接的 Android 设备上，并启动应用。&lt;/p&gt;

&lt;p&gt;手机侧还需要手动确认 USB 调试、Accessibility Service、悬浮窗权限，以及模型 API Key / 机器人凭证等。权限授权这部分保留人工确认更合理。&lt;/p&gt;

&lt;h2&gt;
  
  
  难点在哪里
&lt;/h2&gt;

&lt;p&gt;手机 Agent 的麻烦通常出现在后续状态处理上。点一下屏幕只是开始。&lt;/p&gt;

&lt;p&gt;比如一个很简单的任务：&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;打开 X，搜索 mobile AI agents 相关的近期讨论，收集主要观点，并总结大家主要关心的问题。&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;这个任务看起来不大，但手机上会发生很多不确定的事情：App 可能停在旧页面，搜索框可能没点中，结果页可能加载慢，中间还可能弹出登录、权限、推荐关注之类的窗口。&lt;/p&gt;

&lt;p&gt;所以 Mobile Agent 不能只会“看图然后点一下”。它还要知道任务做到哪一步了，当前屏幕是不是符合预期，点错之后怎么恢复，页面没变化时要不要重试，最后怎么把执行结果收回来。&lt;/p&gt;

&lt;p&gt;我实际跑了一下，也仔细看了 OpenGUI 的源码。它的思路还挺不错：后端 graph 管任务状态和计划，Executor Graph 负责把具体步骤派到手机上，Android 端通过 AccessibilityService 执行动作，再通过 WebSocket 把设备状态和执行结果传回来。&lt;/p&gt;

&lt;p&gt;这会把手机放进执行循环里。后端判断任务要继续、重试还是结束；手机端把真实屏幕和动作结果反馈回来。&lt;/p&gt;

&lt;p&gt;这套设计比单纯写脚本靠谱得多。手机可以待命、执行、反馈，更接近一个移动端 worker。&lt;/p&gt;

&lt;p&gt;我能想到的第一批用途，是社区信息收集、移动端流程测试、运营任务执行，以及那些网页自动化碰不到的 App-only 流程。&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>OpenGUI: OpenClaw for phones</title>
      <dc:creator>Fenix</dc:creator>
      <pubDate>Mon, 04 May 2026 13:23:21 +0000</pubDate>
      <link>https://forem.com/fenix_23505d14df386c00ced/opengui-openclaw-for-phones-31d8</link>
      <guid>https://forem.com/fenix_23505d14df386c00ced/opengui-openclaw-for-phones-31d8</guid>
      <description>&lt;p&gt;OpenGUI is a project that lets AI operate a real Android phone.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/Core-Mate/open-gui" rel="noopener noreferrer"&gt;https://github.com/Core-Mate/open-gui&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OpenClaw connects AI to a desktop environment. OpenGUI brings a similar execution layer to Android. It is aimed at tasks inside mobile apps: tapping, typing, taking screenshots, reading screens, moving through flows, and returning results.&lt;/p&gt;

&lt;p&gt;A lot of work already happens on phones: X, Reddit, Hacker News, Telegram, WeChat, Xiaohongshu, and plenty of business flows that only really exist inside apps. Web automation does not reach those surfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic architecture
&lt;/h2&gt;

&lt;p&gt;OpenGUI has two main parts: a backend and an Android client.&lt;/p&gt;

&lt;p&gt;The backend understands the task, creates a plan, supervises execution, and summarizes the result. The Android client connects to the backend and performs GUI actions on a real device. Beyond tapping the screen, it also has to handle task state, device state, and recovery after failures.&lt;/p&gt;

&lt;p&gt;You can see a few pieces in the repo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;task planning, Executor Graph, review, and summarization on the backend&lt;/li&gt;
&lt;li&gt;AccessibilityService-based action execution on Android&lt;/li&gt;
&lt;li&gt;WebSocket connections for keeping devices online&lt;/li&gt;
&lt;li&gt;remote entry points through Feishu/Lark, Telegram, and REST API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once it is running, the phone can stay on standby, receive a task like a remote worker, execute it, and send results back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local setup
&lt;/h2&gt;

&lt;p&gt;You need an Android development environment and a connected Android device.&lt;/p&gt;

&lt;p&gt;Start the backend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;server
./start.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the Android client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;client
./start.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The backend script prepares the services, database, and API. The client script builds the APK, installs it on the connected Android device, and launches the app.&lt;/p&gt;

&lt;p&gt;Some phone-side steps still need manual approval: USB debugging, Accessibility Service, overlay permission, and model API keys or bot credentials. Keeping those steps explicit makes sense.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it gets hard
&lt;/h2&gt;

&lt;p&gt;The hard part of a phone agent usually starts after the first tap.&lt;/p&gt;

&lt;p&gt;Take a simple task:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Open X, search for recent discussions about mobile AI agents, collect the main points, and summarize what people care about.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That sounds small, but the phone can be in many different states. The app may open on an old page. The search box may not receive focus. Results may load slowly. A login prompt, permission prompt, or follow recommendation can appear in the middle.&lt;/p&gt;

&lt;p&gt;So a mobile agent cannot just look at a screenshot and tap once. It has to know where the task is, whether the current screen matches expectations, how to recover after a bad tap, when to retry after no visible change, and how to collect the final result.&lt;/p&gt;

&lt;p&gt;I ran OpenGUI and also spent some time reading the source. The approach is pretty good: the backend graph manages task state and plans, the Executor Graph sends concrete steps to the phone, the Android side performs actions through AccessibilityService, and WebSocket sends device state and execution results back.&lt;/p&gt;

&lt;p&gt;This puts the phone inside the execution loop. The backend decides whether to continue, retry, or finish; the phone reports what actually happened on screen.&lt;/p&gt;

&lt;p&gt;This is much more practical than a plain script. The phone can stand by, execute, and report back. It starts to look like a mobile worker.&lt;/p&gt;

&lt;p&gt;The first use cases I can imagine are community research, mobile flow testing, ops tasks, and App-only workflows that web automation cannot touch.&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>NexAgent: a self-evolving AI agent built on Elixir/OTP</title>
      <dc:creator>Fenix</dc:creator>
      <pubDate>Sat, 14 Mar 2026 01:37:33 +0000</pubDate>
      <link>https://forem.com/fenix_23505d14df386c00ced/nexagent-a-self-evolving-ai-agent-built-on-elixirotp-121n</link>
      <guid>https://forem.com/fenix_23505d14df386c00ced/nexagent-a-self-evolving-ai-agent-built-on-elixirotp-121n</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;OpenClaw showed the world the future of AI Agents. But it got me wondering: if an Agent is going to stick with me for a decade, what should its architecture look like?&lt;br&gt;
&lt;strong&gt;Links&lt;/strong&gt;: NexAgent GitHub: &lt;a href="https://github.com/gofenix/nex-agent" rel="noopener noreferrer"&gt;https://github.com/gofenix/nex-agent&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;OpenClaw's &lt;a href="https://github.com/openclaw/openclaw" rel="noopener noreferrer"&gt;310k stars&lt;/a&gt; are well-deserved.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It proves that the "personal AI Agent" direction is right—that everyday users are willing to pay for an "AI that can actually do work." As a long-time AI observer, seeing that red lobster logo take over the internet makes me genuinely happy. It means Agents are finally moving from a niche toy to the mainstream.&lt;/p&gt;

&lt;p&gt;I spun one up myself. But using it surfaced some interesting issues that got me thinking: &lt;strong&gt;If an Agent is meant to be a 24/7 "companion" rather than just a "tool"—and if it needs to get smarter over time—how should its underlying architecture change?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There's no single right answer. OpenClaw proved the demand using TypeScript/Node.js. I wanted to explore a different path using Elixir/OTP.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://github.com/gofenix/nex-agent" rel="noopener noreferrer"&gt;NexAgent&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This isn't meant to compete with OpenClaw. It's an experiment focused entirely on the "long-running Agent" niche.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  My Experience Raising a Lobster
&lt;/h2&gt;

&lt;p&gt;Like everyone else, I found OpenClaw on Twitter.&lt;/p&gt;

&lt;p&gt;The red lobster logo, &lt;a href="https://github.com/openclaw/openclaw" rel="noopener noreferrer"&gt;310k stars&lt;/a&gt;, the "AI digital employee" pitch—it felt straight out of Iron Man (hello, JARVIS).&lt;/p&gt;

&lt;p&gt;I installed it right away, hooked up a Telegram Bot, and gave it a task: "Check my GitHub Issues every morning at 8 AM and ping the high-priority ones to Lark."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Early Days: Pure Magic&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Waking up to find my Issues neatly categorized.&lt;/li&gt;
&lt;li&gt;Asking "Any bugs today?" on Telegram and seeing it actually remember yesterday's context.&lt;/li&gt;
&lt;li&gt;Felt a solid 20% bump in my quality of life.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;That Led Me to a Different Question&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What if I don't just want to &lt;em&gt;use&lt;/em&gt; an Agent, but &lt;em&gt;raise&lt;/em&gt; it long-term?&lt;/li&gt;
&lt;li&gt;It needs 24/7 rock-solid uptime.&lt;/li&gt;
&lt;li&gt;It should compound its intelligence, not wipe the slate clean on every reboot.&lt;/li&gt;
&lt;li&gt;It needs to self-evolve instead of waiting for author updates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s when another tech stack came to mind.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Elixir/OTP?
&lt;/h2&gt;

&lt;p&gt;Choosing TypeScript/Node.js for OpenClaw was the right move. It dramatically lowered the barrier to entry and brought more than 310k people into the project. That's how open source wins.&lt;/p&gt;

&lt;p&gt;But I kept wondering: &lt;strong&gt;if the endgame is a "system that never goes down", what else is out there?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That led me to Elixir and OTP. Not for novelty's sake, but because OTP (Open Telecom Platform) was literally built for telecom switches: systems that &lt;em&gt;must&lt;/em&gt; run 24/7, stay resilient, and support hot code upgrades.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Node.js Approach&lt;/th&gt;
&lt;th&gt;OTP Approach&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Process Management&lt;/td&gt;
&lt;td&gt;Single process + external restart&lt;/td&gt;
&lt;td&gt;Supervision tree auto-restart&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory Isolation&lt;/td&gt;
&lt;td&gt;Same process space&lt;/td&gt;
&lt;td&gt;Each task runs in isolated process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hot Updates&lt;/td&gt;
&lt;td&gt;Restart the service&lt;/td&gt;
&lt;td&gt;Zero-downtime hot reload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Error Recovery&lt;/td&gt;
&lt;td&gt;Manual intervention&lt;/td&gt;
&lt;td&gt;Auto-recovery + graceful degradation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;It’s not about which stack is better—it’s about &lt;strong&gt;optimizing for different use cases&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenClaw optimizes for accessibility, putting Agents in everyone's hands.&lt;/li&gt;
&lt;li&gt;NexAgent optimizes for extreme stability, exploring what long-term AI companionship looks like.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Core Experiments with NexAgent
&lt;/h2&gt;

&lt;p&gt;I rewrote the Agent's core in Elixir and ran a few tests:&lt;/p&gt;

&lt;h3&gt;
  
  
  Experiment 1: Uptime
&lt;/h3&gt;

&lt;p&gt;I left NexAgent running on my local machine for an extended period:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stability&lt;/strong&gt;: Rock solid, zero memory leaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency&lt;/strong&gt;: Consistently fast, no degradation over time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resilience&lt;/strong&gt;: When a tool crashed, it restarted instantly without taking down the main loop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Zero manual restarts. OTP's supervision tree makes the system far easier to operate over long periods.&lt;/p&gt;

&lt;h3&gt;
  
  
  Experiment 2: Hot Reloading in the Wild
&lt;/h3&gt;

&lt;p&gt;My AMap weather tool suddenly broke, throwing API permission errors.&lt;/p&gt;

&lt;p&gt;The Agent self-diagnosed the issue: the API key was bound to iOS, but it was making server-side calls. It autonomously patched its own source code, swapping the logic to read a Web Service key instead.&lt;/p&gt;

&lt;p&gt;Four minutes later, it successfully pulled the weather for Shenzhen. No server restart. The chat session never dropped.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's the actual screenshot:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxe04pax02fs2v3r94dmu.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxe04pax02fs2v3r94dmu.jpeg" alt="Agent auto-fixing AMap weather tool" width="800" height="773"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From diagnosing the bug to writing the fix and hot-reloading the module—zero human intervention.&lt;/p&gt;
&lt;h3&gt;
  
  
  Experiment 3: Self-Evolution Pipeline
&lt;/h3&gt;

&lt;p&gt;NexAgent ships with a built-in pipeline for self-improvement:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Reflect&lt;/strong&gt;: Read the source code of any internal module.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analyze&lt;/strong&gt;: Figure out what's broken and draft a fix.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upgrade&lt;/strong&gt;: Apply the patch and hot-reload on the fly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This means that when tool logic needs to change, for example because an external API changes its response format, the Agent can inspect its own code, patch it, and update itself in memory without me having to restart the daemon.&lt;/p&gt;

&lt;p&gt;The mechanism works flawlessly. I'm currently exploring more complex "fully autonomous repair" scenarios.&lt;/p&gt;


&lt;h2&gt;
  
  
  Under the Hood of NexAgent
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Supervision Trees: Crash and Recover
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="c1"&gt;# lib/nex/agent/application.ex&lt;/span&gt;
&lt;span class="n"&gt;children&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="no"&gt;NexAgent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;InfrastructureSupervisor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;NexAgent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;WorkerSupervisor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;NexAgent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;Gateway&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="no"&gt;Supervisor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start_link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;strategy:&lt;/span&gt; &lt;span class="ss"&gt;:rest_for_one&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If the infrastructure tier crashes, all dependent Workers restart. If a single tool crashes, only that specific tool's process restarts. The main Agent loop keeps running.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Process Isolation: Each Task Runs in Its Own Process
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="c1"&gt;# lib/nex/agent/tool/registry.ex:181&lt;/span&gt;
&lt;span class="no"&gt;Task&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;Supervisor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start_child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;NexAgent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ToolTaskSupervisor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
  &lt;span class="n"&gt;tool_module&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Every single tool execution gets its own lightweight process. Crashes don't affect the main loop.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Hot Reloading: Upgrades on the Fly
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="c1"&gt;# lib/nex/agent/code_upgrade.ex:39&lt;/span&gt;
&lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="ss"&gt;:ok&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;maybe_validate_code&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
     &lt;span class="ss"&gt;:ok&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;create_backup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;source_path&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
     &lt;span class="ss"&gt;:ok&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;write_source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
     &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;:ok&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hot_reload&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;compile_and_load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
     &lt;span class="ss"&gt;:ok&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;maybe_health_check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;:ok&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;%{&lt;/span&gt;&lt;span class="ss"&gt;version:&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;hot_reload:&lt;/span&gt; &lt;span class="n"&gt;hot_reload&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;:error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rollback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Auto rollback on failure&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;:error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  4. Dual-Layer Memory
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MEMORY.md&lt;/strong&gt;: Long-term state (project context, user quirks).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HISTORY.md&lt;/strong&gt;: Grep-able conversation logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Powered by &lt;strong&gt;async consolidation&lt;/strong&gt;: When a chat gets too long, the Agent spins up a background process to summarize the history and extract facts into long-term memory. Zero latency impact on your active chat.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Six-Layer Evolution Model
&lt;/h2&gt;

&lt;p&gt;NexAgent doesn't just evolve in one way. It has six layers of growth:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;SOUL&lt;/strong&gt;: Personality and core values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;USER&lt;/strong&gt;: Your profile and how you like to collaborate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MEMORY&lt;/strong&gt;: Long-term context and project domain knowledge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SKILL&lt;/strong&gt;: Reusable workflows it has learned.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TOOL&lt;/strong&gt;: Hardcoded integrations and tools.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CODE&lt;/strong&gt;: The actual Elixir source code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every layer compounds over time, and each can evolve independently.&lt;/p&gt;


&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;

&lt;p&gt;Want to take it for a spin?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Install Elixir (~&amp;gt; 1.18)&lt;/span&gt;
&lt;span class="c"&gt;# 2. Clone repo&lt;/span&gt;
git clone https://github.com/gofenix/nex-agent.git
&lt;span class="nb"&gt;cd &lt;/span&gt;nex-agent
mix deps.get

&lt;span class="c"&gt;# 3. Initialize&lt;/span&gt;
mix nex.agent onboard

&lt;span class="c"&gt;# 4. Configure config file&lt;/span&gt;

&lt;span class="c"&gt;# 5. Start gateway&lt;/span&gt;
mix nex.agent gateway
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More docs: &lt;a href="https://github.com/gofenix/nex-agent" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;OpenClaw opened our eyes to what AI Agents can do. That's a massive win for the whole industry.&lt;/p&gt;

&lt;p&gt;NexAgent is simply probing a specific niche: &lt;strong&gt;If an Agent is meant to be a long-term companion, how should we build it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/openclaw/openclaw" rel="noopener noreferrer"&gt;310k people are raising lobsters&lt;/a&gt;, experiencing what it feels like to have AI at their fingertips.&lt;/p&gt;

&lt;p&gt;I'm planting a tree, waiting for the day it grows into a canopy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two different paths, one shared goal: weaving AI seamlessly into our lives.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>architecture</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
