Skip to content

search: operator-intent query shaping for long workflow prompts #303

Open

Description

@hurttlocker

Summary

Improve Cortex retrieval on long operator-style prompts by adding a product-side query-shaping / condensation path before search, instead of relying on the raw answer-contract prompt shape.

Problem

The cleaned real-pattern benchmark shows that long prompts like workspace digests and fact-quality audits still often miss top-1 retrieval even after harness noise was removed.

The benchmark harness now normalizes retrieval queries for evaluation, but Cortex itself still needs a stronger product-side path for handling these prompts.

Evidence

From the March 8 final live rerun:

  • Retrieval: 5/12 passed
  • Avg precision@k: 0.4167
  • Weak cases still include workspace-digest / fact-audit / operator summary prompts

Goal

When a user gives Cortex a long operator prompt with formatting/answer-contract boilerplate, Cortex should derive a cleaner search intent before ranking memories.

Proposed Scope

  • Add an internal query-shaping step for long operator prompts before search/retrieval
  • Strip or downweight answer-contract boilerplate when appropriate
  • Preserve the full raw prompt for the downstream reason lane
  • Add instrumentation so raw vs shaped query behavior can be compared in telemetry/debug output
  • Add deterministic tests using harvested real-pattern cases

Non-Goals

  • Do not silently change lifecycle state or belief writes
  • Do not hardcode a fix for one prompt family only
  • Do not loosen benchmark expectations just to make the score rise

Done When

  • targeted tests exist for operator prompt condensation / shaping
  • at least one current red real-pattern case becomes a real top-1 retrieval win for product reasons, not benchmark watering-down
  • docs/benchmark notes explain the change

Activity

  1. added
    enhancement
    search
    benchmark
    hardening
    on Mar 8, 2026
  2. hurttlocker commented on Mar 11, 2026

    @hurttlocker
    OwnerAuthor

    Release-board hygiene note:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    benchmarkenhancementhardeningsearch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions