RTR-RE:Symbiose (rtr-role-type-retrieval) — dense usage manual
RTR-RE:Symbiose (Role-Type-Retrieval-RE:Symbiotized) 1.1.0: RRF-heuristic, DTD-semantic-capable persistent memory + symbiotized context engine for coding agents. Dual ONNX ensemble on CPU, zero API cost, local only. Three offices: native Keeper plugin (window), background Compressor (verbatim until trigger, drain to target), RTR Manager (retrieval of what left the window).
Engine vs car: RTR (the rtr-role-type-retrieval repo) is the retriever
alone. RTR-RE is the full system: RTR retrieval + Keeper + Compressor + Manager
- engine-beneath + installer + live-tuning palette. The preset registry is shared; the keeper presets are RTR-RE's section.
The .mjs edition (mjs/ in the repo) provides the same memory
discipline with no MCP server: an OpenCode plugin + Claude Code /
Codex hooks over one zero-dependency core, retrieval through rtr-cli,
and AUTO-OPTIMIZE, an optimize pass instigated between every file
read and the next code write. The 0.4.x releases also fix two measured
defects: engine close/reopen returning a dead Chroma client, and
wikilink expansion crashing search on chromadb 1.5 ($contains in get);
dependencies are now bounded to tested majors.
RTR-RE ships as its own standalone git repository: no lab sync tooling is included, and the shipped tree is the git history itself. By Nova-Violet Role — non-profit. AGPL-3.0-or-later OR EUPL-1.2. Support: ko-fi.com/saimonokuma.
1. Run it (pick one — no clone, no venv, no sync in any of them)
# A. Zero-install, every session (recommended): uvx caches + isolates automatically
uvx --from rtr-role-type-retrieval rtr-mcp # MCP server over stdio
uvx --from rtr-role-type-retrieval rtr-cli stats # CLI
uvx --from rtr-role-type-retrieval rtr-re-install-opencode # native Keeper plugin + config snippet
# B. Persistent tool install
uv tool install rtr-role-type-retrieval
rtr-mcp
rtr-cli index
# C. Classic pip (you manage the venv)
pip install rtr-role-type-retrieval
rtr-mcp
First run downloads embedding models once (~650 MB: Arctic-m 768 + bge-base 768)
into FASTEMBED_CACHE_PATH — pin it to persistent storage (default is the
system temp dir and can be wiped). Models then load warm every session.
2. Wire it into your agent CLI (model-agnostic: works with any LLM, local or API)
The server is plain MCP-over-stdio. It never calls an LLM itself — embeddings are local ONNX — so it works with Claude, GPT, GLM, Kimi, Ollama-driven harnesses, anything with an MCP client.
// opencode.jsonc — global config, automatic every session
"mcp": {
"memory": {
"type": "local",
"command": ["uvx", "--from", "rtr-role-type-retrieval", "rtr-mcp"],
"enabled": true,
"timeout": 180000, // cold model load on very first start
"environment": {
"OPENCODE_MEMORY_RTR_PROFILE": "performance", // balanced 4+4 | performance 8+8
"OPENCODE_MEMORY_PROJECTS_DIR": "C:/Users/you/projects", // ;-separated multi-root
"FASTEMBED_CACHE_PATH": "C:/Users/you/.config/opencode/memory/.fastembed_cache"
}
}
}
// Claude Code / any MCP-stdIO client: same command, same env
{ "mcpServers": { "rtr-memory": {
"command": "uvx",
"args": ["--from", "rtr-role-type-retrieval", "rtr-mcp"],
"env": { "OPENCODE_MEMORY_RTR_PROFILE": "balanced" }
} } }
# Local-LLM harnesses without MCP: use the CLI as tools
rtr-cli session-start /path/to/project # restore goals/blockers/prefetch
rtr-cli search "buffer API quirks" --project myproj --k 5
rtr-cli session-commit /path/to/project --chat "...session log..."
3. Project bootstrap (works anywhere — absolute paths auto-register)
rtr-cli init /any/where/myproj # harness tree; dir joins discovery roots
rtr-cli init myproj --variant design # design_wiki flavour
rtr-cli index # delta index (hash-guarded, per-model collections)
rtr-cli index --project /any/where/myproj # force-register then index
Indexed suffixes: .md, .nt, .yaml, .yml (OPENCODE_MEMORY_FILE_SUFFIXES
overrides). Sources of truth stay in each project's directives/; the vector
store (~/.config/opencode/memory/.local_vector_db) is a derived global cache,
partitioned per project. Reopen the same project name → memory restored.
4. Every environment knob (one global local config)
| Variable | Default | Meaning |
|---|---|---|
OPENCODE_MEMORY_EMBED_MODELS |
Snowflake/snowflake-arctic-embed-m,BAAI/bge-base-en-v1.5 |
comma-separated fastembed models; one ChromaDB collection each |
OPENCODE_MEMORY_RTR_PROFILE |
balanced |
balanced = 4+4 threads, performance = 8+8 |
OPENCODE_MEMORY_EMBED_THREADS |
profile default | int for all models, or per-model arctic:4,bge:8 |
OPENCODE_MEMORY_PROJECTS_DIR |
~/projects |
os.pathsep-separated discovery roots |
OPENCODE_MEMORY_FILE_SUFFIXES |
.md,.nt,.yaml,.yml |
indexed file types (DtD polyglot) |
OPENCODE_MEMORY_RRF_K |
60 |
RRF dampening; fuses rankings, never raw scores |
OPENCODE_MEMORY_RRF_VOTE_TOP |
10 |
per-run rank vote truncation (0 disables) |
OPENCODE_MEMORY_STRUCT_LANE |
off | rg/ccc/auto = structural grep lane for code-shaped terms |
OPENCODE_MEMORY_RTRRE_TRIGGER |
400000 |
Compressor trigger tokens (scale below your model input cap) |
OPENCODE_MEMORY_RTRRE_TARGET |
200000 |
verbatim tail kept after the drain (target) |
OPENCODE_MEMORY_RTRRE_PRESET |
re-symbiose-mugen |
keeper preset: re-symbiose-mugen 400k/200k/200 (default) · symbiose-ah 250k/100k/40 · fusion-ah 200k/100k/30 · re-symbiose 320k/128k/50 · legacy standard/calibrated/wide |
OPENCODE_MEMORY_RTR_PRESET_PROFILE |
public-default |
CPU profile: public-default (T4/P60) or local-system (T8/P80) |
OPENCODE_MEMORY_RETRIEVAL_MODALITY |
rtr-full |
retrieval modality: rtr-full (dual), rtr-arctic, rtr-bge, rag-hybrid-base, rag-dense-base, rag-hybrid, rag-dense, custom |
OPENCODE_MEMORY_CPU_PARKING_PERCENT |
profile default | CPU parking percent (20–80) — cores kept awake for embedding |
OPENCODE_MEMORY_RTRRE_MAX_KEEP |
200 |
max verbatim messages kept |
RTR_RE_KEEPER_CONFIG |
<project>/.opencode/rtr-re-keeper.json |
live Keeper bounds file (watched, no restart) |
RTR_RE_KEEPER_STATUS |
<project>/.opencode/rtr-re-keeper-status.json |
Keeper status file read by memory_rtr_status |
RTR_RE_KEEPER_ENABLED |
1 |
0 disables pruning (identity transform) |
OPENCODE_MEMORY_PRF |
0 |
1 = pseudo-relevance-feedback second pass |
OPENCODE_MEMORY_DB_DIR |
<memory>/.local_vector_db |
override vector DB home (bench isolation) |
FASTEMBED_CACHE_PATH |
system temp | override this — model home, persistent |
PYTHONIOENCODING |
— | set utf-8 on Windows for the TUI panels |
5. Tools exposed (MCP) and CLI map
memory_session_start · memory_session_commit · memory_reflect_session ·
memory_materialize_concepts · memory_update_graph · memory_search ·
memory_explain_search · memory_discover · memory_list · memory_delete ·
memory_inbox_write · memory_inbox_read · memory_write · memory_organize ·
memory_init_project · memory_consolidate · memory_stats · memory_index ·
memory_lexikon_add · memory_lexikon_show · memory_lexikon_build ·
memory_janitor · memory_context_plan · memory_symbiose_submit ·
memory_symbiose_poll · memory_rtr_status (26 tools; the last four are the
live loop surface — background tickets that never pause the turn, plus the
truthful status/health viewport reporting Keeper, Compressor and Manager).
Supervision beyond v2: gold v3 (785 judgments, additive only, labels frozen)
reruns the same verdict; the Lean battery builds against full Mathlib
(pinned v4.33.0, 8713 jobs green).
CLI mirrors all of them (rtr-cli <verb> --help each).
Lexikon: per-project glossary auto-derived from registry + sessions, plus a
hand-curated _global user lexikon (rtr-cli lexikon-add _global "term" --definition "..." --alias ...) — lookup-first expansion, no inference.
Maintenance: rtr-cli janitor [--dry-run] deletes orphan chunks whose files
are gone (also memory_janitor).
6. How retrieval works (the 30-second version)
Per query: original + lexikon/alias + workspace-delta sub-queries (+ optional
PRF) × per-model collections → decisiveness-weighted RRF (top-10 vote
truncation) → min-max normalized dense mixed with BM25 under standout lane
weights (dense-led 0.45/0.30 defaults; a lone lexical standout may take the
lead, weights always sum to 0.75) + 0.15·recency + 0.10·importance, plus
one shared 0.15-capped bonus lane split disjointly between CDATA exact
terms and optional structural-grep hits (OPENCODE_MEMORY_STRUCT_LANE).
Spans are DTD-typed at index
(PCDATA/CDATA/NDATA + NOTATION recorded, NDATA masked pre-embedding).
Same-name projects across roots resolve first-match; absolute paths always exact.
6b. Overseeding — bigger turbos welcome (bi-turbo philosophy)
RTR runs twin powerplants — Arctic precision plus bge recall — fused by RRF, the way rally engineers ran bi-turbo: not because one turbo wasn't enough, but out of love for solving the paradigm. Discoveries live there.
Any fastembed model slots in via one variable, and because every model owns its collection, overseeding is zero-migration: point, re-index, the old collections janitor away. Measured guidance from our own bench:
| Your hardware | Suggestion | Why |
|---|---|---|
| 8 cores | default dual (arctic-m + bge-base), balanced 4+4 |
the efficiency crown |
| 12–16 cores | same dual, performance 8+8 |
headroom well spent |
| Strong CPU + RAM | BAAI/bge-large-en-v1.5 and/or Snowflake/snowflake-arctic-embed-l (1024d) |
precision ceiling rises with dim |
| Keyword-heavy corpus | try single BAAI/bge-base-en-v1.5 |
our bench: BM25-adjacent turf favors focus |
OPENCODE_MEMORY_EMBED_MODELS="BAAI/bge-large-en-v1.5,Snowflake/snowflake-arctic-embed-l"
rtr-cli index # new collections fill; old ones: rtr-cli janitor
uv run python eval/bench_versus.py # prove it on your own corpus before you believe us
Honest note: bigger is not always better — on keyword-dense corpora our bench favors focus over size. Measure, don't assume. If your turbo wins, tell us; falsification is a contribution here.
6c. Live Keeper control (no restart)
The Keeper watches <project>/.opencode/rtr-re-keeper.json and reloads it
when it changes, so the next exchange already runs the new bounds. From any
session, slash commands do the same (confirmation rides back as the command
result; the window itself is untouched):
/rtr status bounds, last decision, sink, errors
/rtr hold 100000 preserved tail (target)
/rtr trigger 250000 eviction starts here
/rtr max 200 message cap
/rtr preset fusion-ah|symbiose-ah|re-symbiose|re-symbiose-mugen|standard|calibrated|wide
/rtr disable | /rtr enable
The ctrl+p palette (TUI plugin rtr-re-tui.tsx) exposes the same knobs as
commands under RTR Keeper: status, enable, disable, preset, cpu, modality,
threads, parking, trigger, target, max — each writes the same watched file, so
every change applies on the next exchange with no restart. Presets (shared
registry, 1.1.0): re-symbiose-mugen 400k/200k/200 (default) · symbiose-ah
250k/100k/40 · fusion-ah 200k/100k/30 · re-symbiose 320k/128k/50 ·
legacy standard/calibrated/wide.
The Keeper protects todowrite messages and the last user message; eviction is
oldest-first, sink-first, fail-open.
Every transform also writes .opencode/rtr-re-keeper-status.json; the
memory_rtr_status MCP tool reports it alongside Compressor bounds, worker
ticket health and Manager index state — absent evidence reads absent, never
invented.
7. Verify it (falsifiable or it didn't happen)
uvx --from rtr-role-type-retrieval python -m execution.rtr_eval # release gate
uv run python -m unittest execution.test_memory # unit suite
node --test opencode-plugin/rtr-re-keeper.test.mjs # Keeper suite (repo)
bun test opencode-plugin/rtr-re-tui.test.ts # ctrl+p palette suite (repo)
uv run python eval/bench_versus.py --intense # RTR-vs-RAG bench, real docs
uv run python eval/bench_graded.py --queries eval/graded/queries-v2.json --qrels eval/graded/qrels-v2.json
eval/results/ ships the scoreboard JSON, the Mermaid source, and the SVG.
8. Troubleshooting
- Slow first start — model download (~650 MB); later starts are warm. Raise MCP
timeoutonce. - HF rate limits — set
HF_TOKEN; downloads resume. - Windows paths — forward slashes work everywhere in this config.
- Empty results — project must live under a discovery root or be touched once by absolute path (auto-registers); check
rtr-cli stats. - ChromaDB lock errors — one writer at a time; close stale sessions.
8a. The installer session (terminal-native)
The installer runs entirely in the terminal — no browser, no HTTP, no network. Same experience on every platform, three personalities:
# pip / uvx — The Instrument (cool cyan, oscilloscope progress)
uvx rtr-re-install --theme instrument
# npm — The Network (magenta/violet, node-graph progress)
npx rtr-re-installer --theme network
# GitHub — The Forge (charcoal/emerald, raw build-log stream)
python installer/launchers/python_launcher.py --theme forge
Flags: --project DIR (install target, default cwd), --wheel PATH
(pip/uvx; installs the wheel), --tarball PATH (npm; installs the
tarball). The session offers three presets — Quick (MUGEN one-click),
Custom (component selection), Hardcore (full cockpit with
Recommended-from-Saimonokuma badges) — plus adaptive arcade remixes of
Obsession and the MiDi-MoE-Symbiogen-000 easter egg. The scene is a
DTD family member (installer/shell/dtd/rtrre-scene.mod); the shell
markup is validated against the declared vocabulary by
installer/shell/tools/conformance.py.
8b. Tessersect media — four 480p collages, 135 s each
Four distinct Moviola Torch collages (1-bit, 5 fps, 854x480, h264),
subtitles baked into every frame, three POVs, live dummy-session work.
Every number visible is frozen in eval/results/ or the dummy survey —
nothing staged for the camera.
| File | POV | Duration | Bytes | What it proves |
|---|---|---|---|---|
media/tessersect-a-480p.mp4 |
A · binary Versus | 135 s | 120717 | 544 queries/5 corpora, R@3 full leads, R@1 full leads, vote truncation |
media/tessersect-b-480p.mp4 |
B · graded gold-v2 | 135 s | 118339 | dense-base leads, NT-G1C mechanism, standout fix |
media/tessersect-c-480p.mp4 |
C · live loop | 135 s | 118112 | Keeper/Compressor/Manager, dummy3+dummy4 sink proof |
media/tessersect-d-480p.mp4 |
D · dummy5 live instances | 135 s | 123855 | fresh native-Keeper loop, QUARTZ-999 sink hit 0.9650 |
Spec: preset torch, height 480, fps 5, 26 captioned frames at 5 s each.
Reproduce: uv run --with pillow --no-project python media/make_frames.py,
then slideshow each media/frames-*/ directory at 5 s/image via the
Moviola Torch preset; probe with moviola_probe_media. Full spec:
media/TECHSPEC.md.
9. Licence
Dual-licensed, copyleft, binding: AGPL-3.0-or-later OR EUPL-1.2
(LICENSE-AGPL-3.0.txt, LICENSE-EUPL-1.2.txt, NOTICE). Upstream note: the
retrieval core derives in part from github.com/xpajonx/opencode-memory, which
ships no licence file — public redistribution of the combined work awaits
upstream clarification.
Metadata
Release files for rtr-role-type-retrieval 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rtr_role_type_retrieval-1.1.0.tar.gz | 2.1 MB | Without provenance | Details for rtr_role_type_retrieval-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rtr_role_type_retrieval-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for rtr_role_type_retrieval-1.1.0-py3-none-any.whl |
Total release size: 19.0 MB
Release files / rtr_role_type_retrieval-1.1.0.tar.gz
| Download URL | rtr_role_type_retrieval-1.1.0.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1eb6fe902a10c6cb335c29b1d1d86f5868416abcd05a7cdaed6dfc6faf0dd7d3
|
|
BLAKE2b-256 checksum How to use checksums |
cd52a973465744437c37bb5d4eb4594a0b3357b9bd3bdc6098eccbee27694b02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / rtr_role_type_retrieval-1.1.0-py3-none-any.whl
| Download URL | rtr_role_type_retrieval-1.1.0-py3-none-any.whl |
|---|---|
| Size | 17.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4aad096a1ec555d02f5143a85f7f4dfe21bf08bcd65b81b0fa49ce8c1a6c58d
|
|
BLAKE2b-256 checksum How to use checksums |
b7b3efc94d64e6ff4f4e1307a87bdc4d4142269b34cc9a02c9021202d66b5afc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for rtr-role-type-retrieval 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.