DeepSeek-Reasonix:围绕前缀缓存稳定性设计的终端编程 Agent

DeepSeek-Reasonix: A Terminal Coding Agent Designed Around Prefix Cache Stability

Tech-News #编程Agent#DeepSeek#前缀缓存#终端工具#长任务Agent#成本优化#Mycelium
更新于
🇨🇳 中文

by Mycelium Protocol


大多数 AI 编程 Agent 把 DeepSeek 只当一个可切换的 LLM 后端。DeepSeek-Reasonix 从另一个方向出发:完全围绕 DeepSeek 的前缀缓存机制设计整个 Agent 循环

GitHub: https://github.com/esengine/DeepSeek-Reasonix | ⭐ 33,026 | MIT License | Go


前缀缓存稳定性:架构的核心不变量

DeepSeek 的前缀缓存(prefix cache)在相同前缀下大幅降低 token 成本。但普通 Agent 循环会在每次迭代中插入新内容、重排上下文,破坏前缀稳定性,实际缓存命中率很低。

Reasonix 把前缀缓存稳定性作为架构不变量而非可选功能:循环的每一层都经过精心设计以保持前缀字节稳定。这是它为什么只支持 DeepSeek——整个 Agent 架构对 DeepSeek 的字节稳定前缀缓存机制做了深度适配。

真实数据(2026-05-01,单用户单日):

指标数值
输入 token 总量435M
缓存命中率99.82%
实际花费~$12
无缓存等价费用~$61
节省~$49(约 80%)

安装与基本使用

需要 Node.js ≥ 22,支持 macOS / Linux / Windows。

# 全局安装(日常使用推荐)
npm install -g reasonix
reasonix code my-project   # 首次运行粘贴 DeepSeek API key,自动持久化

# 无需安装,一次性运行
cd my-project
npx reasonix code

# 更短的别名(等价于 reasonix)
npm install -g dsnix
npx dsnix@latest code

获取 DeepSeek API key:https://platform.deepseek.com/api_keys


主要命令

命令用途
reasonix / reasonix code [dir]编程 Agent,首选入口
reasonix chat纯对话模式,无文件系统/Shell 工具
reasonix run "task"单次执行,流式输出到 stdout,适合管道
reasonix doctor健康检查:Node、API key、MCP 接线
reasonix update自我更新

其他子命令(replay / diff / events / stats / index / mcp / prune-sessions)见 reasonix --help


QQ 频道远程接入

在正在运行的 chatcode 会话中:

/qq connect

连接后,QQ 消息可以进入当前会话,Assistant 回复路由回 QQ,支持从手机远程跟进长任务。这不是一个独立的运行时模式——它是当前会话流的 QQ 扩展频道。


Tauri 桌面客户端

提供原生 Tauri 桌面客户端(预发布):多标签,右侧面板显示 Agent 本次会话读写的文件,底部实时 cost/cache/token 指标。同一个 DeepSeek API key 和 ~/.reasonix 配置,桌面版内置 Node 运行时,无需单独 npm install

  • macOS:首次启动被 Gatekeeper 拦截 → xattr -dr com.apple.quarantine /Applications/Reasonix.app
  • Windows:SmartScreen 警告 → 点”更多信息 → 仍要运行”
  • Linux:.deb 和 .AppImage,无额外步骤

Go 重写(main-v2)

当前主开发线已迁移到 Go 重写版(main-v2 分支,现为默认分支)。原 TypeScript 版(0.x)处于维护模式,只接受 bug fix,不再添加新功能。Go 版本在性能、启动时间和资源占用上有显著改善,同时保持相同的协议和配置格式(~/.reasonix)。


Mycelium Protocol — 追踪 AI 系统的底层演化


关于 Mycelium

菌丝协议。持续追踪 AI 工具、系统和实验的内容节点。


🇬🇧 English

DeepSeek-Reasonix: A Terminal Coding Agent Built Around Prefix-Cache Stability

by Mycelium Protocol


Most AI coding agents treat DeepSeek as just another swappable LLM backend. DeepSeek-Reasonix takes the opposite direction: the entire agent loop is designed around DeepSeek’s prefix-cache mechanic.

GitHub: https://github.com/esengine/DeepSeek-Reasonix | ⭐ 33,026 | MIT License | Go


Prefix-Cache Stability: The Core Invariant

DeepSeek’s prefix cache dramatically reduces token costs when the prefix is stable. But typical agent loops insert new content and reorder context on every iteration, destroying prefix stability and producing low cache hit rates in practice.

Reasonix treats prefix-cache stability as an architectural invariant, not a feature you turn on: every layer of the loop is engineered to maintain byte-stable prefixes. This is why it’s DeepSeek-only — the entire architecture is tuned to DeepSeek’s byte-stable prefix-cache mechanic.

Real user, single day (2026-05-01):

MetricValue
Input tokens435M
Cache hit rate99.82%
Actual cost~$12
Same workload without cache~$61
Savings~$49 (~80%)

Install and Basic Usage

Requires Node.js ≥ 22. Works on macOS · Linux · Windows.

# Global install (recommended for daily use)
npm install -g reasonix
reasonix code my-project   # paste your DeepSeek API key on first run; it persists

# One-shot without installing
cd my-project
npx reasonix code

# Shorter alias (identical)
npm install -g dsnix
npx dsnix@latest code

Get a DeepSeek API key at https://platform.deepseek.com/api_keys


Commands

CommandWhen to use
reasonix / reasonix code [dir]Coding agent. Start here.
reasonix chatPlain chat — no filesystem or shell tools
reasonix run "task"One-shot, streams to stdout. Good for pipes.
reasonix doctorHealth check: Node, API key, MCP wiring
reasonix updateUpgrade Reasonix itself

QQ Channel Remote Access

From inside a running chat or code session:

/qq connect

Once connected, QQ messages enter the current session, assistant replies route back to QQ, and you can follow up on long-running tasks from your phone. This is a remote channel extension of the current session — not a separate runtime.


Tauri Desktop Client (Prerelease)

A native Tauri desktop app: multi-tab, right panel shows files the agent has read or edited this session, cost/cache/token meters at the bottom. Same API key and ~/.reasonix config as the CLI — desktop bundles its own Node runtime, no separate npm install.

  • macOS: Gatekeeper blocks first launch → xattr -dr com.apple.quarantine /Applications/Reasonix.app
  • Windows: SmartScreen warns → More info → Run anyway
  • Linux: .deb and .AppImage, no extra steps

Go Rewrite (main-v2)

Active development has moved to the Go rewrite on the main-v2 branch (now the default). The original TypeScript line (0.x) is in maintenance mode — bug fixes only, no new features. The Go version brings meaningful improvements to startup time and resource usage while maintaining the same protocol and config format (~/.reasonix).


Mycelium Protocol — tracking the deep evolution of AI systems

© 2026 Mycelium Protocol. All rights reserved.

💬 评论与讨论

使用 GitHub 账号登录后发表评论

关于本站 · 免责声明

🍄 Mushroom Research Blog 是非营利、免费公开的个人科技观察博客与公众号 XStack18,不接受商业合作、不代表任何企业或机构立场,也不谋求商业利益。我们以个人视角客观中立地记录和分析 AI、Web3 等领域的最新模型发布与技术动态——不止转述新闻标题或二手信息,而是给出有独立思考的深入分析,希望帮更多人获得有价值的一手科技认知。

⚠️ 文中介绍的开源代码与模型,仅供学习交流与技术借鉴。它们大多仍处于早期阶段,有待进一步研究和验证,请勿直接用于工作或生产环境;如需采用,请先自行充分测试,并核实其许可证与安全性。
Open-source code and models featured here are shared for learning and reference only. Most are early-stage and still need further study and verification — please don't use them directly in your work or in production. Test them thoroughly and check their licenses and security first.

  1. 本站文章均为作者基于公开信息的个人研究与观点整理,不代表文中提及的任何公司、产品、模型的官方立场,未与其构成商业关联或合作关系。
  2. 科技行业信息更新极快,我们尽力保证内容准确、及时,但不对完整性、实时性做绝对保证,具体请以相关企业/项目官方公告为准。
  3. 文中引用的第三方商标、产品名称、图片、数据等版权归原权利人所有,我们会尽量注明来源;如你认为存在版权疑问或侵权,请通过下方邮箱联系我们,收到通知后会尽快核实处理(更正、加注来源或删除)。
  4. 文章内容仅为技术科普与个人观点,不构成投资、法律或其他专业建议,据此进行任何决策的后果需自行判断和承担。

📮 侵权 / 勘误 / 合作咨询:[email protected]