<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Technical Architecture on TorchTree</title>
        <link>https://torchtree.com/en/tags/technical-architecture/</link>
        <description>Recent content in Technical Architecture on TorchTree</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <copyright>TorchTree Co., Ltd.</copyright>
        <lastBuildDate>Sat, 13 Jun 2026 02:01:27 +0800</lastBuildDate><atom:link href="https://torchtree.com/en/tags/technical-architecture/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Pi Coding Agent in Practice: A Complete Guide from Installation to Everyday Use</title>
        <link>https://torchtree.com/en/post/pi-agent-setup-guide/</link>
        <pubDate>Sat, 13 Jun 2026 02:01:27 +0800</pubDate>
        
        <guid>https://torchtree.com/en/post/pi-agent-setup-guide/</guid>
        <description>&lt;p&gt;Pi is an open-source terminal coding agent built by Mario Zechner, the author of libGDX. Its core is just 418 lines of TypeScript, providing four tools by default — &lt;code&gt;read&lt;/code&gt;, &lt;code&gt;write&lt;/code&gt;, &lt;code&gt;edit&lt;/code&gt;, and &lt;code&gt;bash&lt;/code&gt; — with all advanced features supplied through extensions and packages. Previously I analyzed Pi&amp;rsquo;s design philosophy &lt;a class=&#34;link&#34; href=&#34;https://hitorch.cn/pi-coding-agent/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;at the architecture level&lt;/a&gt;. This article focuses on real-world use: how to install it, configure it, pick extension packages, and weave Pi into your daily development workflow.&lt;/p&gt;
&lt;h2 id=&#34;positioning-pis-role-in-the-toolchain&#34;&gt;Positioning: Pi&amp;rsquo;s role in the toolchain
&lt;/h2&gt;&lt;p&gt;Pi isn&amp;rsquo;t meant to replace every coding tool. Taking DeepakNess&amp;rsquo;s actual usage as an example, three tools each have their own division of labor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;OpenAI Codex&lt;/strong&gt;: handles complex tasks on the main project&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cursor&lt;/strong&gt;: everyday coding on the main project&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pi&lt;/strong&gt;: side projects, experimental tasks, and one-off scripts, usually paired with cheaper open-source models&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The core logic behind this layered strategy: use strong models plus heavyweight tools for high-complexity tasks, and lightweight agents plus low-cost models for simple or exploratory tasks — keeping overall spending in check.&lt;/p&gt;
&lt;h2 id=&#34;installation-and-first-time-configuration&#34;&gt;Installation and first-time configuration
&lt;/h2&gt;&lt;p&gt;Installing Pi only takes a single command:&lt;/p&gt;
&lt;p&gt;Once installed, launch it by typing &lt;code&gt;pi&lt;/code&gt; in the terminal and authenticate with the &lt;code&gt;/login&lt;/code&gt; command. Pi supports two authentication methods:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Subscription login&lt;/strong&gt;: supports Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot, Google Gemini CLI, and more&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;API key&lt;/strong&gt;: choose &amp;ldquo;Use an API key&amp;rdquo; and enter your provider&amp;rsquo;s secret (e.g., DeepSeek)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Use &lt;code&gt;/model&lt;/code&gt; or &lt;code&gt;Ctrl+L&lt;/code&gt; to open the model selector. The author defaults to &lt;code&gt;deepseek-v4-pro&lt;/code&gt; with the &lt;code&gt;xhigh&lt;/code&gt; thinking level for deep analysis, switching to &lt;code&gt;deepseek-v4-flash&lt;/code&gt; for quick tasks.&lt;/p&gt;
&lt;h2 id=&#34;three-core-extension-packages&#34;&gt;Three core extension packages
&lt;/h2&gt;&lt;p&gt;Pi installs extension packages with &lt;code&gt;pi install&lt;/code&gt;. The following three cover most practical scenarios:&lt;/p&gt;
&lt;h3 id=&#34;pi-web-access&#34;&gt;pi-web-access
&lt;/h3&gt;&lt;p&gt;Gives Pi web search, content scraping, YouTube transcription, and GitHub repository exploration capabilities.&lt;/p&gt;
&lt;p&gt;The configuration file lives at &lt;code&gt;~/.pi/web-search.json&lt;/code&gt;:&lt;/p&gt;
&lt;h3 id=&#34;pi-codex-goal&#34;&gt;pi-codex-goal
&lt;/h3&gt;&lt;p&gt;Adds a goal-tracking mechanism for long-running tasks, well-suited to complex tasks that require multiple steps.&lt;/p&gt;
&lt;h3 id=&#34;pi-vision-proxy&#34;&gt;pi-vision-proxy
&lt;/h3&gt;&lt;p&gt;When the main model lacks vision capabilities, it proxies image-analysis requests to a vision-capable model (such as Kimi K2.6).&lt;/p&gt;
&lt;h2 id=&#34;the-configuration-file-system&#34;&gt;The configuration-file system
&lt;/h2&gt;&lt;p&gt;Pi&amp;rsquo;s configuration is divided into two layers:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AGENTS.md (project context)&lt;/strong&gt;: placed in the project root or &lt;code&gt;~/.pi/agent/AGENTS.md&lt;/code&gt;, its contents are injected into the system prompt. Good for defining a project&amp;rsquo;s tech stack, coding conventions, and so on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;APPEND_SYSTEM.md (global behavior rules)&lt;/strong&gt;: located at &lt;code&gt;~/.pi/agent/APPEND_SYSTEM.md&lt;/code&gt;, appended to the end of the system prompt and given higher priority than AGENTS.md. Good for defining cross-project behavioral conventions, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Automatically use the vision proxy when the main model lacks vision&lt;/li&gt;
&lt;li&gt;Prefer local files, and only search the web when necessary&lt;/li&gt;
&lt;li&gt;Explain high-risk edits and commands&lt;/li&gt;
&lt;li&gt;Write concisely and avoid AI-sounding language&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;shortcuts-and-common-commands&#34;&gt;Shortcuts and common commands
&lt;/h2&gt;&lt;p&gt;Pi&amp;rsquo;s interaction design focuses on terminal efficiency:&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Action&lt;/th&gt;
          &lt;th&gt;Shortcut / command&lt;/th&gt;
          &lt;th&gt;Notes&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Open the model selector&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Ctrl+L&lt;!-- raw HTML omitted --&gt; or &lt;!-- raw HTML omitted --&gt;/model&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Quickly switch models&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Cycle through models&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Ctrl+P&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Rotate through configured models&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Adjust thinking level&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Shift+Tab&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Toggle thinking depth&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Interrupt the current action&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Escape&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Cancel the running task&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Send a steering message&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Enter&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Interrupt the agent&amp;rsquo;s current workflow and respond immediately&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Send a follow-up message&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Alt+Enter&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Append a message after the agent finishes its work&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Quit&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Ctrl+C&lt;!-- raw HTML omitted --&gt; (press twice)&lt;/td&gt;
          &lt;td&gt;Exit Pi&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Common commands include &lt;code&gt;/model&lt;/code&gt;, &lt;code&gt;/settings&lt;/code&gt;, &lt;code&gt;/resume&lt;/code&gt;, &lt;code&gt;/new&lt;/code&gt;, &lt;code&gt;/tree&lt;/code&gt; (session-branch management), &lt;code&gt;/compact&lt;/code&gt; (manually compact context), and &lt;code&gt;/session&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;a-real-world-cost-example&#34;&gt;A real-world cost example
&lt;/h2&gt;&lt;p&gt;A typical use case: crawling 285,000 URLs with DeepSeek v4 Flash took about 1.5 hours for a total cost of $1. This illustrates Pi&amp;rsquo;s cost advantage when paired with open-source models.&lt;/p&gt;
&lt;h2 id=&#34;why-choose-pi&#34;&gt;Why choose Pi
&lt;/h2&gt;&lt;p&gt;Pi&amp;rsquo;s core strengths come down to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Terminal-native&lt;/strong&gt;: no UI lag, responsive&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Model-agnostic&lt;/strong&gt;: switch providers anytime via &lt;code&gt;/model&lt;/code&gt;, with seamless context migration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Highly customizable&lt;/strong&gt;: the extension and package mechanism lets users assemble features on demand&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Session-tree management&lt;/strong&gt;: the &lt;code&gt;/tree&lt;/code&gt; command supports branching and navigating conversation history&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic context compaction&lt;/strong&gt;: automatically summarizes when approaching the context limit&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For terminal users, Pi&amp;rsquo;s value lies not in &amp;ldquo;having the most features&amp;rdquo; but in &amp;ldquo;having the highest controllability.&amp;rdquo; Every one of its behaviors is transparent, and every feature is explicitly installed. This design philosophy makes it the ideal choice for side projects and experimental tasks.&lt;/p&gt;
&lt;p&gt;Sources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://deepakness.com/blog/pi-agent-setup/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;DeepakNess: Setting Up and Using the Pi Coding Agent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://pi.dev/docs/latest&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Pi official documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        <item>
        <title>OpenClaw vs Hermes Agent: The Executor vs The Learner</title>
        <link>https://torchtree.com/en/post/openclaw-vs-hermes-agent/</link>
        <pubDate>Mon, 04 May 2026 15:57:59 +0800</pubDate>
        
        <guid>https://torchtree.com/en/post/openclaw-vs-hermes-agent/</guid>
        <description>&lt;p&gt;OpenClaw and Hermes Agent are the two most-watched open-source self-hosted AI agent frameworks of 2026. Both support multi-platform messaging, tool calling, and persistent memory, but they differ fundamentally in core philosophy, architectural design, and evolution path. This article provides a comprehensive comparison based on their latest versions as of May 2026.&lt;/p&gt;
&lt;p&gt;OpenClaw&amp;rsquo;s latest version is 2026.5.3 (released May 4, 2026), with a GitHub repo of 368k stars, 1,976 contributors, and 41,105 commits. Hermes Agent&amp;rsquo;s latest version is v0.12.0 &amp;ldquo;The Curator&amp;rdquo; (released April 30, 2026), with a GitHub repo of 132k+ stars, 822 contributors, and 7,150 commits.&lt;/p&gt;
&lt;h2 id=&#34;core-philosophy-executor-or-learner&#34;&gt;Core Philosophy: Executor or Learner
&lt;/h2&gt;&lt;p&gt;The fundamental divergence lies in how each answers the question &amp;ldquo;what should an agent be?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;OpenClaw positions itself as an &lt;strong&gt;executor (Doer)&lt;/strong&gt;. It is a toolset you configure and run, executing tasks according to predefined skills and workflows. Its performance is essentially fixed the moment your configuration is complete — unless you manually modify config or skill files, it won&amp;rsquo;t change significantly with usage over time. As the community puts it: &amp;ldquo;OpenClaw stays exactly as it was the day you started using it.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Hermes Agent positions itself as a &lt;strong&gt;learner&lt;/strong&gt;. Its core design revolves around a repeatable &amp;ldquo;do, learn, improve&amp;rdquo; loop. After each complex task, Hermes extracts reusable patterns, automatically writes skill documentation, and invokes and refines these skills in subsequent similar tasks. According to publicly available information from Nous Research, this procedural memory mechanism improves Hermes&amp;rsquo;s execution efficiency on families of repeated tasks by roughly 40% within weeks.&lt;/p&gt;
&lt;p&gt;This philosophical difference directly shapes the user-agent relationship: OpenClaw is more like a machine you program, while Hermes is more like a teammate who works with you — the longer you work together, the better you sync.&lt;/p&gt;
&lt;h2 id=&#34;architecture-gateway-centric-or-loop-centric&#34;&gt;Architecture: Gateway-Centric or Loop-Centric
&lt;/h2&gt;&lt;h3 id=&#34;openclaws-gateway-centric-architecture&#34;&gt;OpenClaw&amp;rsquo;s Gateway-Centric Architecture
&lt;/h3&gt;&lt;p&gt;OpenClaw uses a single Node.js process as its core; session management, routing, tool execution, and state storage are all concentrated in that process. Its architecture can be summarized as follows:&lt;/p&gt;
&lt;p&gt;The advantage of this design is that deployment and debugging are extremely simple. You start one process, all logs live in one place, and there are no service-discovery or cross-container networking issues. For individual users and small teams, this &amp;ldquo;all-in-one&amp;rdquo; experience reduces operational overhead.&lt;/p&gt;
&lt;p&gt;The cost is limited horizontal scalability. When concurrent task volume grows, you cannot scale a single subsystem independently — you must scale the whole thing up. Additionally, all components share the same address space, so a security flaw in one module can potentially impact the entire system.&lt;/p&gt;
&lt;h3 id=&#34;hermes-agents-loop-centric-architecture&#34;&gt;Hermes Agent&amp;rsquo;s Loop-Centric Architecture
&lt;/h3&gt;&lt;p&gt;Hermes Agent designs all components around the AIAgent loop. According to Nous Research&amp;rsquo;s official architecture documentation, its core file &lt;code&gt;run_agent.py&lt;/code&gt; is roughly 13,700 lines and contains three subsystems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Prompt Builder&lt;/strong&gt;: assembles system prompts, with built-in context compression and caching&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Provider Resolution&lt;/strong&gt;: supports three API modes (&lt;code&gt;chat_completions&lt;/code&gt;, &lt;code&gt;codex_responses&lt;/code&gt;, &lt;code&gt;anthropic_messages&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tool Dispatch&lt;/strong&gt;: a tool registry managing 61 tools and 52 tool sets&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Downstream systems include SQLite + FTS5 session storage, 6 terminal backends (local, Docker, SSH, Daytona, Singularity, Modal), and 19 messaging platform adapters.&lt;/p&gt;
&lt;p&gt;Under this architecture, the learning loop is a first-class architectural concern rather than an afterthought. Every component exists to serve the core &amp;ldquo;observe, act, reflect, improve&amp;rdquo; flow. The cost is higher system complexity and some operational capability required from the user.&lt;/p&gt;
&lt;h2 id=&#34;skill-systems-static-documentation-or-self-improving-programs&#34;&gt;Skill Systems: Static Documentation or Self-Improving Programs
&lt;/h2&gt;&lt;p&gt;Skills are the core competitive differentiator of agent frameworks, and the two take completely different design approaches.&lt;/p&gt;
&lt;h3 id=&#34;openclaw-community-driven-static-skills&#34;&gt;OpenClaw: Community-Driven Static Skills
&lt;/h3&gt;&lt;p&gt;OpenClaw skills exist as natural-language Markdown files (&lt;code&gt;SKILL.md&lt;/code&gt;) hosted on the ClawHub marketplace. As of early 2026, ClawHub has over 5,700 community-contributed skills covering content creation, sales automation, data analysis, customer service, and more.&lt;/p&gt;
&lt;p&gt;The benefit of this design is an extremely low barrier to entry. Even users without a programming background can define agent behavior by writing natural-language documents. The skill format is intuitive — similar to writing an operations manual.&lt;/p&gt;
&lt;p&gt;But static skills have two clear limitations: first, performance does not improve automatically with usage — executing the same task each time repeats the same reasoning process; second, the quality of community skills is uneven. A Snyk audit in early 2026 found 1,467 malicious skills on ClawHub, 91% of which combined prompt injection with traditional malware techniques. OpenClaw was forced to introduce mandatory SkillFortify verification in version 2026.3.22, and direct installation of skills via GitHub URLs was removed.&lt;/p&gt;
&lt;h3 id=&#34;hermes-agent-self-improving-procedural-memory&#34;&gt;Hermes Agent: Self-Improving Procedural Memory
&lt;/h3&gt;&lt;p&gt;Hermes Agent&amp;rsquo;s skill system is its most distinctive feature. Skills use the open agentskills.io standard format, but the key difference lies in how they are created and improved:&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Stage&lt;/th&gt;
          &lt;th&gt;Behavior&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Experience accumulation&lt;/td&gt;
          &lt;td&gt;Complete complex multi-step tasks&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Pattern extraction&lt;/td&gt;
          &lt;td&gt;Identify reusable workflow patterns&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Skill creation&lt;/td&gt;
          &lt;td&gt;Automatically write Markdown skill files&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Skill refinement&lt;/td&gt;
          &lt;td&gt;Self-improve based on results during later use&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Periodic review&lt;/td&gt;
          &lt;td&gt;Evaluate overall performance every 15 completed tasks&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This mechanism lets Hermes&amp;rsquo;s skill library grow and improve naturally over time. A customer-service flow that took multiple rounds of interaction to complete in March can become a one-shot automated operation by June. Procedural memory stores &amp;ldquo;how to do&amp;rdquo; rather than &amp;ldquo;what was said&amp;rdquo; — this is the essential difference from simple conversation history.&lt;/p&gt;
&lt;p&gt;Version v0.12.0 further introduced the &amp;ldquo;Curator&amp;rdquo; mechanism, which automatically rates and prunes the skill library to prevent low-quality skills from accumulating.&lt;/p&gt;
&lt;h2 id=&#34;memory-mechanisms-conversation-archive-or-layered-cognition&#34;&gt;Memory Mechanisms: Conversation Archive or Layered Cognition
&lt;/h2&gt;&lt;h3 id=&#34;openclaws-memory-design&#34;&gt;OpenClaw&amp;rsquo;s Memory Design
&lt;/h3&gt;&lt;p&gt;OpenClaw manages memory with plain Markdown files, including &lt;code&gt;SOUL.md&lt;/code&gt; (agent personality), &lt;code&gt;MEMORY.md&lt;/code&gt; (long-term memory), and &lt;code&gt;USER.md&lt;/code&gt; (user profile). Search relies on a SQLite vector database and keyword matching.&lt;/p&gt;
&lt;p&gt;The advantage is simplicity and transparency: users can open the Markdown files directly to view and edit the agent&amp;rsquo;s memory. The downside is that memories lack structured relationships, cross-session knowledge persistence requires manual configuration, and there is no automatic knowledge compression or summarization.&lt;/p&gt;
&lt;h3 id=&#34;hermes-agents-layered-memory-architecture&#34;&gt;Hermes Agent&amp;rsquo;s Layered Memory Architecture
&lt;/h3&gt;&lt;p&gt;Hermes Agent uses a five-layer memory architecture:&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Layer&lt;/th&gt;
          &lt;th&gt;Function&lt;/th&gt;
          &lt;th&gt;Storage&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Persistent notes&lt;/td&gt;
          &lt;td&gt;Agent-curated cross-session knowledge&lt;/td&gt;
          &lt;td&gt;SQLite + files&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Session history&lt;/td&gt;
          &lt;td&gt;Searchable conversation records&lt;/td&gt;
          &lt;td&gt;FTS5 full-text search&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;User modeling&lt;/td&gt;
          &lt;td&gt;Deep understanding of user preferences&lt;/td&gt;
          &lt;td&gt;Honcho dialectical modeling&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Procedural memory&lt;/td&gt;
          &lt;td&gt;Reusable skill methods&lt;/td&gt;
          &lt;td&gt;Markdown files&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Archive storage&lt;/td&gt;
          &lt;td&gt;Cold storage of old sessions&lt;/td&gt;
          &lt;td&gt;SQLite&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The core advantage of this layered design is &lt;strong&gt;hot/cold separation&lt;/strong&gt;. Frequently accessed memories (recent skills, user preferences) stay in the active context, while infrequently accessed history is compressed and archived — achieving long-term memory without significantly increasing token consumption. Since v0.7.0, the memory backend is also pluggable, supporting Honcho, vector databases, or custom storage.&lt;/p&gt;
&lt;h2 id=&#34;security-posture-open-by-default-or-conservative-by-default&#34;&gt;Security Posture: Open by Default or Conservative by Default
&lt;/h2&gt;&lt;p&gt;CVE-2026-25253 in February 2026 was a turning point for OpenClaw&amp;rsquo;s security reputation. This unauthenticated remote code execution vulnerability (CVSS 8.8) led to tens of thousands of unpatched OpenClaw instances being compromised before a patch was released. The root cause lay in OpenClaw&amp;rsquo;s single-process architecture and overly broad default permissions: a flaw in a single HTTP listening endpoint was enough to bring down the entire system.&lt;/p&gt;
&lt;p&gt;OpenClaw has since taken a series of remedial measures:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mandatory ClawHub plugin verification starting 2026.3.22, banning direct GitHub URL installation&lt;/li&gt;
&lt;li&gt;Introduced AgentWard runtime monitoring (eBPF probes)&lt;/li&gt;
&lt;li&gt;Patched follow-up vulnerabilities such as CVE-2026-2847 (WebSocket hijacking)&lt;/li&gt;
&lt;li&gt;The 2026.5.3 release further strengthened the plugin installation scanner and fixed the issue of officially bundled plugin packages being falsely blocked&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But most of these improvements are after-the-fact remediation. OpenClaw&amp;rsquo;s default security posture still leans toward &amp;ldquo;trust the single-machine environment,&amp;rdquo; with sandboxing off by default.&lt;/p&gt;
&lt;p&gt;Hermes Agent was designed with &lt;strong&gt;secure-by-default&lt;/strong&gt; principles from the start:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Container hardening (read-only root filesystem, reduced privileges)&lt;/li&gt;
&lt;li&gt;Five sandbox backends, with isolation enabled by default&lt;/li&gt;
&lt;li&gt;Built-in prompt injection scanning&lt;/li&gt;
&lt;li&gt;Sensitive-data context filtering&lt;/li&gt;
&lt;li&gt;Credential file isolation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As of May 2026, Hermes Agent has no publicly recorded CVEs. It should be noted that any complex software is hard to keep completely free of vulnerabilities; Hermes&amp;rsquo;s architectural advantage is that &lt;strong&gt;isolation design confines the blast radius of a single vulnerability to a specific module&lt;/strong&gt;, rather than preventing all vulnerabilities from occurring.&lt;/p&gt;
&lt;h2 id=&#34;feature-by-feature-comparison&#34;&gt;Feature-by-Feature Comparison
&lt;/h2&gt;&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Dimension&lt;/th&gt;
          &lt;th&gt;OpenClaw 2026.5.3&lt;/th&gt;
          &lt;th&gt;Hermes Agent v0.12.0&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Messaging platforms&lt;/td&gt;
          &lt;td&gt;25+&lt;/td&gt;
          &lt;td&gt;19 (incl. Teams, Yuanbao, QQBot, Home Assistant)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Terminal backends&lt;/td&gt;
          &lt;td&gt;2 (local, Docker)&lt;/td&gt;
          &lt;td&gt;6 (local, Docker, SSH, Daytona, Singularity, Modal)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Built-in tools&lt;/td&gt;
          &lt;td&gt;Depends on skills/plugins&lt;/td&gt;
          &lt;td&gt;40+&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Subagents&lt;/td&gt;
          &lt;td&gt;Supported&lt;/td&gt;
          &lt;td&gt;Isolated subagents (separate session, terminal, Python RPC)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;MCP support&lt;/td&gt;
          &lt;td&gt;Client&lt;/td&gt;
          &lt;td&gt;Client + Server mode&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Scheduled tasks&lt;/td&gt;
          &lt;td&gt;Heartbeat cron&lt;/td&gt;
          &lt;td&gt;Built-in Cron scheduler&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Model providers&lt;/td&gt;
          &lt;td&gt;OpenAI, Anthropic, Google, OpenRouter&lt;/td&gt;
          &lt;td&gt;Nous Portal (400+), OpenRouter (200+), OpenAI, Anthropic, Gemini, Bedrock, Xiaomi MiMo, etc.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;RL/research support&lt;/td&gt;
          &lt;td&gt;None&lt;/td&gt;
          &lt;td&gt;Atropos integration, batch trajectory generation&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Voice/TTS&lt;/td&gt;
          &lt;td&gt;ElevenLabs, Edge TTS, macOS system TTS&lt;/td&gt;
          &lt;td&gt;Supported&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Browser automation&lt;/td&gt;
          &lt;td&gt;Playwright&lt;/td&gt;
          &lt;td&gt;Camofox (10 browser tools)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Local LLMs&lt;/td&gt;
          &lt;td&gt;Ollama, llama.cpp, vLLM&lt;/td&gt;
          &lt;td&gt;Ollama, llama.cpp, vLLM&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Installation&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;npm install -g openclaw&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;brew install&lt;!-- raw HTML omitted --&gt; or &lt;!-- raw HTML omitted --&gt;pip install&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Resource requirements&lt;/td&gt;
          &lt;td&gt;8GB RAM minimum&lt;/td&gt;
          &lt;td&gt;8GB RAM minimum&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Real-time voice&lt;/td&gt;
          &lt;td&gt;Supported (macOS/iOS wake word + Android continuous voice)&lt;/td&gt;
          &lt;td&gt;Supported&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Visual Canvas&lt;/td&gt;
          &lt;td&gt;Live Canvas (agent-driven visual workspace)&lt;/td&gt;
          &lt;td&gt;None&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;File transfer&lt;/td&gt;
          &lt;td&gt;File transfer plugin (16MB per-round cap, symlink traversal denied by default)&lt;/td&gt;
          &lt;td&gt;Built-in file tools&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;installation-and-getting-started&#34;&gt;Installation and Getting Started
&lt;/h2&gt;&lt;p&gt;OpenClaw&amp;rsquo;s installation experience is closer to a consumer app. After running &lt;code&gt;openclaw onboard --install-daemon&lt;/code&gt;, the interactive wizard automatically creates a workspace, generates persona files, configures API keys, and guides messaging platform integration. Going from cold start to a working agent usually takes 3 to 5 minutes.&lt;/p&gt;
&lt;p&gt;Hermes Agent&amp;rsquo;s installation requires some technical background. Although &lt;code&gt;hermes init&lt;/code&gt; provides interactive configuration, users still need to understand concepts like Docker networking and service topology. For DevOps engineers who routinely deploy containerized systems, this transparency and controllability is an advantage; for users who have never configured a &lt;code&gt;.env&lt;/code&gt; file, it can be a barrier.&lt;/p&gt;
&lt;h2 id=&#34;recommendations&#34;&gt;Recommendations
&lt;/h2&gt;&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Use case&lt;/th&gt;
          &lt;th&gt;Recommended choice&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Fastest deployment, largest integration list, broadest community&lt;/td&gt;
          &lt;td&gt;OpenClaw&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Want the agent to grow more efficient with usage&lt;/td&gt;
          &lt;td&gt;Hermes Agent&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Migrating from OpenClaw (especially after security incidents)&lt;/td&gt;
          &lt;td&gt;Hermes Agent (built-in &lt;!-- raw HTML omitted --&gt;hermes claw migrate&lt;!-- raw HTML omitted --&gt;)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Fully offline with local models&lt;/td&gt;
          &lt;td&gt;Either&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Non-technical background, wants out-of-the-box&lt;/td&gt;
          &lt;td&gt;OpenClaw&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Enterprise deployment needing security isolation and scalability&lt;/td&gt;
          &lt;td&gt;Hermes Agent&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Researchers needing RL training and trajectory data&lt;/td&gt;
          &lt;td&gt;Hermes Agent&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Prompt engineers who prefer hand-writing SKILL.md&lt;/td&gt;
          &lt;td&gt;OpenClaw&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Need real-time voice wake word and visual Canvas&lt;/td&gt;
          &lt;td&gt;OpenClaw&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;sources&#34;&gt;Sources
&lt;/h2&gt;&lt;p&gt;The information in this article comes from the following public channels:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/openclaw/openclaw&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;OpenClaw official GitHub repository&lt;/a&gt; — openclaw/openclaw, 368k stars, 1,976 contributors, 41,105 commits, MIT license&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/openclaw/openclaw/releases&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;OpenClaw official Releases page&lt;/a&gt; — latest version 2026.5.3 (May 4, 2026)&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://docs.openclaw.ai/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;OpenClaw official docs&lt;/a&gt; — docs.openclaw.ai&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/nousresearch/hermes-agent&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Hermes Agent official GitHub repository&lt;/a&gt; — NousResearch/hermes-agent, 132k+ stars, 822 contributors, 7,150 commits, MIT license&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://hermes-agent.nousresearch.com/docs/developer-guide/architecture/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Hermes Agent official architecture docs&lt;/a&gt; — Nous Research, 2026&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://lushbinary.com/blog/hermes-vs-openclaw-key-differences-comparison/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Lushbinary: Hermes vs OpenClaw key differences&lt;/a&gt; — April 7, 2026&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://lushbinary.com/blog/hermes-agent-developer-guide-setup-skills-self-improving-ai/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Lushbinary: Hermes Agent developer guide&lt;/a&gt; — April 7, 2026&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://www.deployagents.co/blog/openclaw-vs-hermes-agent-comparison&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;DeployAgents: OpenClaw vs Hermes deep comparison&lt;/a&gt; — April 9, 2026&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://amirteymoori.com/hermes-agent-vs-openclaw-ai-assistant-comparison/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Amir Teymoori: Hermes Agent vs OpenClaw comparison&lt;/a&gt; — 2026&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://nvd.nist.gov/vuln/detail/CVE-2026-25253&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;NVD: CVE-2026-25253&lt;/a&gt; — U.S. National Vulnerability Database&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;limitations-and-disclaimer&#34;&gt;Limitations and Disclaimer
&lt;/h2&gt;&lt;p&gt;This article is compiled from public information available as of May 2026. Some performance figures (such as Hermes&amp;rsquo;s 40% efficiency improvement) come from public statements by the project team and have not been verified by independent third-party benchmarks.&lt;/p&gt;
&lt;p&gt;Both OpenClaw and Hermes Agent are in a period of rapid iteration, and some features may have changed by the time you read this. We recommend consulting each project&amp;rsquo;s official docs and latest release notes before making a final decision.&lt;/p&gt;
&lt;p&gt;Neither offers an enterprise-grade zero-trust sandbox. For regulated industries such as finance and healthcare, we recommend additional security assessment and compliance review before adoption.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This article is compiled from publicly available community discussions and official documentation and does not constitute professional procurement or security advice.&lt;/em&gt;&lt;/p&gt;
</description>
        </item>
        <item>
        <title>Pi Coding Agent: A Terminal AI Coding Agent Built on 418 Lines of Code</title>
        <link>https://torchtree.com/en/post/pi-coding-agent/</link>
        <pubDate>Wed, 29 Apr 2026 02:07:14 +0800</pubDate>
        
        <guid>https://torchtree.com/en/post/pi-coding-agent/</guid>
        <description>&lt;p&gt;Pi (full name &lt;code&gt;pi-coding-agent&lt;/code&gt;) is an open-source terminal AI coding agent (a CLI coding harness). It has accumulated more than 17,500 stars on GitHub, with peak npm weekly downloads of 1.3 million. It was developed by Mario Zechner (author of the well-known game framework libGDX, GitHub @badlogic), and recently ranked first on OpenRouter&amp;rsquo;s trending list.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://getnas.s3.bitiful.net/2026/05/ScreenShot_2026-05-06_110333_054.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
	
&gt;&lt;/p&gt;
&lt;h2 id=&#34;core-philosophy-minimalism-and-extensibility&#34;&gt;Core philosophy: minimalism and extensibility
&lt;/h2&gt;&lt;p&gt;Pi was born out of Zechner&amp;rsquo;s dissatisfaction with existing coding agents. As he wrote on his blog: &amp;ldquo;Claude Code has turned into a spaceship — I don&amp;rsquo;t use 80% of its features. The system prompt and tools change with every release, breaking my workflow.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Pi&amp;rsquo;s philosophy can be summed up as: &lt;strong&gt;&amp;ldquo;If I don&amp;rsquo;t need it, I don&amp;rsquo;t build it.&amp;rdquo;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Compared with similar tools, Pi chooses extreme minimalism on multiple dimensions:&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Dimension&lt;/th&gt;
          &lt;th&gt;Mainstream tools like Claude Code&lt;/th&gt;
          &lt;th&gt;Pi&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Core agent loop&lt;/td&gt;
          &lt;td&gt;Thousands of lines of code&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;418 lines of TypeScript&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;System prompt + tool definitions&lt;/td&gt;
          &lt;td&gt;Thousands of tokens&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;&amp;lt; 1,000 tokens&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Default tools&lt;/td&gt;
          &lt;td&gt;A dozen or more&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;4&lt;!-- raw HTML omitted --&gt; (read, write, edit, bash)&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Built-in features&lt;/td&gt;
          &lt;td&gt;Big and comprehensive&lt;/td&gt;
          &lt;td&gt;Minimal, filled out with extensions&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Zechner&amp;rsquo;s core assumption: &lt;strong&gt;all frontier models have been heavily trained with RL, so they already understand what a coding agent is.&lt;/strong&gt; Therefore the harness doesn&amp;rsquo;t need to over-instruct the model — the lighter the better.&lt;/p&gt;
&lt;h2 id=&#34;four-layer-architecture&#34;&gt;Four-layer architecture
&lt;/h2&gt;&lt;p&gt;Pi uses a strictly bottom-up layered design, with each layer having zero dependency on the layers above it:&lt;/p&gt;
&lt;h3 id=&#34;pi-ai-cross-provider-context-migration&#34;&gt;pi-ai: cross-provider context migration
&lt;/h3&gt;&lt;p&gt;pi-ai is the low-level unified LLM API, supporting 15+ providers and 300+ models. It normalizes four protocols — OpenAI Completions, OpenAI Responses, Anthropic Messages, and Google Generative AI — into a unified event-stream format.&lt;/p&gt;
&lt;p&gt;Its killer feature is &lt;strong&gt;cross-provider context migration&lt;/strong&gt;: in a single session you can think with Claude first, then switch to GPT-4o to verify, with the context carried over seamlessly. Claude&amp;rsquo;s thinking traces are automatically converted into `` tags for OpenAI models to read.&lt;/p&gt;
&lt;h3 id=&#34;pi-agent-core-the-418-line-dual-loop&#34;&gt;pi-agent-core: the 418-line dual loop
&lt;/h3&gt;&lt;p&gt;This is Pi&amp;rsquo;s core, using a two-layer separation of AgentMessage (application layer) and LLM Message (model layer):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No maximum step limit&lt;/strong&gt;: the loop keeps running until the agent itself declares completion&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Runtime hot-swapping&lt;/strong&gt;: &lt;code&gt;setModel()&lt;/code&gt;, &lt;code&gt;setTools()&lt;/code&gt;, &lt;code&gt;setSystemPrompt()&lt;/code&gt; take effect at any time&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Steering mechanism&lt;/strong&gt;: users can send &amp;ldquo;steering messages&amp;rdquo; while the agent is executing tools; the agent responds as soon as it finishes the current tool, skipping the remaining queued tool calls&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Three-tier event system&lt;/strong&gt;: full streaming event subscription at the agent / turn / message / tool level&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;pi-coding-agent-the-terminal-application-layer&#34;&gt;pi-coding-agent: the terminal application layer
&lt;/h3&gt;&lt;p&gt;Provides four operating modes:&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Mode&lt;/th&gt;
          &lt;th&gt;Use case&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Interactive&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Full TUI interaction experience&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Print&lt;!-- raw HTML omitted --&gt; (&lt;!-- raw HTML omitted --&gt;-p&lt;!-- raw HTML omitted --&gt;)&lt;/td&gt;
          &lt;td&gt;Generate a shell script and print it&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;JSON&lt;!-- raw HTML omitted --&gt; (&lt;!-- raw HTML omitted --&gt;&amp;ndash;mode json&lt;!-- raw HTML omitted --&gt;)&lt;/td&gt;
          &lt;td&gt;Structured event stream, good for pipelining&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;RPC&lt;!-- raw HTML omitted --&gt; (&lt;!-- raw HTML omitted --&gt;&amp;ndash;mode rpc&lt;!-- raw HTML omitted --&gt;)&lt;/td&gt;
          &lt;td&gt;JSON protocol over stdin/stdout, embeddable in other applications&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;SDK&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Embed directly into Node.js applications&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;extensibility-pis-real-killer-feature&#34;&gt;Extensibility: Pi&amp;rsquo;s real killer feature
&lt;/h2&gt;&lt;p&gt;Pi turns &amp;ldquo;features built into other tools&amp;rdquo; into &amp;ldquo;extensions you build or install yourself&amp;rdquo; — this is its most fundamental difference from tools like Claude Code.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Extensions&lt;/strong&gt;: TypeScript modules with access to tools, commands, shortcuts, events, and the full TUI&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Skills&lt;/strong&gt;: on-demand capability packages (instructions + tools)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prompt Templates&lt;/strong&gt;: reusable Markdown prompts expanded quickly with &lt;code&gt;/name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pi Packages&lt;/strong&gt;: extension packages distributed via npm or git&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The official repo offers 50+ extension examples, including subagents, plan mode, permission gating, path protection, SSH execution, sandboxing, and MCP integration.&lt;/p&gt;
&lt;h2 id=&#34;context-engineering-mechanisms&#34;&gt;Context-engineering mechanisms
&lt;/h2&gt;&lt;p&gt;Pi provides multiple mechanisms for precise context control:&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Mechanism&lt;/th&gt;
          &lt;th&gt;Use case&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;AGENTS.md&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Project-level instructions, placed in &lt;!-- raw HTML omitted --&gt;~/.pi/agent/&lt;!-- raw HTML omitted --&gt; or the project directory&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;SYSTEM.md&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Replace or append to the default system prompt&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Compaction&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Automatically summarizes near the context limit; customizable&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Dynamic Context&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Inject messages, filter history, RAG, and long-term memory via extensions&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;community-positioning-and-the-harness-effect&#34;&gt;Community positioning and the Harness Effect
&lt;/h2&gt;&lt;p&gt;According to a six-harness comparison released by Pawel Jozefiak in April 2026, Pi&amp;rsquo;s positioning is that of a &lt;strong&gt;moldable, minimal harness&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The review proposed an important &amp;ldquo;Harness Effect&amp;rdquo;: the same model can differ by 5–40 percentage points across different harnesses. For example, Claude Opus scores 77% in Claude Code but reaches 93% in Cursor. Pi&amp;rsquo;s value is that it provides a &lt;strong&gt;highly tunable, fully transparent&lt;/strong&gt; foundation, letting users optimize this effect for themselves.&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Tool&lt;/th&gt;
          &lt;th&gt;Positioning&lt;/th&gt;
          &lt;th&gt;Characteristics&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Claude Code&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Agent Orchestrator&lt;/td&gt;
          &lt;td&gt;Strongest contextual coherence; suited to complex multi-file tasks and unattended overnight runs&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Codex CLI&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Coding Tool&lt;/td&gt;
          &lt;td&gt;Executes cleanly but lacks contextual coherence&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Aider&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Coding Tool&lt;/td&gt;
          &lt;td&gt;High editing precision, but doesn&amp;rsquo;t aim to be an autonomous agent&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;OpenCode&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Middle ground&lt;/td&gt;
          &lt;td&gt;Built by the SST team; feature-complete&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Pi&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;&lt;!-- raw HTML omitted --&gt;Moldable minimal harness&lt;!-- raw HTML omitted --&gt;&lt;/td&gt;
          &lt;td&gt;Lightweight, transparent, deeply customizable&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;what-can-you-use-it-for&#34;&gt;What can you use it for
&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Everyday coding agent&lt;/strong&gt;: a replacement for Claude Code / Codex CLI, handling code generation, refactoring, and debugging in the terminal&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom workflows&lt;/strong&gt;: build your own &amp;ldquo;plan mode&amp;rdquo;, &amp;ldquo;permission gating&amp;rdquo;, and &amp;ldquo;subagent orchestration&amp;rdquo; via extensions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Embedding in other applications&lt;/strong&gt;: use Pi as an engine inside your own tools via the SDK or RPC mode (OpenClaw takes this approach)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-model collaboration&lt;/strong&gt;: switch between different models within a single task, leveraging each one&amp;rsquo;s strengths&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Overnight autonomous runs&lt;/strong&gt;: combine the steering and follow-up mechanisms for long-running autonomous tasks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Team standardization&lt;/strong&gt;: share coding conventions and workflows across a team through AGENTS.md, Skills, and Pi Packages&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;quick-start&#34;&gt;Quick start
&lt;/h2&gt;&lt;p&gt;Pi&amp;rsquo;s install and launch flow is extremely simple.&lt;/p&gt;
&lt;h3 id=&#34;installation&#34;&gt;Installation
&lt;/h3&gt;&lt;p&gt;Launch it after entering your project directory:&lt;/p&gt;
&lt;h3 id=&#34;adding-a-model-authentication&#34;&gt;Adding a model (authentication)
&lt;/h3&gt;&lt;p&gt;Pi supports two authentication methods:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Method 1: subscription login&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Run this inside Pi&amp;rsquo;s interactive interface:&lt;/p&gt;
&lt;p&gt;Then choose a provider. Built-in support includes Claude Pro/Max, ChatGPT Plus/Pro (Codex), GitHub Copilot, and Google Gemini CLI.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Method 2: API key&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Set the environment variable before launching:&lt;/p&gt;
&lt;p&gt;You can also choose an API-key provider via &lt;code&gt;/login&lt;/code&gt;, storing the key in &lt;code&gt;~/.pi/agent/auth.json&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;task-conversations&#34;&gt;Task conversations
&lt;/h3&gt;&lt;p&gt;After launching, just type what you need:&lt;/p&gt;
&lt;p&gt;Four tools are provided by default: &lt;code&gt;read&lt;/code&gt; (read files), &lt;code&gt;write&lt;/code&gt; (write files), &lt;code&gt;edit&lt;/code&gt; (edit files), and &lt;code&gt;bash&lt;/code&gt; (run commands). Read-only tools like &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;find&lt;/code&gt;, and &lt;code&gt;ls&lt;/code&gt; can be enabled via options.&lt;/p&gt;
&lt;p&gt;Common operations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reference a file&lt;/strong&gt;: type &lt;code&gt;@&lt;/code&gt; for fuzzy search, or specify directly on the command line: &lt;code&gt;pi @README.md &amp;quot;Summarize this&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run a command&lt;/strong&gt;: &lt;code&gt;!npm run lint&lt;/code&gt; (send output into the model&amp;rsquo;s context), &lt;code&gt;!!command&lt;/code&gt; (run without sending into context)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Switch models&lt;/strong&gt;: &lt;code&gt;/model&lt;/code&gt; or &lt;code&gt;Ctrl+L&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Continue sessions&lt;/strong&gt;: &lt;code&gt;pi -c&lt;/code&gt; (most recent session), &lt;code&gt;pi -r&lt;/code&gt; (browse history), &lt;code&gt;/resume&lt;/code&gt;, &lt;code&gt;/new&lt;/code&gt;, &lt;code&gt;/tree&lt;/code&gt; (session management)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Non-interactive mode&lt;/strong&gt;: &lt;code&gt;pi -p &amp;quot;Summarize this codebase&amp;quot;&lt;/code&gt; (single-shot output)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;project-instructions&#34;&gt;Project instructions
&lt;/h3&gt;&lt;p&gt;Create an &lt;code&gt;AGENTS.md&lt;/code&gt; in the project root, which Pi loads automatically at startup:&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;/reload&lt;/code&gt; after modifying it for changes to take effect.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;Pi is not &amp;ldquo;yet another Claude Code replacement.&amp;rdquo; It is a &lt;strong&gt;radical minimalist experiment&lt;/strong&gt;, proving that a well-designed lightweight harness can match or even surpass complex frameworks.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s best suited to developers dissatisfied with the &amp;ldquo;black-box behavior&amp;rdquo; of existing agents, and to advanced users who want &lt;strong&gt;full control&lt;/strong&gt; over the system prompt, tools, and context flow. If all you want is an &amp;ldquo;out-of-the-box, feature-complete&amp;rdquo; experience, Claude Code may remain the first choice; but if you want to &lt;strong&gt;understand and control every line of behavior in your agent&lt;/strong&gt;, Pi is one of the most transparent options available today.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://pi.dev/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Pi official website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Pi GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://pi.dev/docs/latest&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Pi official documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://mariozechner.at/posts/2025-11-30-pi-coding-agent/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Mario Zechner: What I learned building an opinionated and minimal coding agent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://yrzhe.top/project/deep-dive-pi-agent-the-418-line-agent-loop-that-outperforms-thousand-line-frameworks&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;yrzhe: Deep Dive: Pi Agent, The 418-Line Agent Loop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://thoughts.jock.pl/p/ai-coding-harness-agents-2026&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Pawel Jozefiak: Claude Code vs Codex vs Aider vs OpenCode vs Pi 2026&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        <item>
        <title>Processing Scanned PDFs: From Local OCR to Vision Language Models</title>
        <link>https://torchtree.com/en/post/pdf-ocr-vision-model-workflow/</link>
        <pubDate>Sat, 11 Apr 2026 12:54:28 +0800</pubDate>
        
        <guid>https://torchtree.com/en/post/pdf-ocr-vision-model-workflow/</guid>
        <description>&lt;p&gt;A common pitfall when handling scanned PDFs is to run a full pass with traditional OCR tools first, then spend a lot of time cleaning up the erroneous results. This article draws on a large scanned-PDF extraction task executed by Hermes Agent and abstracts a more general processing logic: how to complete the recognition and structured organization of scanned PDFs efficiently and with high quality at minimal sunk cost.&lt;/p&gt;
&lt;h2 id=&#34;1-first-decide-is-it-an-image-book-or-a-document&#34;&gt;1. First, Decide: Is It an &amp;ldquo;Image Book&amp;rdquo; or a &amp;ldquo;Document&amp;rdquo;?
&lt;/h2&gt;&lt;p&gt;The first step after getting a PDF is not to extract directly, but to detect its type. Many scanned PDFs look like a &lt;code&gt;.pdf&lt;/code&gt; on the surface yet contain no extractable text layer inside.&lt;/p&gt;
&lt;p&gt;This step usually only takes a few seconds, but it can prevent hours of wasted subsequent effort.&lt;/p&gt;
&lt;h2 id=&#34;2-the-role-of-local-ocr-should-be-minimized&#34;&gt;2. The Role of Local OCR Should Be Minimized
&lt;/h2&gt;&lt;p&gt;Once you confirm it is an image-based PDF, many people&amp;rsquo;s second reaction is to fire up a traditional OCR tool such as Tesseract and run full recognition and cleanup. In real tasks, however, the marginal benefit of this approach is often low:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Local OCR handles printed English reasonably well, but it is error-prone on Chinese definitions in mixed Chinese-English layouts;&lt;/li&gt;
&lt;li&gt;Cleanup scripts can only deal with layout noise (headers, footers, table lines), not semantic-level recognition errors;&lt;/li&gt;
&lt;li&gt;When the end goal is structured, directly usable, high-quality text, investment in cleanup code can easily become a sunk cost.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;3-the-decisive-step-bringing-in-a-vision-language-model-for-direct-recognition&#34;&gt;3. The Decisive Step: Bringing in a Vision Language Model for Direct Recognition
&lt;/h2&gt;&lt;p&gt;In this task, once Hermes Agent confirmed that the local OCR output for Chinese was unacceptable, it &lt;strong&gt;wrote its own Python script and directly called an external Vision-Language model&lt;/strong&gt; (&lt;code&gt;Qwen/Qwen2-VL-72B-Instruct&lt;/code&gt;) to re-recognize the content. This was the turning point that ultimately determined output quality.&lt;/p&gt;
&lt;h3 id=&#34;31-lessons-from-model-selection&#34;&gt;3.1 Lessons from Model Selection
&lt;/h3&gt;&lt;p&gt;The initial test used a dedicated model named OCR, but that model had weak instruction-following capabilities—it repeatedly output the review tables and marking symbols from the page and could not extract only the target content as required. This shows that:&lt;/p&gt;
&lt;h3 id=&#34;32-secure-practices-for-api-calls&#34;&gt;3.2 Secure Practices for API Calls
&lt;/h3&gt;&lt;p&gt;The external API key was not hardcoded into the script; it was injected via environment variables configured in &lt;code&gt;~/.hermes/.env&lt;/code&gt; (such as &lt;code&gt;SILICONFLOW_API_KEY&lt;/code&gt;), read by the script through &lt;code&gt;os.environ&lt;/code&gt;. This practice meets security requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The key is not exposed in any code file or log;&lt;/li&gt;
&lt;li&gt;Credentials are stored in a controlled config location in the user&amp;rsquo;s home directory;&lt;/li&gt;
&lt;li&gt;It is only valid for the lifespan of the current session.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For an AI agent, retrieving environment variables through &lt;code&gt;~/.hermes/.env&lt;/code&gt; is the standard and secure way to call external services.&lt;/p&gt;
&lt;h2 id=&#34;4-page-stitching-strategy-merge-consecutive-pages-and-recognize-them-together&#34;&gt;4. Page Stitching Strategy: Merge Consecutive Pages and Recognize Them Together
&lt;/h2&gt;&lt;p&gt;Scanned books, textbooks, and exam papers often contain content that flows continuously across pages. If each page is uploaded separately to the model, it can lead to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fragmented context, causing the model to misjudge the relationship between content on two pages;&lt;/li&gt;
&lt;li&gt;Cross-page items being truncated or missed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The strategy used in this task was:&lt;/p&gt;
&lt;p&gt;Specific steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;pdf2image&lt;/code&gt; to convert consecutive pages into images;&lt;/li&gt;
&lt;li&gt;Use PIL to stitch multiple images vertically into one long image;&lt;/li&gt;
&lt;li&gt;Compress as JPEG, encode as base64, and upload via the API.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The advantage of this approach is that it preserves the continuity and spatial relationships of reading, reduces context switching during API calls, and also saves the overhead of multiple requests.&lt;/p&gt;
&lt;h2 id=&#34;5-prompt-design-hard-constraints-for-structured-output&#34;&gt;5. Prompt Design: Hard Constraints for Structured Output
&lt;/h2&gt;&lt;p&gt;To get the Vision model to output clean text that can be written directly to a file, the prompt needs to include the following hard constraints:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Explicit exclusions&lt;/strong&gt;: List all non-target content on the page (tables, circle markings, page numbers, usage instructions, etc.), and require the model to actively ignore them;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format template&lt;/strong&gt;: Specify the output format for each entry, for example &lt;code&gt;number. English word phonetic part-of-speech Chinese definition&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fixed header&lt;/strong&gt;: Force the output to begin with a unified heading structure to make downstream automation easier;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reference text aid&lt;/strong&gt;: Append the initial local OCR results to the end of the prompt, letting the model do &amp;ldquo;comparative correction&amp;rdquo; based on the image rather than guessing blind from scratch. This significantly improves output accuracy and completeness.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;6-core-methodology-verify-first-then-run-in-full&#34;&gt;6. Core Methodology: Verify First, Then Run in Full
&lt;/h2&gt;&lt;p&gt;Whatever toolchain you use, the most important step when handling scanned PDFs is:&lt;/p&gt;
&lt;h3 id=&#34;61-what-to-verify-with-minimal-effort&#34;&gt;6.1 What to Verify with Minimal Effort
&lt;/h3&gt;&lt;p&gt;Before launching a full batch process, the agent should first verify the following elements at minimal cost:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Page-number mapping pattern&lt;/strong&gt;: How many days/chapters? How many pages per chapter? Where are the boundaries?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Model recognition ability&lt;/strong&gt;: At the current DPI, can the model accurately recognize fonts, phonetic symbols, and mixed Chinese-English content?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prompt stability&lt;/strong&gt;: Is the output format consistent across 1–3 consecutive samples? Is any content missing?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost estimate&lt;/strong&gt;: Is the token consumption per page/chapter within budget? Can the DPI be downgraded?&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;62-dynamic-resolution-scaling&#34;&gt;6.2 Dynamic Resolution Scaling
&lt;/h3&gt;&lt;p&gt;Image token cost is roughly proportional to resolution. You can first test the Vision model at a low DPI (such as 100 DPI); if the recognition rate is already sufficient, there is no need to use 150 DPI or 250 DPI. For printed materials with large fonts, 100 DPI is often enough, reducing image encoding cost by about 50% or more.&lt;/p&gt;
&lt;h3 id=&#34;63-possibility-of-structured-output&#34;&gt;6.3 Possibility of Structured Output
&lt;/h3&gt;&lt;p&gt;If the API supports JSON mode, you can ask the model directly to return a structured array (such as &lt;code&gt;{&amp;quot;word&amp;quot;, &amp;quot;phonetic&amp;quot;, &amp;quot;pos&amp;quot;, &amp;quot;definition&amp;quot;}&lt;/code&gt;), entirely eliminating post-processing cleanup code and improving automation and maintainability.&lt;/p&gt;
&lt;h2 id=&#34;7-delivery-structure-keep-raw-data-and-refined-results-separate&#34;&gt;7. Delivery Structure: Keep Raw Data and Refined Results Separate
&lt;/h2&gt;&lt;p&gt;For tasks that may produce multiple versions of results, a dual-directory isolation design is recommended:&lt;/p&gt;
&lt;p&gt;The benefits of this design:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Raw data is not lost;&lt;/li&gt;
&lt;li&gt;The refined result of any unit can be diffed against the original output;&lt;/li&gt;
&lt;li&gt;Rollback is always possible because nothing is overwritten.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;8-pre-flight-checklist-for-ai-agents&#34;&gt;8. Pre-Flight Checklist for AI Agents
&lt;/h2&gt;&lt;p&gt;If you are an AI agent and receive a task to &amp;ldquo;extract structured content from a scanned PDF&amp;rdquo;, follow this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;PDF type detection&lt;/strong&gt;: sample with &lt;code&gt;pdfinfo&lt;/code&gt; + &lt;code&gt;pdftotext&lt;/code&gt; to confirm whether it is an image-based PDF;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Structure-pattern detection&lt;/strong&gt;: use the lowest-cost method (low-resolution OCR or a small number of Vision API calls) to confirm the &amp;ldquo;page → chapter/unit&amp;rdquo; mapping pattern;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Solution validation&lt;/strong&gt;: process the first 1–3 units with the Vision model to verify output format, completeness, and accuracy;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;API key security&lt;/strong&gt;: read it from &lt;code&gt;~/.hermes/.env&lt;/code&gt; environment variables, never hardcode it;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Full concurrent execution&lt;/strong&gt;: run the batch only after confirming everything works, saving results to a separate directory without overwriting the raw data.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;9-conclusion&#34;&gt;9. Conclusion
&lt;/h2&gt;&lt;p&gt;For content extraction from scanned PDFs, &lt;strong&gt;the order in which you choose your toolchain matters more than the capability of any single tool&lt;/strong&gt;. Traditional OCR is well-suited as a low-cost structural-probe sentinel, but if the goal is directly usable, high-quality structured text, a Vision-Language model is the ultimate guarantee of quality.&lt;/p&gt;
&lt;p&gt;The most expensive mistake is usually not picking the wrong model, but &lt;strong&gt;launching a full batch process without minimal verification first&lt;/strong&gt;. Agents should establish a rhythm of &amp;ldquo;validate a sample → adjust parameters → run the full batch&amp;rdquo; early on, to control sunk costs and ensure the reliability of the final deliverable.&lt;/p&gt;
</description>
        </item>
        <item>
        <title>API Keys Don&#39;t Belong in Your Shell Config Files</title>
        <link>https://torchtree.com/en/post/api-key-storage-best-practices/</link>
        <pubDate>Tue, 07 Apr 2026 03:11:16 +0800</pubDate>
        
        <guid>https://torchtree.com/en/post/api-key-storage-best-practices/</guid>
        <description>&lt;p&gt;API keys should not live in your shell config files. It&amp;rsquo;s a habit many developers have, chosen for convenience, but the risk has been underestimated for a long time.&lt;/p&gt;
&lt;p&gt;A recent operational mistake brought this home for me: a command couldn&amp;rsquo;t find its target file, so the fallback ran &lt;code&gt;env&lt;/code&gt;, dumping the entire terminal environment variables out. A dozen API keys went straight into an AI conversation&amp;rsquo;s context, and I had to rotate all of them.&lt;/p&gt;
&lt;p&gt;The incident was small, but it revealed a structural problem: keeping keys in shell config files means they are always exposed to every child process and every tool&amp;rsquo;s view.&lt;/p&gt;
&lt;h2 id=&#34;why-shell-config-files-arent-a-good-place-for-api-keys&#34;&gt;Why shell config files aren&amp;rsquo;t a good place for API keys
&lt;/h2&gt;&lt;p&gt;Different shells have different config files, but they all face the same problem:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;zsh&lt;/strong&gt;: &lt;code&gt;~/.zshrc&lt;/code&gt;, &lt;code&gt;~/.zprofile&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;bash&lt;/strong&gt;: &lt;code&gt;~/.bashrc&lt;/code&gt;, &lt;code&gt;~/.bash_profile&lt;/code&gt;, &lt;code&gt;~/.profile&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;fish&lt;/strong&gt;: &lt;code&gt;~/.config/fish/config.fish&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Writing &lt;code&gt;export API_KEY=xxx&lt;/code&gt; in these files has these consequences:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every terminal session loads them automatically at startup, so any child process can read them&lt;/li&gt;
&lt;li&gt;Commands like &lt;code&gt;env&lt;/code&gt; and &lt;code&gt;printenv&lt;/code&gt; can reveal the plaintext at any time&lt;/li&gt;
&lt;li&gt;AI tools, log collectors, and debug output may accidentally capture them&lt;/li&gt;
&lt;li&gt;If the config file gets synced to a dotfiles repo, they become public directly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The root problem is: &lt;strong&gt;the key&amp;rsquo;s lifetime is far longer than the time it&amp;rsquo;s actually used.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&#34;better-approaches&#34;&gt;Better approaches
&lt;/h2&gt;&lt;h3 id=&#34;option-one-project-level-env--precise-injection&#34;&gt;Option one: project-level &lt;code&gt;.env&lt;/code&gt; + precise injection
&lt;/h3&gt;&lt;p&gt;The lightest improvement. Each project only holds the keys it uses, extracted precisely via a script without polluting the global environment.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;run.sh&lt;/code&gt; example:&lt;/p&gt;
&lt;p&gt;Pros: simple, no dependencies, works on every operating system.&lt;/p&gt;
&lt;p&gt;Cons: the key still sits on disk in plaintext.&lt;/p&gt;
&lt;h3 id=&#34;option-two-macos-keychain&#34;&gt;Option two: macOS Keychain
&lt;/h3&gt;&lt;p&gt;System-level encrypted storage. The key is stored encrypted in the Keychain and only decrypted into memory at the moment it&amp;rsquo;s read; &lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, and &lt;code&gt;env&lt;/code&gt; can&amp;rsquo;t see it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Storing:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reading in a script:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Experience:&lt;/strong&gt; When you log into your Mac, the system Keychain unlocks automatically, so scripts can read values directly for the whole session without asking for a password. The first time you access an item, the system shows a single authorization dialog; click &amp;ldquo;Always Allow&amp;rdquo; and it never appears again.&lt;/p&gt;
&lt;p&gt;This is the most direct replacement for storing keys in shell config files, and it has almost no impact on your workflow. It&amp;rsquo;s macOS-only; Linux and Windows have their own equivalents (&lt;code&gt;secret-tool&lt;/code&gt;, Windows Credential Manager).&lt;/p&gt;
&lt;h3 id=&#34;option-three-bitwarden-cli-self-hosted&#34;&gt;Option three: Bitwarden CLI (self-hosted)
&lt;/h3&gt;&lt;p&gt;If you have a Bitwarden instance (including a self-hosted Vaultwarden), you can use the official CLI, &lt;code&gt;bw&lt;/code&gt;, to pull keys dynamically within scripts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configuring the self-hosted address:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Logging in and getting a session:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The session stays valid within the current terminal session and expires when you close the terminal, so it isn&amp;rsquo;t persistently exposed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reading a specific entry in a script:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bw get password&lt;/code&gt; looks up an entry by name and returns its password field. You can also use &lt;code&gt;bw get notes&lt;/code&gt; to fetch the notes field, which is handy for keys with complex stored formats.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Best fit:&lt;/strong&gt; scenarios where multiple devices share the same set of keys, or where you need cross-platform support (macOS/Linux/Windows are all supported). Keys are centralized in Bitwarden, so switching devices only requires logging in again rather than manually migrating &lt;code&gt;.env&lt;/code&gt; files.&lt;/p&gt;
&lt;h2 id=&#34;migration-suggestions&#34;&gt;Migration suggestions
&lt;/h2&gt;&lt;p&gt;If your shell config files currently hold lots of &lt;code&gt;export KEY=xxx&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Organize by project; give each project its own &lt;code&gt;.env&lt;/code&gt; with only the keys that project uses&lt;/li&gt;
&lt;li&gt;Migrate high-value credentials (database passwords, payment-related) to Keychain or Bitwarden&lt;/li&gt;
&lt;li&gt;Remove all the &lt;code&gt;export KEY=&lt;/code&gt; lines from your shell config files&lt;/li&gt;
&lt;li&gt;Make sure &lt;code&gt;.env&lt;/code&gt; files are added to &lt;code&gt;.gitignore&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You don&amp;rsquo;t have to do everything at once. Migrate the most sensitive ones first, and move the rest as you touch each project.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;table&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Approach&lt;/th&gt;
          &lt;th&gt;Plaintext on disk&lt;/th&gt;
          &lt;th&gt;Cross-platform&lt;/th&gt;
          &lt;th&gt;Cross-device&lt;/th&gt;
          &lt;th&gt;Dependency&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Shell config files&lt;/td&gt;
          &lt;td&gt;✓ (dangerous)&lt;/td&gt;
          &lt;td&gt;✓&lt;/td&gt;
          &lt;td&gt;Manual sync needed&lt;/td&gt;
          &lt;td&gt;None&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Project &lt;code&gt;.env&lt;/code&gt;&lt;/td&gt;
          &lt;td&gt;✓&lt;/td&gt;
          &lt;td&gt;✓&lt;/td&gt;
          &lt;td&gt;Manual sync needed&lt;/td&gt;
          &lt;td&gt;None&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;macOS Keychain&lt;/td&gt;
          &lt;td&gt;✗&lt;/td&gt;
          &lt;td&gt;✗&lt;/td&gt;
          &lt;td&gt;✗&lt;/td&gt;
          &lt;td&gt;Built into the system&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Bitwarden CLI&lt;/td&gt;
          &lt;td&gt;✗&lt;/td&gt;
          &lt;td&gt;✓&lt;/td&gt;
          &lt;td&gt;✓&lt;/td&gt;
          &lt;td&gt;bw CLI&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;There&amp;rsquo;s no perfect solution, but any of these is better than shell config files. The most pragmatic starting point is: &lt;strong&gt;clear the keys from your config files and switch to project-level &lt;code&gt;.env&lt;/code&gt;, then gradually move high-value credentials to Keychain or Bitwarden.&lt;/strong&gt;&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
