Skip to content

Cursor/mem injection optimization main - #550

Merged
Wang-Daoji merged 5 commits into
MemTensor:v1.1.9from
Wang-Daoji:cursor/mem_injection_optimization-main
Sep 28, 2026
Merged

Wang-Daoji merged 5 commits into
MemTensor:v1.1.9from
Wang-Daoji:cursor/mem_injection_optimization-main

Conversation

@Wang-Daoji

Copy link
Copy Markdown
Collaborator

No description provided.

Wang-Daoji and others added 5 commits September 21, 2026 11:58
In turn_start retrieval, pass up to the last 5 succeeded Q/A pairs of the
current session (from the already-fetched recent RawTurns) to the
retrieval.query.extract LLM call so it can resolve references such as
"那个脚本" / "继续上次的" when producing queryVecText and keywords.

- config: add algorithm.retrieval.queryExtractHistoryTurns (5) and
  queryExtractHistoryTextChars (200); 0 turns disables the feature
- plugin-algorithms: RETRIEVAL_QUERY_EXTRACT_PROMPT v2 -> v3 with
  CURRENT USER INPUT / RECENT CONVERSATION rules and two few-shots
- retrieval-service: export queryExtractHistoryFromRawTurns, render
  RECENT CONVERSATION + CURRENT USER INPUT for the extract user message,
  skip history when the current input exceeds 2000 chars
- tests: bump extract operation to v3, add history selection, e2e,
  empty-history, non-turn_start, disabled and long-input cases, and
  config parsing coverage

Only the extract model input changes; request protocol, candidate pool,
LLM filter input, injection format and storage are untouched.

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit c487f9b)
Lower llmFilterMinCandidates default from 2 to 1 so a lone mechanical
candidate still goes through the semantic filter instead of being
injected unchecked.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Wang-Daoji
Wang-Daoji merged commit 1631f93 into MemTensor:v1.1.9 Sep 28, 2026
3 checks passed
@Wang-Daoji
Wang-Daoji deleted the cursor/mem_injection_optimization-main branch October 19, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant