Bug
When memory_store (MCP) or POST /memories (REST) fails to generate an embedding — e.g. the embedding provider is temporarily unreachable or the input exceeds the model's context window — the memory is stored with embedding = NULL. These memories are permanently excluded from memory_search semantic results because the search query filters on embedding IS NOT NULL.
There is currently no mechanism to regenerate the embedding after the fact, so the only remediation is to delete and re-store the memory (which changes the ID and loses the created_at timestamp).
A related scenario occurs when switching embedding providers or models (e.g. from text-embedding-3-small at 1536 dimensions to nomic-embed-text at 768 dimensions, as migration 015 supports). Existing embeddings become semantically mismatched with new query embeddings, degrading search quality. Again, there is no built-in way to re-embed existing memories with the new model.
Reproduction
- Start Open Brain with an embedding provider configured
- Stop the embedding provider (e.g.
ollama stop)
- Store a memory via MCP or REST — it succeeds with a warning to stderr
- Restart the embedding provider
- Search for the memory by its content — it is not returned
Suggested fix
Add a memory_regenerate_embedding tool (MCP) and a POST /memories/{id}/regenerate-embedding endpoint (REST) that:
- Reads the memory's existing
content
- Generates a fresh embedding via the configured provider
- Updates the
embedding column
By default, only memories with NULL embeddings should be updated. A force flag allows overwriting valid embeddings (for model migration scenarios).
Bug
When
memory_store(MCP) orPOST /memories(REST) fails to generate an embedding — e.g. the embedding provider is temporarily unreachable or the input exceeds the model's context window — the memory is stored withembedding = NULL. These memories are permanently excluded frommemory_searchsemantic results because the search query filters onembedding IS NOT NULL.There is currently no mechanism to regenerate the embedding after the fact, so the only remediation is to delete and re-store the memory (which changes the ID and loses the
created_attimestamp).A related scenario occurs when switching embedding providers or models (e.g. from
text-embedding-3-smallat 1536 dimensions tonomic-embed-textat 768 dimensions, as migration 015 supports). Existing embeddings become semantically mismatched with new query embeddings, degrading search quality. Again, there is no built-in way to re-embed existing memories with the new model.Reproduction
ollama stop)Suggested fix
Add a
memory_regenerate_embeddingtool (MCP) and aPOST /memories/{id}/regenerate-embeddingendpoint (REST) that:contentembeddingcolumnBy default, only memories with
NULLembeddings should be updated. Aforceflag allows overwriting valid embeddings (for model migration scenarios).