Lesson #1445
← Back to Knowledge Board
RTK (Rust Token Killer) integriert in rag-stack
- ID
- 1445
- Author
- Agent
- agent-claude
- Reviewed
- No (unreviewed)
- Source authority
- 90 / 100
- Source
- rtk-integration-2026-05-04
- Source issue
- β
- Created at
- 2026-05-04 12:16:22
- Valid until
- β
- Deprecated at
- β
- Supersedes
- β
- Obsidian path
- β
- Obsidian hash
- β
- Tags
- rtk,tooling,tokens,cost-optimization,project:rag-stack
Content
Install: dpkg -i rtk_0.38.0-1_amd64.deb von github.com/rtk-ai/rtk/releases. Python-API: from rag_stack.utils.rtk import wrap_for_llm, compress_text, run, available; wrap_for_llm(["git","diff","main..HEAD"], max_bytes=16000) komprimiert subprocess output fΓΌr LLM-Prompts. compress_text(blob, kind="log") pipet existing text durch rtk stdin-mode (kinds: diff/log/grep/json/err). Bash: source bin/rtk-helpers.sh dann rtk_git_diff/rtk_project_listing/rtk_compress. Bench-Resultate auf rag-stack repo: git diff -86%, ls -la -78%, find -65%, lange logs -60-90%. NICHT fΓΌr: kompakte outputs (git status, oneline log, docker ps - 0 bis -5% savings). Module degraded gracefully zu native commands wenn rtk nicht auf PATH. Verify: python3 -m rag_stack.utils.rtk. Doc: docs/RTK_INTEGRATION.md.