Repository navigation
Exclude ai-chat nodes from embedding/vectorization (closes #1696) - #1733
Merged
Merged
Conversation
AiChatNodeBehavior::get_embeddable_content() now returns None unconditionally: ai-chat conversations are never embedded or semantically searchable. Reverses the ADR-029 per-type decision (embeddable-but-hidden) to not-embeddable. Consolidates the obsolete extraction tests into test_ai_chat_node_never_embeddable and flips the affected assertions. Removes the now-dead 'conversations' scope from the agent's search_nodes tool schema and skill guidance so the model isn't steered to a scope that returns nothing; the core SearchScope::Conversations variant stays as a documented no-op. Also commits the sha2 Cargo.lock entry that #1715's Cargo.toml change left uncommitted. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Author
|
APPROVE Independent adversarial review (crate-wide + agent/daemon/desktop-app): no tests break, container-parity holds (ai-chat's |
7 tasks
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.
Summary
AI-chat conversation nodes were embedded and made semantically searchable. This stops that: ai-chat nodes are never vectorized. Conversations are not general knowledge and must not surface in semantic search.
This reverses the per-type decision in ADR-029 (embeddable-but-hidden) to not embeddable at all. The behavior-owned embedding mechanism itself is unchanged — only ai-chat's
get_embeddable_content()result changes.Changes
behaviors/mod.rs—AiChatNodeBehavior::get_embeddable_content()now returnsNoneunconditionally (was: extract user/assistant text fromproperties.messages[]). Updated the method + struct doc comments. Consolidated the two now-obsolete extraction tests into onetest_ai_chat_node_never_embeddable(assertsNonefor rich, empty, tool-only, and no-messages shapes); flipped theget_embeddable_contentmatrix assertion tois_none().embedding_service.rs— flipped the ai-chat assertion intest_behavior_driven_embedding_decisiontois_none(); updated its doc comment; added a clarifying comment atmatches_scopenotingSearchScope::Conversations(node_type == "ai-chat") is now a no-op (no ai-chat rows exist in the vector index). The enum variant is retained for API stability.agent/local_agent/tools.rs+agent/skill_pipeline.rs— removedconversationsfrom thesearch_nodestool's advertisedscopeoptions and dropped the skill guidance that steered the model toscope="conversations"for past chats. Without this, the model would keep calling a scope that now returns nothing and report "searched conversations, found nothing." The coreSearchScope::Conversationsenum variant is retained (documented no-op) for API stability.nodespace-docsADR-029 (committed directly to docsmainper that repo's workflow) — added a Revision note, updated the per-type behavior table (ai-chat →None) and the SearchScope section (Conversations/Everything surface no ai-chat content).Cargo.lock— adds thesha2entry fornodespace-nlp-enginethat was missing (itsCargo.tomlgained the dep in Build-time model download (scripts/download-models.ts) skips SHA-256 verification #1715 but the root lockfile was never committed alongside it, leaving--lockedbuilds inconsistent). Drive-by correction.Notes
get_embeddable_content()returningNonetriggers the embedding service's "don't embed me → clean up existing embeddings" path on reprocess (greenfield: no migration needed).NON_EMBEDDABLE_CONTAINER_TYPESunchanged (ai-chat isn't a container type).Verification
cargo test -p nodespace-core --lib: 966 passed, 0 failed;cargo clippy -p nodespace-core: clean.conversationsscope — which this PR fixes (tools.rs + skill_pipeline.rs above).cargo test -p nodespace-agent --lib(scope + skill tests): green;cargo clippy -p nodespace-agent: clean.Closes #1696.