Skip to content

Semantic skill discovery via find_skills tool for 8B model and external agents - #1055

Merged
malibio merged 3 commits into
mainfrom
feature/issue-1051-find-skills-tool
Apr 6, 2026
Merged

malibio merged 3 commits into
mainfrom
feature/issue-1051-find-skills-tool

Conversation

@malibio

@malibio malibio commented Apr 6, 2026

Copy link
Copy Markdown
Collaborator

Closes #1051

@malibio
malibio force-pushed the feature/issue-1051-find-skills-tool branch 2 times, most recently from 367aa45 to dd96765 Compare April 6, 2026 08:54
malibio and others added 3 commits April 6, 2026 11:26
…ternal agents (#1051)

Phase 4 of ADR-030: Exposes find_skills as an explicit agent tool and MCP
handler, supplementing push-based injection with a pull-based mechanism
for models capable of meta-reasoning about capability gaps.

- Implement find_skills as local agent tool (8th tool in GraphToolExecutor)
- Add find_skills MCP handler for external agents (via ACP/MCP)
- Confidence-based routing: >0.8 full skill details, 0.6-0.8 description only, <0.6 excluded
- Telemetry logging: query, results found, skills returned, top score
- Graceful degradation when embedding service unavailable
- Tool is Tier 2 (Discoverable) - found via search_tools, not in default tools/list
- 229 agent tests, 1130 core tests all passing

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

Review findings addressed:
- Extract shared find_skills logic into skill_ops.rs (ops layer pattern)
- Both agent tool exec_find_skills and MCP handler handle_find_skills
  now delegate to the shared skill_ops::find_skills function
- Confidence thresholds defined as named constants in skill_ops
- Increased over-fetch multiplier from 2x to 3x for better skill coverage
- Eliminates ~55 lines of duplicated code between agent and MCP handler

Co-Authored-By: Claude <[email protected]>
Major refactoring of the prompt/skill node architecture:

- PromptAssembler now reads ONLY from graph nodes (no hardcoded base)
- Emergency fallback prompt used only when graph has zero prompt nodes
- All prompt content moved to seed data (core identity, workspace context,
  tool strategy, response rules, tool call format, content safety)
- Seed nodes use UUIDs (Node::new) instead of hardcoded IDs, matching
  the project convention that only schemas and dates use non-UUID IDs
- Seeding checks by source=="built-in" property per node type, not by ID
- NodeService.seed_nodes_if_needed() added for idempotent first-run seeding
- Desktop-app wires seeding after NodeService initialization
- prompt_templates::system_prompt renamed to fallback_system_prompt
- agent_loop uses fallback until wired to PromptAssembler

Co-Authored-By: Claude <[email protected]>
@malibio
malibio force-pushed the feature/issue-1051-find-skills-tool branch from 35f217c to 6812706 Compare April 6, 2026 09:27
@malibio
malibio merged commit 3c63ddb into main Apr 6, 2026
@malibio
malibio deleted the feature/issue-1051-find-skills-tool branch April 6, 2026 09:27
malibio added a commit that referenced this pull request Jun 22, 2026
…al agents (#1055)

* Add semantic skill discovery via find_skills tool for 8B model and external agents (#1051)

Phase 4 of ADR-030: Exposes find_skills as an explicit agent tool and MCP
handler, supplementing push-based injection with a pull-based mechanism
for models capable of meta-reasoning about capability gaps.

- Implement find_skills as local agent tool (8th tool in GraphToolExecutor)
- Add find_skills MCP handler for external agents (via ACP/MCP)
- Confidence-based routing: >0.8 full skill details, 0.6-0.8 description only, <0.6 excluded
- Telemetry logging: query, results found, skills returned, top score
- Graceful degradation when embedding service unavailable
- Tool is Tier 2 (Discoverable) - found via search_tools, not in default tools/list
- 229 agent tests, 1130 core tests all passing

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

* Address PR review: extract skill_ops to eliminate find_skills duplication

Review findings addressed:
- Extract shared find_skills logic into skill_ops.rs (ops layer pattern)
- Both agent tool exec_find_skills and MCP handler handle_find_skills
  now delegate to the shared skill_ops::find_skills function
- Confidence thresholds defined as named constants in skill_ops
- Increased over-fetch multiplier from 2x to 3x for better skill coverage
- Eliminates ~55 lines of duplicated code between agent and MCP handler

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

* Graph-only prompt assembly, UUID seeds, and DB seeding on first run

Major refactoring of the prompt/skill node architecture:

- PromptAssembler now reads ONLY from graph nodes (no hardcoded base)
- Emergency fallback prompt used only when graph has zero prompt nodes
- All prompt content moved to seed data (core identity, workspace context,
  tool strategy, response rules, tool call format, content safety)
- Seed nodes use UUIDs (Node::new) instead of hardcoded IDs, matching
  the project convention that only schemas and dates use non-UUID IDs
- Seeding checks by source=="built-in" property per node type, not by ID
- NodeService.seed_nodes_if_needed() added for idempotent first-run seeding
- Desktop-app wires seeding after NodeService initialization
- prompt_templates::system_prompt renamed to fallback_system_prompt
- agent_loop uses fallback until wired to PromptAssembler

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

---------

Co-authored-by: Claude <[email protected]>
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.

Semantic skill discovery via find_skills tool for 8B model and external agents

1 participant