Skip to content

feat(agent): consume similar_trajectories in plan construction — retrieved high-reward trajectories are fetched then ignored #10581

Closed

Description

@mrveiss

similar_trajectories are retrieved with reward filtering, then ignored by plan construction

Part of umbrella #10542 · concrete sub-slice of #10545 · follow-up to the trajectory store (GH#7357).

Research origin: Ornith-1.0 comparison — high-reward past trajectories should bias the next plan. AutoBot already retrieves them (paying the vector-search cost) but never feeds them into planning.

The gap (verified)

WorkflowPlanner fetches high-reward similar past solutions before planning:

  • autobot-backend/orchestration/workflow_planner.py:288-293 — find_similar_trajectories(user_request, top_k=5, min_reward=0.7) → stored in context["similar_trajectories"].

But:

  • The method docstring at :99 states plainly: "Step generation always [builds from scratch]"; callers may only "inspect via context['similar_trajectories']."
  • Grep confirms zero consumers read context["similar_trajectories"] (only the populate site and the docstring reference it).

Net: we run a ChromaDB query + embedding on every plan, filter to reward ≥ 0.7, and then discard the result. The reward signal stored in the trajectory store influences nothing.

What to build

  • Inject the retrieved trajectories' action_sequence / strategy into the planning prompt as few-shot priors ("a similar high-reward task was solved via …"), so the planner can reuse proven decompositions instead of always re-deriving.
  • Keep it advisory-but-used: the planner may deviate, but the trajectory must demonstrably reach the prompt.
  • Non-fatal path already exists (try/except at :299) — preserve it.

Acceptance criteria

  • When a high-reward similar trajectory exists, its decomposition/strategy is present in the planner's prompt (assert on the rendered prompt in a test).
  • With no similar trajectory (or all below min_reward), behavior is unchanged.
  • No change to the retrieval contract in memory/trajectory_store.py.

Entry points

autobot-backend/orchestration/workflow_planner.py (populate + step generation) · autobot-backend/prompt_manager.py · autobot-backend/memory/trajectory_store.py (read-only)

Activity

  1. mrveiss commented on Jun 28, 2026

    @mrveiss
    OwnerAuthor

    Implementation blueprint: Experience as a Compass: Multi-Agent RAG with Evolving Orchestration and Agent Prompts. Its "Orchestration Adaptation" is this issue — dynamically adjusting agent selection/sequencing by analyzing patterns in historical trajectories, in-context (no retraining). Directly informs how to inject similar_trajectories decompositions into the planning prompt as few-shot priors.

  2. mrveiss commented on Jul 6, 2026

    @mrveiss
    OwnerAuthor

    Delivered via PR #10983 — Ornith-style planning loop wired (learned prompt template + similar-trajectory priors + best-of-N plan selection), config-gated + explainable. 20/20 tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions