Skip to content

Add Tool Search advisor for dynamic tool discovery#54

Merged
rdehuyss merged 4 commits intojobrunr:mainfrom
arefbehboudi:feat/tool-search
Apr 15, 2026
Merged

Add Tool Search advisor for dynamic tool discovery#54
rdehuyss merged 4 commits intojobrunr:mainfrom
arefbehboudi:feat/tool-search

Conversation

@arefbehboudi
Copy link
Copy Markdown
Contributor

@arefbehboudi arefbehboudi commented Apr 13, 2026

Adds dynamic tool discovery to JavaClaw using Spring AI’s Tool Search Tool pattern (Lucene-backed). The agent can now search for relevant tools at runtime instead of receiving the full toolset up front. Feature is gated behind javaclaw.tools.dynamic-discovery.enabled.

Changes

  • Add Tool Search Tool + Lucene searcher dependencies
  • Register ToolSearcher + ToolSearchToolCallAdvisor behind a feature flag
  • Wire the Tool Search advisor into the main agent/ChatClient builder (fallback to legacy eager tool exposure when disabled)
  • Add tests for enabled/disabled wiring + Lucene relevance
  • Document configuration and tuning in README

How to enable

javaclaw:
  tools:
    dynamic-discovery:
      enabled: true
      max-results: 8
      lucene-min-score-threshold: 0.25

Closes #49

@cla-bot cla-bot bot added the cla-signed label Apr 13, 2026
@rdehuyss
Copy link
Copy Markdown
Contributor

Awesome idea!

Do you think we should make it the default? It would reduce token costs a lot...

@arefbehboudi
Copy link
Copy Markdown
Contributor Author

Awesome idea!

Do you think we should make it the default? It would reduce token costs a lot...

@rdehuyss Yes, I agree. It is now enabled by default

Copy link
Copy Markdown
Contributor

@rdehuyss rdehuyss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, @arefbehboudi !

@rdehuyss rdehuyss merged commit a3f97e2 into jobrunr:main Apr 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: use tool search tool

2 participants