fix(memory): filtrar resultados irrelevantes da busca semântica#10
Conversation
The semantic search was returning all top N results regardless of relevance score. Results with negative scores (distance > 1) are semantically distant and should not be returned. Added a minimum relevance threshold of -0.2 to filter out noise.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughA minimum relevance threshold (MIN_RELEVANCE_SCORE = -0.2) was added to the semanticSearch function to filter out low-scoring results. Previously, all mapped search results were returned without filtering, regardless of relevance score. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Descricao
A busca semântica do team-memory retornava todos os top N resultados independente da relevância. Resultados com score negativo (distância > 1) são semanticamente distantes e poluíam os resultados. Adicionado threshold mínimo de -0.2 para filtrar ruído.
Etiquetas (Labels)
Historia Relacionada
N/A
Motivacao e Contexto
Ao buscar por termos específicos (ex: "arvore-eink cleartext"), a busca retornava todas as memórias do banco, incluindo resultados completamente irrelevantes com scores de -0.88, -0.99 etc. Isso polui o contexto do agente e desperdiça tokens.
Como Isso Foi Testado?
Analise de Risco e Impacto
Capturas de Tela ou Auxilios Visuais (se apropriado)
N/A
Summary by CodeRabbit