RLM 模式:每个会话一个常驻 Python 内核,全部工具以 tools.* 绑定在内核内调用,支持子代理、harness 与快照。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:fgm-builds/dashr
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本。请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
⚡ Quick Install
curl -fsSL https://raw.githubusercontent.com/fgm-builds/dashr/main/install.sh | bash
Alternative: dsh Plugin CLI (npm)
dsh plugin --profile web add --config.auto-install-peers=false dsh-rlm-mode
# then copy the preset files (install.sh does this for you):
# <profile>/node_modules/dsh-rlm-mode/preset/rlm-mode/* → ~/.dsh/.agent-presets/rlm-mode/
After installation, launch
dsh weband select the RLM Mode agent preset.
📖 Overview
DeepSeek Harness (dsh): Everything is a plugin (万物皆插件, Cordis framework).
Prime Agent: RLM paradigm (递归自调用), Context as variables (上下文即变量).
Why not both? That's dsh in RLM mode — that's Dashr.
Dashr is an open-source plugin for the DeepSeek Harness (dsh) agent runtime. It brings RLM(Recursive Language Models:递归自调用) and the Context as Variables(上下文即变量) paradigm to dsh, registering a dedicated rlm-mode agent preset upon installation.
Instead of paying massive token costs on every round-trip tool call in standard multi-turn chat, Dashr equips the agent with a stateful, persistent Python kernel(持久化内核). The agent writes self-contained Python programs per cell, manipulating context, tools, and memory as native variables via the Python Kernel Unified Tool Calling(统一的代码化工具调用).
💡 RLM(Recursive Language Models:递归自调用)
Reference: Recursive Language Models (MIT/Stanford/Open MIND, 2025, arXiv:2512.24601)
- Context Scaling Up to 100x: 250K context LLMs effectively process 10M+ token inputs beyond physical context windows while avoiding context rot(上下文腐化/退化).
- Recursive Sub-Agent Task Decomposition (not from the reference): Recursive sub-agent/sub-task delegation aligns with granular locality and task complexity in open-world settings; delegation and receipt naturally form a doer-verifier pair.
- Resilience on Information-Dense Benchmarks: Excels on complex multi-hop reasoning tasks (e.g. OOLONG-Pairs), standard frontier LLMs fail catastrophically.
- Token & Cost Efficiency:
Outperforms standard long-context ingestion and summarization baselines by up to 2× performance.
Architecture
1. Context as Variables(上下文即变量,Stateful Kernel)
In standard agent loops, reading large files or computing complex payloads dumps raw output directly into the conversation history. In Dashr:
- State and computation persist inside a live IPython kernel session.
- Intermediate variables survive across cells without re-entering the prompt.
- Python Kernel Unified Tool Calling(统一的代码化工具调用): Tools are exposed as first-class Python functions (
tools.<name>()). Intermediate execution data never round-trips through the prompt.
2. Recursive Sub-Agents(rlm())
The core mechanism of RLM:
- For token-heavy or exploratory subtasks, the agent spawns child agents (
handle = rlm("Investigate repository history")). - Sub-agents operate recursively in their own isolated context loops.
- When finished,
rlm_await(handle)collects only the final distilled summary back into the parent kernel.
3. Global Context Recency Window(全局上下文时效窗口)
- Even without spawning sub-agents, Dashr maintains a bounded Global Context Recency Window over recent turns via sliding-window compression.
- Prevents context degradation(上下文退化) and eliminates context window saturation on long workflows.
4. Compaction & Summarization(上下文压缩与提炼)
- Earlier turns that fall outside the active sliding window are automatically compressed into structured summaries (
compact()). - High-level progress, key decisions, and operating guidance are preserved in a dynamic harness (
refine()) and reinjected into the prompt.
📊 RLM Mode (Dashr) vs. Code Mode (dsh built-in)
While both RLM Mode (Dashr) and dsh's built-in Code Mode provide a code-first interface for programmatic tool orchestration, they differ fundamentally in language ecosystem, kernel persistence, and recursive capabilities:
| Dimension | RLM Mode (Dashr Plugin) | Code Mode (dsh Built-in) |
Highlight & Advantage |
|---|---|---|---|
| Interface Standardization | Host Toolset Registry Schema | Host Toolset Registry Schema | 🤝 Both dynamically expose typed SDK bindings (tools.*) generated from the same host registry. |
| Trigger & Orchestration | Programmatic Code Execution | Programmatic Code Execution | 🤝 Both collapse multiple sequential tool calls into a single code execution step. |
| Execution Language | Python (IPython 3.10+) | TypeScript / JavaScript | 🐍 Full access to Python's data science, AST analysis, and AI tooling ecosystem (pandas, numpy, etc.). |
| Backend & Kernel Layer | Persistent IPython Kernel (ZeroMQ + Jupyter Protocol) | Ephemeral Node.js Sandbox / One-shot runner | ⚡ Dashr maintains a dedicated, persistent kernel per session. Variables, imports, and objects survive across turns. |
| Functional Recursive Delegation | Native rlm() Function Call, Arbitrary Recursion Depth) |
Framework-level Sub-Agent Tool Call | 🔀 Standardized as a zero-friction Python function (rlm()). Sub-agents can recursively spawn Level 2+ sub-agents with arbitrary depth, returning results directly into Python variables. |
| State Snapshot & Revival | Full Namespace Snapshot (dill) |
Stateless between restarts | 💾 Kernel state can be serialized and restored across session restarts. |
✨ Features
- 💬 A2A Agent Messaging(智能体间直接通信) — Direct agent-to-agent messaging channels across family trees and siblings with result/message separation.
- 🔀 In-Kernel Recursive Sub-Agents — Call
rlm(task)to spawn parallel sub-agents andrlm_await(id)to collect results inside Python code. - 🪟 Global Context Recency Window(全局上下文近期窗口) — Sliding window compression that preserves recent turns while compacting older history.
- 🧠 Dynamic Harness & Compaction — Built-in
refine()for operating memory andcompact()for context reduction under pressure. - 💾 State Snapshot & Revival(状态快照与环境复原) — Save and restore the kernel namespace across sessions.
🔒 Security Model
- Tool Governance: Calls to
tools.*run throughdsh's host tool pipeline, where approval and sandbox policies apply normally. - Kernel Code Execution: Python code inside cells executes with the permissions of the local user running
dsh. Run Dashr in environments where you trust the agent's code execution against your user account (or rundshwithin a container).
📚 References & Academic Credit
The design of Dashr builds upon groundbreaking research in recursive agent execution and persistent prompt harnesses:
Recursive Language Models (RLM)
Recursive Language Models, 2025.
Paper: arXiv:2512.24601
Establishes the recursive decomposition and sub-agent execution paradigm for ultra-long context and bounded prompt management.Continual Harness & Prompt Refinement
Continual Harness for Autonomous Agents, 2026.
Paper: arXiv:2605.09998
Formulation for dynamic prompt refinement and in-loop compaction.
🙏 Acknowledgements & Attribution
Dashr is built as an open-source plugin for DeepSeek Harness (dsh).
While Dashr's codebase was developed independently from scratch for the dsh plugin ecosystem, the core design and philosophy are deeply inspired by the pioneering work of Prime Agent by Prime Intellect. We pay tribute to their introduction of the Context as Variables(上下文即变量) paradigm and the Recursive Language Model(RLM:递归自调用) execution model, which inspired us to bring these breakthrough capabilities to the dsh agent community.
⚖️ License & Compatibility
Both Dashr and upstream inspiration Prime Agent are licensed under the permissive MIT License. Dashr is fully open-source and license-compliant without IP or licensing conflicts.
📄 License
This project is licensed under the MIT License.
链接
同类插件
strukto-ai/mirage#dsh★ 3502
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
hust-open-atom-club/oh-dsh★ 245
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
lire1131/dsh-undo-plugin★ 72
DSH 撤销/回退系统:配置变更自动存档,一键撤销/恢复/回退到任意版本,支持 WebUI 与离线 CLI/GUI 工具(DSH 启动失败也能救)。
Jayden-X-L/forkprobe★ 67
同一任务并行试跑多个技能,对比结果选出最优。
forrestchang/dsh-multica-runtime★ 46
让 dsh 运行时跑在 Multica 上。
omdsh-dev/dsh-plugin-check★ 24
插件健康检查:扫描清单协议/patch 格式/构建陷阱,零依赖只读。