fix(ingest): embed project-scoped writes (#216) - #217
Open
RockinPaul wants to merge 1 commit into
Open
RockinPaul wants to merge 1 commit into
RockinPaul wants to merge 1 commit into
Conversation
applyImportPlan ingests inside a synchronous transaction and never called the embedder, so every node it created was stored with vectors.semantic null. Project ingest, remember_decision and connector imports all go through it, so those memories never received a vector score in recall. Embed each planned node before entering the transaction, the same way ingest() does, and pass the vector to engine.ingest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Description
Fixes #216.
applyImportPlaningests inside a synchronousimport_transaction().run(...)and never called the embedder, so every node it created was stored withvectors.semantic: null. Project ingest (longmemory_ingestwithproject_id), everylongmemory_remember_decision, and connector imports go through it, so those memories never received a vector score in recall and could only match lexically.This embeds each planned node before entering the transaction, the same way
ingest()does (embed(cfg.embedding_provider, multilingual_embeddings, embedding_cache, text, language, 'document')), and passes it toengine.ingestasvector. Nodes are embedded sequentially, asingest()does, so a large connector import doesn't fan out into concurrent provider requests.🔄 Type of Change
Verification
New check in
benchmarks/src/check.ts: a project-scopedingestProjectEventwith a configured embedding provider must store a semantic vector. It failed onmain(undefined !== 4) and passes with the fix.pnpm typecheck,pnpm bench:check,pnpm bench:ciandpnpm buildpass.pnpm branding:checkandpnpm integration:checkfail identically on unmodifiedmain:tools/is not in the repository (Cannot find module tools/branding.mjs), and the n8n lint step reportsCommand "eslint" not found. No files were added, so the header requirement is unaffected.pnpm release:checkpasses locally (blocked by the missingtools/directory above)New files pass
pnpm branding:check(no new files)User-visible behavior has been exercised manually when applicable (the reproduction in [BUG] Project-scoped writes (ingest with project_id, remember_decision) are stored without embeddings #216 was run against a deployed server)
🔍 Code Review Checklist
📚 Related Issues
🚀 Deployment Notes
Memories already written through this path keep their null vectors; there is no re-embed step, so they stay lexical-only until re-ingested.
🤖 Generated with Claude Code