Compress search trajectories into structured states capturing partial answers, evidence, and uncertainties. Recursive execution leverages compressed states to avoid redundant exploration, improving resource efficiency by 50%.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Compress search trajectories into structured states capturing partial answers, evidence, and uncertainties. Recursive execution leverages compressed states to avoid redundant exploration, improving resource efficiency by 50%.
RE-TRAC: Recursive Trajectory Compression for Search
Problem
ReAct-style search agents suffer from incomplete branch exploration—up to 93% of planned branches never execute due to linear trajectory structure. Independent parallel attempts (Pass@k scaling) miss cross-trajectory learning.
Long sequences consume tokens and computational resources. Agents need structured, compressible representations of search progress.
Core Concept
RE-TRAC compresses search trajectories into structured state representations capturing answer progress, evidence base, and unresolved questions. These compressed states seed the next search round, enabling targeted exploration of incomplete branches.
Recursive execution with cross-trajectory learning reduces resource consumption while improving final performance.
Architecture Overview
Structured State Representation: Answer & Conclusions, Evidence Base, Uncertainties
Evidence Tracking: Source verification and provenance for all claims
Recursive Execution: Use compressed states as input for continuation rounds
Branch Exploration: Systematically address unresolved questions from previous round
Resource Monitoring: Track cumulative computation across rounds
Implementation
Step 1: Define Structured State Representation
Create compress format for search progress.
classStructuredSearchState:
def__init__(self):
self.partial_answers = [] # Best-supported answers found so farself.evidence_base = [] # All discovered evidence with sourcesself.uncertainties = [] # Open questions needing explorationdefadd_partial_answer(self, answer_text, confidence, supporting_evidence):
"""Record a potential answer with its support."""self.partial_answers.append({
'text': answer_text,
: confidence,
: supporting_evidence
})
():
.evidence_base.append({
: claim,
: source_url,
: verification_status,
: datetime.now().isoformat()
})
():
.uncertainties.append({
: question,
: reason,
: next_steps
})
():
prompt =
.partial_answers:
prompt +=
sorted_answers = (.partial_answers, key= x: x[], reverse=)
ans sorted_answers[:]:
prompt +=
.evidence_base:
prompt +=
ev .evidence_base[:]:
status = ev[]
prompt +=
.uncertainties:
prompt +=
unc .uncertainties:
prompt +=
prompt +=
prompt
'confidence'
'evidence'
def
add_evidence
self, claim, source_url, verification_status
"""Store evidence with provenance tracking."""
self
'claim'
'source'
'verified'
'timestamp'
def
add_uncertainty
self, question, reason, next_steps
"""Record unresolved questions."""
self
'question'
'why_unresolved'
'suggested_exploration'
def
to_prompt
self
"""Convert state to prompt for next search round."""
defcomplete_unexecuted_branches(state, search_agent, tokens_per_branch=500):
"""Target remaining unexecuted branches from previous rounds."""for uncertainty in state.uncertainties:
if'Execute planned branch'in uncertainty['suggested_exploration']:
# Extract branch description
branch_query = uncertainty['question']
# Focused search on this branch
branch_prompt = f"Focus on this specific question: {branch_query}\n\n"
branch_prompt += f"Context:\n{state.to_prompt()}\n\n"
branch_prompt += "Provide thorough exploration of this specific branch."
trajectory = search_agent.search(branch_prompt, max_tokens=tokens_per_branch)
# Update state with new findings
new_state_fragment = compress_trajectory_to_state(trajectory, answer_model, evidence_model)
# Merge new findings into existing state
state.partial_answers.extend(new_state_fragment.partial_answers)
state.evidence_base.extend(new_state_fragment.evidence_base)
return state