feat(recall): enrich Sources with descriptions and add complexity gating - #276
Open
m0Nst3r873 wants to merge 1 commit into
Open
Conversation
m0Nst3r873
force-pushed
the
feature/recall-source-desc-and-complexity-gating
branch
2 times, most recently
from
August 4, 2026 07:38
fd66b77 to
5bb6625
Compare
…hment Three groups of changes to improve recall precision and efficiency, based on recall-Q1Q3 benchmark findings: **Q1 — Candidate change files** (from worktree-recall-quality-q1q3): - queryCodeKnowledge() extracts forward-dependency neighbors from graph-index for each codebase hit - formatResults() surfaces them as a "Candidate change files" section - teamai-recall.md instructs the subagent to reproduce this section **Q3 — Task-type depth heuristic** (from worktree-recall-quality-q1q3): - teamai-recall.md Step 1 differentiates depth by task type (feature→lookup, bugfix→context) - compileRecallRulesBlock() hints the main conversation to leverage or skip recall accordingly **Sources enrichment** (new in this PR): - SourceAnchor type replaces plain string[] for sources, carrying per-file functional descriptions (≤40 chars) extracted from wiki component facts - --check verdict for RELEVANT queries now includes top-1 hit's title and sources, enabling LOW-complexity fast path - teamai-recall.md gains complexity quick-judge in Step 0: LOW tasks skip Steps 1-5, returning only top-1 suggestion Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
m0Nst3r873
force-pushed
the
feature/recall-source-desc-and-complexity-gating
branch
from
August 4, 2026 07:40
5bb6625 to
de0b3aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Building on Q1 (#240, source-file anchors) and Q3 (#234, --check precheck), this adds three improvements to recall quality:
src/api.ts (请求发送与重试逻辑)), helping agents distinguish similarly-named files--checkoutput enrichment: RELEVANT verdicts now include the top-1 hit's title and sources, enabling the LOW-complexity fast path without a full recall round-tripMotivation (from recall-Q1Q3 benchmark)
Q1 source anchors boosted high-complexity tasks significantly, but low-complexity tasks regressed — recall injected unnecessary context that distracted the agent. This PR addresses both the precision gap (descriptions) and the efficiency gap (complexity gating).
Test plan
npx tsc --noEmit— zero type errorsnpx vitest run— 144 files, 1891 tests passedteamai recall --check "modify service name"showsRELEVANT score=X.X title="..." sources=...teamai recall "restart precheck controller"showsSources: path (description)format🤖 Generated with Claude Code