Skip to content

Fix: unify search_semantic params - wire all fields through local agent tool (#1086) - #1099

Closed
malibio wants to merge 2 commits into
mainfrom
feature/issue-1086-unify-search-semantic-params
Closed

malibio wants to merge 2 commits into
mainfrom
feature/issue-1086-unify-search-semantic-params

Conversation

@malibio

@malibio malibio commented Apr 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Wire all SearchSemanticParams fields through exec_search_semantic — no more hardcoded None or SEMANTIC_THRESHOLD overrides
  • Expand def_search_semantic() tool schema to expose all 11 controllable params: threshold, scope, include_archived, node_types, exclude_collections, include_edges, graph_boost (plus existing query, limit, include_markdown, collection)
  • Add node_types and property_filters to SearchSemanticInput in search_ops.rs, delegating to SearchNodeFilters for service-layer filtering
  • property_filters: wired through executor but intentionally excluded from tool schema (too complex for 8B model; documented in code comment and parity test)
  • Add search_semantic_schema_parity_with_params parity test to prevent future drift
  • Update prompt_assembler.rs Tool Strategy Guide with concise param guidance

Test plan

  • cargo test -p nodespace-agent --lib — all 289 unit tests pass including new parity test
  • cargo test -p nodespace-core --lib — all 1163 core unit tests pass
  • bun run test — all 3918 frontend tests pass (baseline: 3918)
  • bun run quality:fix — clean (0 errors, 0 warnings)

Closes #1086

🤖 Generated with Claude Code

malibio and others added 2 commits April 11, 2026 20:47
…nt tool (closes #1086)

Wire all SearchSemanticParams fields through exec_search_semantic and expose
them in the def_search_semantic() tool schema so the LLM can use them:

- threshold: falls back to SEMANTIC_THRESHOLD (0.3) when not provided
- scope: knowledge/conversations/everything enum
- include_archived: include archived nodes in results
- node_types: filter by structural type
- exclude_collections: suppress noisy collections
- include_edges: attach outgoing relationships to results
- graph_boost: re-rank by blending similarity with graph connectivity
- collection_id: forward internal ID form when provided

property_filters is wired through exec_search_semantic but intentionally
omitted from the tool schema (too complex for 8B model; documented in
comment and parity test).

SearchSemanticInput in search_ops.rs gains node_types and property_filters
fields, delegating to SearchNodeFilters for service-layer filtering.

Adds search_semantic_schema_parity_with_params test to prevent future drift:
any new SearchSemanticParams field must be added to the schema or the
exclusion list with a justification comment.

Updates prompt_assembler.rs Tool Strategy Guide with concise param guidance
for the 8B model.

Co-Authored-By: Claude <[email protected]>
…lone

- Remove redundant query.clone() (params.query moved directly into input struct)
- Fix threshold fallback: use unwrap_or(SEMANTIC_THRESHOLD) instead of .or(Some(...))
- Add search_semantic_schema_parity_with_params test to enforce schema completeness
  - Asserts all SearchSemanticParams fields appear in def_search_semantic() schema
    or are documented as intentionally excluded
  - excluded: collection_id (internal form), property_filters (too complex for 8B model)
  - Documents exclusion decisions as code comments alongside the test

Co-Authored-By: Claude <[email protected]>
@malibio

malibio commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by a rebased branch that includes #1085 graph enhancements and fixes collection_id schema exposure. New PR to follow.

@malibio malibio closed this Apr 14, 2026
@malibio
malibio deleted the feature/issue-1086-unify-search-semantic-params branch April 17, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify search_semantic: wire all params through local agent, align tool schema, update prompts

1 participant