WIP: Interactive REPL for RLM-style reasoning over qmd collections #37
+818
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an interactive REPL (
qmd repl) that mounts qmd collections as a read-only virtual filesystem, enabling LLMs to interact with large knowledge bases symbolically through shell commands rather than loading everything into context.Motivation: Recursive Language Models (RLMs)
This is groundwork for implementing RLM (Recursive Language Models) - an inference-time strategy that allows LLMs to process inputs far beyond their context windows.
The Key Insight
Instead of tokenizing massive documents directly into the model's context, RLMs treat the knowledge base as part of the environment that the LLM can symbolically interact with. The model writes commands to:
This enables handling inputs two orders of magnitude beyond model context windows.
Why Bash Instead of Python
We use just-bash - a sandboxed bash environment - because:
What This PR Adds
/qmd/<collection>//home/for intermediate resultssearch(BM25) andquery(hybrid) commands built-inls,cat,head,tail,grep,find,awk, etc.--promptor--fileflags to seed/home/prompt.txtUsage
Inside the REPL:
Example RLM-style Workflow
🤖 Generated with Claude Code