Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.qredence.ai/llms.txt

Use this file to discover all available pages before exploring further.

This page documents the current maintained Python interfaces. When this disagrees with the code, trust the code in src/fleet_rlm/.

Core runtime classes

fleet_rlm.DaytonaInterpreter

Primary sandbox execution runtime. The maintained implementation lives at fleet_rlm.integrations.daytona.interpreter.
from fleet_rlm import DaytonaInterpreter

with DaytonaInterpreter(timeout=600, volume_name="rlm-volume-dspy") as interp:
    result = interp.execute("print('hello')")
    print(result.text)
Key capabilities:
  • Lifecycle control: start(), shutdown(), context-manager support.
  • Sync/async execution: execute(), aexecute().
  • Execution profile support used by server and delegate workflows.
  • Child sandbox creation via build_delegate_child() (called from the delegation tool, not typically directly).
The interpreter is the facade — outside integrations/daytona/, no other code should touch the Daytona SDK directly.

fleet_rlm.runtime.agent.agent.FleetAgent

The interactive dspy.ReAct-backed orchestration module used by every chat surface (CLI, HTTP, WebSocket). Key behaviors:
  • Tool discovery and registration via discover_tools().
  • Sync chat turn helpers.
  • Streaming event generation for WebSocket clients.
  • Tool dispatch including the recursive delegate_to_rlm tool.
FleetAgent is normally wrapped by AgentRuntime, which adds the Daytona interpreter, conversation history, and core-memory state.

fleet_rlm.runtime.agent.runtime.AgentRuntime

State envelope around FleetAgent. Owns:
  • The DSPy LM configuration.
  • The DaytonaInterpreter instance.
  • dspy.History conversation turns.
  • Loaded document paths.
  • Agent core memory blocks.
Build one via runtime.factory.build_runtime() — the same factory the WebSocket transport uses.

Runner functions (fleet_rlm.cli.runners)

The current maintained runner surface used by the CLI and tests:
  • build_chat_agent(...) — construct an AgentRuntime.
  • run_react_chat_once(...) — single-turn sync wrapper.
  • arun_react_chat_once(...) — single-turn async wrapper.
  • run_long_context(...) — long-document analysis backed by DSPy RLM signatures.

build_chat_agent(...)

Constructs an AgentRuntime wrapping FleetAgent. The maintained surface is intentionally small:
ParameterPurpose
docs_pathOptional document to preload as context
react_max_itersMax ReAct iterations per turn
history_max_turnsConversation history window
extra_toolsAdditional ReAct tools to register
env_filePath to .env
planner_lmDSPy LM for the planner role
interpreterPre-built DaytonaInterpreter (otherwise built from env)
sub_lm / delegate_lmOptional separate LM for delegation
repositoryPersistence repository
Daytona sandbox controls (timeout, volume, recursion limits, child isolation, delegate budgets) belong on DaytonaInterpreter, server runtime config, or the interpreter pool. They are not accepted as no-op legacy kwargs by build_chat_agent.

run_react_chat_once(...) and arun_react_chat_once(...)

Single-turn wrappers around the interactive ReAct agent. Maintained parameters: message, docs_path, react_max_iters, include_trajectory, env_file, delegate_lm. The async wrapper also accepts planner_lm. Output shape includes:
  • assistant_response
  • Optional trajectory metadata (when include_trajectory=True).
  • Turn / session metadata and warnings.

run_long_context(...)

Long-document analysis/summarization helper backed by DSPy RLM signatures.
from fleet_rlm.cli.runners import run_long_context

result = run_long_context(
    docs_path="README.md",
    query="Summarize the architecture",
    mode="summarize",
)
print(result["summary"])
Modes:
ModeSignature
summarizeSummarizeLongDocument

Signatures (fleet_rlm.runtime.agent.signatures)

DSPy signatures define the typed input/output contracts for agent behavior:
SignaturePurpose
SummarizeLongDocumentLong-document summarization
ExtractFromLogsStructured extraction from logs
GroundedAnswerWithCitationsGrounded QA with citations
IncidentTriageFromLogsIncident triage
CodeChangePlanCode-change planning
CoreMemoryUpdateProposalCore-memory updates
VolumeFileTreeSignatureVolume tree exploration
MemoryActionIntentSignatureMemory action intent
MemoryStructureAuditSignatureMemory structure audit
MemoryStructureMigrationPlanSignatureMemory migration planning
ClarificationQuestionSignatureClarification questions
All are dspy.Signature subclasses with typed InputFields and OutputFields. They’re independently testable and optimizable through DSPy’s optimization pipelines.

Building a recursive RLM directly

When you need a bounded recursive runner without going through the ReAct delegation tool:
from fleet_rlm.runtime.models.builders import build_recursive_subquery_rlm

rlm = build_recursive_subquery_rlm(
    interpreter=child_interpreter,
    max_iterations=8,
    max_llm_calls=40,
)

result = rlm(prompt="Extract every TODO from these logs", context="...")
In production code, prefer the delegate_to_rlm tool from inside the ReAct agent — it enforces the shared call budget across the recursive tree for you. See Recursive RLM.

Tools (fleet_rlm.runtime.tools)

The ReAct tool registry is in src/fleet_rlm/runtime/tools/. The recursive delegation tool is:
  • rlm_delegate.delegate_to_rlm(query, context="", document_url="")
Custom tools register through discover_tools() on FleetAgent or by passing extra_tools=[...] to build_chat_agent.

Quality / optimization (fleet_rlm.runtime.quality)

Offline evaluation and GEPA optimization:
ModulePurpose
module_registryRegistered DSPy modules (longcot-reasoner, etc.)
dspy_evaluationDSPy Evaluate integration
gepa_optimizationGEPA optimization runner
mlflow_evaluationEvaluation with MLflow logging
mlflow_optimizationOptimization runs with MLflow logging
scorersScoring functions and metrics
workspace_metricsWorkspace-aware metrics
CLI surface: uv run fleet-rlm optimize list and uv run fleet-rlm optimize <module> <dataset>.

Import verification

uv run python -c "from fleet_rlm import DaytonaInterpreter"
uv run python -c "from fleet_rlm.cli.runners import run_long_context, run_react_chat_once"
uv run python -c "from fleet_rlm.runtime.agent.signatures import SummarizeLongDocument"
uv run python -c "from fleet_rlm.runtime.models.builders import build_recursive_subquery_rlm"

See also