-
Notifications
You must be signed in to change notification settings - Fork 575
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
When auto-recall is enabled, long prompts (e.g. file attachment descriptions, multi-turn conversation summaries) are passed directly as embedding queries without any length limit. This causes two issues:
- Embedding quality degrades for very long queries — the semantic signal gets diluted when the query contains thousands of characters of surrounding context
- No user visibility into when and by how much queries are truncated
In practice, query lengths of 1002-1777 chars are common, and a 1000-char hardcoded limit is too restrictive for meaningful queries.
Proposed Solution
Make the auto-recall query length limit configurable via config.autoRecallMaxQueryLength, defaulting to 2000 chars:
const MAX_RECALL_QUERY_LENGTH = config.autoRecallMaxQueryLength ?? 2_000;This mirrors the existing pattern used for other auto-recall config parameters:
config.autoRecallMaxItems(default: 3)config.autoRecallMaxChars(default: 600)config.autoRecallPerItemMaxChars(default: 180)
Why this improves quality
- Embedding models typically perform best with focused, concise query text
- A configurable limit lets users tune based on their embedding provider's context window
- Users get log visibility (
memory-lancedb-pro: auto-recall query truncated from X to Y chars) when truncation happens
Additional notes
- FR-04 in the codebase already documents the intent: "Auto-recall only needs the user's intent, not full attachment text"
- A configurable limit enables this intent without forcing an overly restrictive hardcoded value
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request