dashr (dashr)
dsh 的 RLM 模式:通过统一的 rlm() 函数实现递归子代理——以一等 Python 函数调用生成、等待、链式传递子代理。附带常驻 IPython 内核、tools.* 绑定与上下文即变量。
fgm-builds
@fgm-builds
⬇ 1
★ 0
main
安装
dsh plugin --profile web add github:fgm-builds/dashr
需要可复现安装时,可在仓库后追加 #commit 固定提交。
dsh 的 RLM 模式:通过统一的 rlm() 函数实现递归子代理——以一等 Python 函数调用生成、等待、链式传递子代理。附带常驻 IPython 内核、tools.* 绑定与上下文即变量。
该插件未提供要点说明,请参考仓库 README。
agent-harnessdshdsh-bundledsh-plugindsh-plugin-marketdsh-plugins
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/fgm-builds/dashr/tree/main/dashr |
| 许可证 | MIT |
| 主要语言 | main |
| 下载量 | 1 |
| GitHub 星标 | 0 |
| 最近推送 | 2026-08-21 |
| 收录日期 | 2026-09-19 |
| 分类 | 开发与运行时 |
事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# Dashr: RLM Plugin for `dsh`
[图片: dsh plugin]
[图片: npm package]
[图片: arXiv:2512.24601]
[图片: Repository]
[图片: License]
---
## ⚡ Quick Install
```bash
curl -fsSL https://raw.githubusercontent.com/pgmi-builds/dashr/main/install.sh | bash
```
### Alternative: `dsh` Plugin CLI (`npm`)
```bash
# pnpm's registry cache can lag a fresh publish — drop it first, then:
rm -rf ~/.cache/pnpm
dsh plugin --profile web add --config.auto-install-peers=false dsh-rlm-mode
# then LOCALIZE the preset files (a plain copy is not enough — the include
# path and kernel Python must be baked in; install.sh does this for you):
# sed the two placeholders in /node_modules/dsh-rlm-mode/preset/rlm-mode/agent.cordis.yml
# into ~/.dsh/.agent-presets/rlm-mode/ (see install.sh step 5/5)
```
> After installation, launch `dsh web` and select the **RLM Mode** agent preset.
---
## 📖 Overview
[DeepSeek Harness (`dsh`)](https://github.com/deepseek-ai/deepseek-harness): Everything is a plugin (万物皆插件, Cordis framework).
[Prime Agent](https://github.com/primeintellect-ai/prime): RLM paradigm (递归自调用), Context as variables (上下文即变量).
**Why not both?** That's `dsh` in RLM mode — that's **Dashr**.
[图片: Dashr (RLM mode) running in DeepSeek Harness Web UI]
**Dashr** is an open-source plugin for the [DeepSeek Harness (`dsh`)](https://github.com/deepseek-ai/deepseek-harness) 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](https://arxiv.org/abs/2512.24601))
1. **Context Scaling Up to 100x**:
250K context LLMs effectively process **10M+ token** inputs beyond physical context windows while avoiding context rot(上下文腐化/退化).
2. **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.
3. **Resilience on Information-Dense Benchmarks**:
Excels on complex multi-hop reasoning tasks (e.g. *OOLONG-Pairs*), standard frontier LLMs fail catastrophically.
4. **Token & Cost Efficiency**:
Outperforms standard long-context ingestion and summarization baselines by up to **2× performance**.
### Architecture
The runtime stack is one three-layer model (v0.1.5 layering):
- **Profile layer (process-wide)** — `DashrDaemon`: the profile-level daemon concept, an empty shell in v0.1.5 (named in the bundle patch, which stays `[]` — no code yet).
- **Standing-mount layer** — `DashrRuntime`: one instance per standing mount holding the cross-session kernel map. This is the **de facto daemon** today — it listens for session disposal, keys one kernel per session, snapshots namespaces, and dispatches host tool calls back from cells.
- **Session layer** — the ipykernel subprocess: a pure Python interpreter with no harness awareness; only the TS-side runtime knows about sessions and tools.
#### 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 flat top-level Python callables (`await name({...})` inside a cell). 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 (`child = await rlm({"mode": "spawn", "prompt": "Investigate repository history"})`).
- Sub-agents operate recursively in their own isolated context loops.
- When finished, the parent collects only the final distilled summary back into its kernel (the child's `agent_message({"receiver": "parent", ...})` uplink).
#### 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 generated from the same host registry — flat `await name({...})` in Dashr vs `tools.name({...})` in Code Mode. |
| **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({"mode": "spawn", "prompt": task})` to spawn sub-agents and collect results inside Python code — background by default, or block with `{"run_in_background": false}`.
- 🪟 **Global Context Recency Window(全局上下文近期窗口)** — Sliding window compression that preserves recent turns while compacting older history.
- 🧠 **Dynamic Harness & Compaction** — Built-in `refine()` for operating memory and `compact()` for context reduction under pressure.
- 💾 **State Snapshot & Revival(状态快照与环境复原)** — Save and restore the kernel namespace across sessions.
---
## 🔒 Security Model
- **Tool Governance**: Calls to `tools.*` run through `dsh`'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 run `dsh` within a container).
---
## 📚 References & Academic Credit
The design of Dashr builds upon groundbreaking research in recursive agent execution and persistent prompt harnesses:
1. **Recursive Language Models (RLM)**
*Recursive Language Models*, 2025.
Paper: [arXiv:2512.24601](https://arxiv.org/abs/2512.24601)
*Establishes the recursive decomposition and sub-agent execution paradigm for ultra-long context and bounded prompt management.*
2. **Continual Harness & Prompt Refinement**
*Continual Harness for Autonomous Agents*, 2026.
Paper: [arXiv:2605.09998](https://arxiv.org/abs/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`)](https://github.com/deepseek-ai/deepseek-harness).
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](https://github.com/primeintellect-ai/prime)** 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](https://opensource.org/licenses/MIT)**. Dashr is fully open-source and license-compliant without IP or licensing conflicts.
---
## 📄 License
This project is licensed under the [MIT License](./LICENSE).
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。