Re-embed memories when embeddingModel changes vector size

Aberta
#2 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
javascript
Domínio
databases, search

Direção de pesquisa

Read DESIGN.md sections “Search and bootstrap” and “One vector space” to understand the stated constraints. Then locate the Memory model, embedding option reload handling, and vector index setup; the issue does not name their files or tests. Done means existing rows are re-embedded with the configured model and a dimension-changing reload is handled safely.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Problem

embeddingModel can be changed in the plugin options, but rows already embedded by the previous model are not re-embedded. Harper's HNSW index fixes its vector size at the first vector, so a model with a different size:

  • leaves new and revised rows out of the vector index (Harper skips them with a warning);
  • makes vector queries fail, so search falls back to full-text only and logs it once per model;
  • keeps rows written under the mismatched model out of the vector lane even after the option is reverted, until each is revised.

Nothing rejects or warns about the change when the options reload. Same-size model switches are handled: the vector lane only compares rows tagged with the configured embeddingModel, and older rows stay reachable through full-text.

Proposed

A migration that re-embeds every Memory row with the configured model, rebuilding the vector index when its size changes, plus a check that refuses (or warns about) a dimension-changing reload until the migration runs.

Refs: the v0 core PR (DESIGN.md "Search and bootstrap", "One vector space").

Review-Deferral: 6ceee23de50a8167 severity=minor category=reliability

🤖 Generated by Claude Opus 5.5 (Claude Code); posted via @kriszyp.

Linguagem predominante
JavaScript
Estrelas
0
Forks
0
Merge médio
20h 29min
PRs com merge (30d)
28

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de HarperFast/agent-memory

Todas as issues de HarperFast/agent-memory

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.