Repository navigation
Description
Overview
AI-chat conversation nodes are currently embedded and made semantically searchable. This should stop — ai-chat nodes should not be vectorized at all.
Architecture Impact
This reverses ADR-029 (decisions/029-behavior-owned-embedding.md, Status: Accepted), which explicitly decided: "AI chat nodes are embeddable but excluded from default search via SearchScope::Knowledge." ADR-029's table of per-type behavior explicitly lists ai-chat as extracting "user+assistant text from properties.messages[]" for get_embeddable_content() (Accepted, 2026-04-03).
This issue changes that decision from "embeddable, but hidden from default search" to "not embeddable at all." A companion nodespace-docs change is required: update ADR-029's per-type behavior table and its SearchScope::Conversations/Everything discussion to reflect that ai-chat no longer produces embeddings, since SearchScope::Conversations (searching conversations explicitly) becomes a dead/no-op scope once ai-chat stops embedding. Commit that edit directly to nodespace-docs main (per that repo's own workflow — no branch/PR needed there).
Problem Statement
AiChatNodeBehavior::get_embeddable_content() (packages/core/src/behaviors/mod.rs:1609-1619) currently extracts and returns concatenated user/assistant message text from properties.messages[], so every ai-chat node with messages is embedded and indexed like any other content. A test at packages/core/src/behaviors/mod.rs:4479-4482 explicitly asserts "ai-chat with messages should be embeddable" — codifying the ADR-029 behavior this issue reverses.
Per CLAUDE.md's decision tree, embeddability for built-in node types is entirely behavior-trait-owned (no schema flag exists for this), so this is a Core hardcoded-behavior change in packages/core/src/behaviors/mod.rs.
Proposed Solution
Change AiChatNodeBehavior::get_embeddable_content() to return None unconditionally, so ai-chat nodes are never embedded. Update the now-inverted test assertion at mod.rs:4479-4482 to assert non-embeddability instead, and search for any other tests or SearchScope handling that assume ai-chat embeddability (e.g. SearchScope::Conversations/SearchScope::Everything in the search-scope enum referenced by ADR-029) and update them consistently.
No change needed to NON_EMBEDDABLE_CONTAINER_TYPES (mod.rs:167) — that const list is only for child-bearing container types used in the BM25 ancestor-walk CTE (packages/core/src/db/sqlite_store/embeddings.rs:645). Ai-chat nodes have can_have_children() == false, so they are not part of that walk-stop mechanism; only get_embeddable_content() needs to change.
Acceptance Criteria
-
AiChatNodeBehavior::get_embeddable_content()returnsNonefor all ai-chat nodes - Newly created or updated ai-chat nodes produce no embeddings going forward
- No migration of existing embeddings is needed — this is a pre-release app with no production data (per CLAUDE.md); stale ai-chat embeddings, if any exist in dev databases, are simply never regenerated
- Test at
mod.rs:4479-4482updated to assert non-embeddability - Any
SearchScopevariants/tests assuming ai-chat is embeddable (Conversations,Everything) updated to reflect the new behavior - Tests pass (
bun run test:all) - Code passes
bun run quality:fix
Technical Specifications
Reference Files
- behaviors/mod.rs:
packages/core/src/behaviors/mod.rs:1609-1619—AiChatNodeBehavior::get_embeddable_content(), the method to change - behaviors/mod.rs:
packages/core/src/behaviors/mod.rs:4479-4482— existing test asserting current (to-be-reversed) embeddability - behaviors/mod.rs:
packages/core/src/behaviors/mod.rs:167—NON_EMBEDDABLE_CONTAINER_TYPESconst, confirmed out of scope for this change
Implementation Details
Follow the ADR-029 pattern used by types that already return None (e.g. task, date, collection per ADR-029's behavior table) — get_embeddable_content() for ai-chat should mirror those, dropping the properties.messages[] extraction entirely rather than extracting and discarding.
Related Issues
- Optimistic updateNode merge doesn't flatten properties.* into top-level fields, causing ai-chat UI to lag behind RPC round-trip #1695 (unrelated — different ai-chat bug in the same node type, optimistic-update reactivity)
Activity
Exclude ai-chat nodes from embedding/vectorization (closes #1696) (#1733
mstomar125 commentedon Jul 24, 2026
✅ Completed — merged in PR #1733
AI-chat conversation nodes are no longer embedded or vectorized.
AiChatNodeBehavior::get_embeddable_content()returnsNoneunconditionally, so conversations never enter the vector index and never surface in semantic search.Changes:
behaviors/mod.rs—get_embeddable_content()→None; doc comments updated; the two obsolete extraction tests consolidated intotest_ai_chat_node_never_embeddable(assertsNonefor rich / empty / tool-only / no-messages shapes); matrix assertion flipped tois_none().embedding_service.rs— flipped the ai-chat assertion intest_behavior_driven_embedding_decision; notedSearchScope::Conversationsis now a no-op atmatches_scope.agent/local_agent/tools.rs+agent/skill_pipeline.rs— removedconversationsfrom thesearch_nodestool schema and the skill guidance, so the model is no longer steered to a scope that returns nothing (surfaced in review). The coreSearchScope::Conversationsenum variant is retained as a documented no-op for API stability.Cargo.lock— drive-by: committed thesha2entry fornodespace-nlp-enginethat Build-time model download (scripts/download-models.ts) skips SHA-256 verification #1715'sCargo.tomlchange left uncommitted (root lockfile wasn't staged), which would have broken--locked/release builds.Docs: ADR-029 revised directly on
nodespace-docsmain — Revision note + per-type table (ai-chat →None) + SearchScope section updated.Notes:
NON_EMBEDDABLE_CONTAINER_TYPESunchanged (ai-chat isn't a container type;can_have_children()isfalse, so the container-parity test is unaffected).Nonetriggers the embedding service's delete-existing-embeddings path on reprocess (greenfield — no migration).Verification:
cargo test -p nodespace-core --lib: 966 passed; agent scope + skill tests green;cargo clippy(core + agent): clean; full pre-push gate green.