接入你的智能体
发布者自己的命令。不是 PlugMCP 端点。
用我们的密钥与日志托管一份副本。
npx -y [email protected]Claude Code 没有针对本地命令的安装链接。复制下方命令并在终端中运行。
claude mcp add dsh-open-dream-rsi -- npx -y dsh-open-dream-rsi@0.4.8在终端中运行。
{ "mcpServers": { "dsh-open-dream-rsi": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
远程 URL 还是本机命令? 两种安装方式的区别
Every AI agent pays the same tax over and over: it fails a task, works out what went wrong, and then throws that understanding away when the session ends. Open Dream-RSI keeps what was learned — without touching the model.
The LLM stays frozen. What improves is everything around it:
Between runs the system "dreams": it replays thousands of strategies over the recorded history in-process, at zero API cost, and keeps only what beats the incumbent. An open implementation of Recursive Self-Improvement through Evolving Worlds (Dream-RSI, Zheng et al., arXiv:2609.14858).
Zero runtime dependencies — Python 3.10+ stdlib only, ~11.2k lines of library code, ~5.4k lines of tests, no build step.
Not another memory plugin. Experience-memory systems record what the agent learned and reuse it as-is. ODR is an evolving worlds loop: every attempt is recorded into a Discovery Tree, and between runs the system dreams — replaying thousands of strategy variants against that recorded world. Nothing is promoted on the model's word alone: a candidate policy, recipe or lesson replaces the incumbent only after surviving counterfactual replay.
How it compares — stored state, how entries earn trust, runtime cost, against Mem0, Letta, Reflexion-style reflection, DSPy optimizers and skill libraries: docs/comparison.md.
📄 Preprint: Open Dream-RSI: An Open-Source Library for Recursive Self-Improvement Around a Frozen LLM, with Replay-Gated Learned Policies and a Curated Knowledge Base — P. Orwat, 2026. PDF · LaTeX source
The odr console script ships with the package (0.3.9+); from a bare
checkout use python3 -m open_dream_rsi or pip install -e ..
Point the dreamer at any OpenAI-compatible endpoint — or nowhere: the model
is auto-detected from /v1/models, so a local vLLM/Ollama needs only the
base URL.
export OPENAI_BASE_URL=http://127.0.0.1:8000/v1 # vLLM / Ollama / any gateway
export OPENAI_API_KEY=*** # any token for local servers
No agent handy? The bare CLI runs the same loop: odr --memory .dream_rsi loop --tasks tasks.json --once (drop --once for a daemon). No key?
python examples/live_loop_demo.py runs the whole cycle on an in-process
mock server. (dreamrsi on PyPI is an unrelated project — this library is
open-dream-rsi.) Per-host details, MCP blocks, troubleshooting:
docs/integrations.md. The key-free walkthrough
and the Docker image: docs/try-it.md.
┌───────────────┐
│ Frozen LLM │
└──────┬────────┘
│ proposals
online loop ▼ offline dream
┌──────────── DiscoveryTree ──────────── ReplaySimulator ──────────┐
│ │ │ │
│ node.sentinel counterfactual │
│ (Sentinel facts, rollout scoring │
│ replay-safe) │ │
│ │ ▼ │
│ └────→ Policy improvement ────→ next cycle │
│ │
SENTINEL MODE (tool-execution layer) │
│ │ │ │
error-class nudge permute-gate ──→ block tool calls │
ledger (once/session) past 80% of budget ───────────┘
Beyond parameter-level dreaming, the loop closes section 3 of the paper
("dreaming with code"): each cycle the LLM may rewrite the exploration
policy itself as a small Python program, choose_action(frontier, step).
Candidates are statically validated (AST gate), executed only in a hardened
subprocess sandbox, and scored by counterfactual replay rollout on the
recorded tree. A candidate replaces the incumbent only on evidence — and
the incumbent is re-scored on the current tree, not trusted at its stored
score. A crashing or cheating policy can never break the loop: expansion
falls back to the greedy baseline.
The loop speaks MCP (Model Context Protocol). One config block and your everyday agent can queue tasks for the dreamer, pull back verified recipes and consult curated lessons — zero extra LLM setup: the dreamer resolves its own brain (env → local goose config → localhost vLLM), and asks the endpoint itself which model to use.
Tools are registered prefixed per client (e.g. Hermes
mcp_open_dream_rsi_odr_run_once). No model calls tools on its own
initiative — trigger them via a recipe's instructions:, a hook, or an
explicit ask ("check odr_recipes before you try again"). The AGENTS.md
prompting block that makes the loop proactive lives in
docs/integrations.md.
Per-host setup — OpenCode, Goose (auto-setup script), Hermes (incl. Docker), Codex CLI, Claude Code, Cowork/claude.ai connectors, DeepSeek Harness — plus the zero-configuration brain chain and troubleshooting: docs/integrations.md.
Precedence is always: explicit overrides → environment → endpoint model
discovery (first id from GET /v1/models) → preset defaults; a pinned
model the endpoint no longer serves self-heals by re-discovering once.
Cursor has no public OpenAI-compatible chat endpoint — the cursor preset
targets a local proxy over the Cursor login, and since 0.3.0 the default
zero-proxy brain is the cursor-agent CLI. Full prose and CLI install:
docs/integrations.md.
Library-level use (no CLI):
from open_dream_rsi import (DiscoveryTree, DreamEngine, ReplaySimulator,
DreamAgent, LLMConfig, OpenAICompatibleClient)
client = OpenAICompatibleClient(LLMConfig.from_preset("local"))
tree = DiscoveryTree()
dreamer = DreamEngine(simulator=ReplaySimulator(tree))
dreamer.run_offline_optimization(iterations=100)
agent = DreamAgent(dreamer=dreamer, client=client)
--memory dir)Switches worth knowing: --no-policy-code, --no-knowledge, --no-thoughts,
--no-judge ablate the four optional machinery layers; --evolution-stop
(opt-in) freezes policy regeneration after an anytime-valid betting-martingale
alarm — no promotion evidence left in a category stops the spending, the last
promoted policy stays active; --budget N caps API calls per cycle (dreaming
stays free).
The seam is dream_once() (CLI odr dream, MCP odr_dream, or a host
hook). You do not set a schedule — the module decides the tier per call,
so firing it after every task is safe and costs nothing extra when there is
nothing new to learn:
A busy day dreams a few times, a quiet day once, an idle day never;
concurrent calls collapse on a single-instance lock. Probes are queued
automatically: every failure-shaped session appends its own request to
tasks.json as a probe:<session> task (max_attempts=1, appended after
manual tasks), so the promotion gate never depends on hand-written task
files — the evidence you already produced is the counterparty.
An idle fleet is never fully idle (wake self-test). By default
(ODR_WAKE=1, or --wake) a FULL dream that finds tasks.json empty
seeds one self-test probe — "write add(a, b)", verified by tests, one
API call — so the configured endpoint is exercised even with no real
work queued. odr metrics then shows live api_calls and a solve rate
(category wake) instead of a zero-call heartbeat; opt out with
ODR_WAKE=0 or --no-wake.
For a mass install the whole thing is two commands, no host glue:
pip install open-dream-rsi # library + CLI + MCP server
hermes plugins install "https://github.com/patrykorwat/open-dream-rsi#odr-trigger"
hermes plugins enable odr-trigger # restart to load the hook
# optional overrides:
hermes config set plugins.entries.odr-trigger.settings.provider local
hermes config set plugins.entries.odr-trigger.settings.base_url http://.../v1
A timer-based fleet is one runner called by one service. The shipped runner loops a glob of per-workspace memory dirs and fires one dream cycle per dir:
scripts/odr_fleet_dream.sh # env-configured; see the header for ODR_* knobs
A systemd oneshot unit + timer (or the per-host service you already run) calls it; the dream module itself decides maintenance vs full per workspace:
# /etc/systemd/system/odr-dream.service (Type=oneshot)
[Service]
Type=oneshot
Environment=ODR_PKG=/opt/odr/share/open-dream-rsi
Environment=ODR_WS_GLOB=/opt/odr/workspaces/*/odr-mem
Environment=ODR_SOURCE=cursor
Environment=ODR_PROVIDER=cursor-agent
ExecStart=/opt/odr/share/open-dream-rsi/scripts/odr_fleet_dream.sh
# odr-dream.timer — fires the unit on your cadence (here: every 2 h)
[Timer]
OnCalendar=*-*-* 0/2:17:00
[Install]
WantedBy=timers.target
What separates a learning fleet from a heartbeat-only one is carried by the runner's environment — three ingredients:
Since 0.3.11 the wake self-test closes the visibility gap: every FULL dream
with an empty queue exercises the configured endpoint once, so a correct
fleet reads wake: n/n and ~1 API call per workspace per ~6 h in
odr metrics. A fleet stuck at api_calls: 0 across sweeps is a timer
running bare dream calls — fix the table above, then diagnose one workspace
with odr --memory <dir> metrics (the llm errors classes name the missing
env). ODR_INGEST=0 keeps the heartbeat-only behavior explicitly.
Evaluation policy: performance claims live on exactly one benchmark —
goose × TravelPlanner, public and scored by the benchmark's own
evaluators; the scripted suites (bench, bench-policy) are deterministic
machinery self-checks and carry no model-quality claim.
On the preregistered eval split (79 tasks, one model): plan delivery 18/79 (23%) cold → 74/79 (94%) with the call-cutoff gate (McNemar 56↔0, p=1.4e-17). Every undelivered cold episode died pinned at the call cap with the data already in hand — the binding failure is termination; the gate arm is fixed choice-removal, no learned content in those episodes.

The learned machinery is validated on the scripted suites; live replay also showed fresh lessons are hazardous by default (imperative mood, not content: 18/20 → 6/20, declarative restatement back to 18/20) — which is why the KB is staging-by-default behind a paired-replay gate. Full tables, Wilson intervals, protocol, self-check contracts and the memory findings: docs/benchmarks.md.
The repository keeps four planes strictly apart:
The ALM manages the four artifact types (policy_parameters,
policy_program, recipe, lesson) through an explicit state machine
(CANDIDATE → VALIDATED → ACTIVE → STALE/SUPERSEDED/QUARANTINED → ARCHIVED,
terminal REJECTED), with hard rules: activation is only an explicit
promotion call carrying the evidence; every state change appends exactly
one immutable event before exposing the new state; the materialized
view must always equal rebuild_artifact_state(events) (a hand-edited view
is rebuilt from the log, never trusted); merges create NEW artifacts with
lineage and never mutate sources; deletion never prunes the event log.
Discovery Trees and audit events are evidence, not artifacts — the ALM
refuses to register them. Inspect the store:
odr artifacts [--type lesson --state ACTIVE --history].
The loop distils lessons from its own failures; it can also import the transcripts you already paid for. Hermes, Cursor and Claude Code are first-class evidence sources, and user corrections are a second evidence class. Everything imported is untrusted: read-only, secret-redacted, staged behind the same promotion gate — activation is earned.
Export-then-distil, corrections classification, backfill of burned sessions, git-backed lesson stores, holdout hygiene and the full Hermes wiring: docs/sessions.md.
Candidate code — both task solutions and policy programs — runs in a
hardened subprocess (open_dream_rsi/sandbox.py): python -I, scrubbed
environment (only PATH — API keys never cross the wall), a timeout that
kills the entire process group, and POSIX address-space / CPU /
thread-count limits. Policy code additionally passes an AST gate before
any spawn: required entry point, no imports, no dunder access, no
__builtins__ reference (name plus constructed-key indexing is itself an
escape route).
This is defence in depth, not a container. The subprocess does not
restrict filesystem or network access, and an AST gate cannot be provably
complete against code that is not statically gated. For hostile task
sources set ODR_SANDBOX_CMD to a
bubblewrap/nsjail wrapper
(e.g. bwrap --unshare-all --die-with-parent --ro-bind / /) or run the
loop inside a container.
On non-POSIX hosts (Windows) the same python -I child runs, but there are
no rlimits and the timeout kills only the direct child — treat Windows as
out of scope for hostile task sources. When ODR_SANDBOX_CMD is unset,
each fresh process logs a one-time warning naming exactly this gap.
One command, no dependencies, stdlib http server:
python -m open_dream_rsi dashboard # mock LLM, port 8765
python -m open_dream_rsi dashboard --provider cursor # real model
python -m open_dream_rsi dashboard --host 0.0.0.0 # LAN access
Dark single-page UI: KPIs (cycles / solved / API budget / dream iterations), live event feed, per-task attempt boards with score bars and code diff-downs, dreamed-policy gauges per category and the learned recipe library.
The dashboard is a plain unauthenticated stdlib HTTP server whose control
routes (/api/pause, /api/reset) mutate the running loop — keep --host
on loopback unless the LAN is trusted.
python -m unittest discover -s tests # full suite, ~2 min
python scripts/fast_tests.py # fast subset (slow bench/sandbox modules excluded), ~15 s
Stdlib-only: benchmark
behavioural contracts
(greedy must solve nothing; the gated arm must dominate ε; the rollout must
be prefix-only), sandbox escape regressions, sandbox result-cache identity
contracts, holdout reservation semantics (first-claim-wins, cross-purpose
refusal), gate semantics, MCP protocol,
goose config dialects, sentinel channel semantics (nudge fires once per
budget, merges with recurrence notes, clean calls count toward the budget;
the permute-gate serves until ceil(0.8·budget) then refuses forever, per
session; the 30-day production replay must reproduce its recorded note count
exactly), model discovery and stale-pin self-heal contracts, and the
structured seam (cross-session counts never reach to_world_dict(); the
frontier-feature attribution pattern — beats greedy with metadata, ties
without; the vendored Hermes engine pinned byte-for-byte to upstream by
test_vendored_engine_matches_upstream).
MIT — see LICENSE.
Let your coding agent dream: strategies must survive counterfactual replay before they earn trust. An offline self-improvement loop over an evolving world model — no fine-tuning, the LLM stays frozen.
{ "mcpServers": { "dsh-open-dream-rsi": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}概览
Let your coding agent dream: strategies must survive counterfactual replay before they earn trust. An offline self-improvement loop over an evolving world model — no fine-tuning, the LLM stays frozen. Speaks MCP. Ships its Python server inside the package
工具
暂无工具列表。远程服务器在首次健康检查后会获得工具列表。
常见问题
在本页复制适用于 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 配置。它使用发布者的安装方式,而不是 PlugMCP 代理。
此记录未列出必需的环境变量。
Dsh Open Dream Rsi 通过 stdio 在本地运行。
上次检查时间:2026-11-17。 Let your coding agent dream: strategies must survive counterfactual replay before they earn trust. An offline self-improvement loop over an evolving world model — no fine-tuning, the LLM stays frozen. Speaks MCP. Ships its Python server inside the package