Context
The AutoCorrectionPolicy in ToolNotFoundPolicy currently uses a simple fuzzy matching algorithm (case-insensitive containment + token-based matching on _/- delimited segments) to suggest corrections when the LLM hallucinates a tool name.
Suggestion
Evaluate whether a dedicated fuzzy matching library (e.g. fuzzywuzzy, or similar) would improve match quality over the current approach.
Considerations
- The current algorithm handles known hallucination patterns (e.g.
ragbot_vectorSearch → vectorSearch)
- A library may handle edge cases better (edit distance, partial ratio matching)
- Tradeoff: additional dependency vs marginal improvement for a small input space (tool names)
Raised during review of #1478.
Context
The
AutoCorrectionPolicyinToolNotFoundPolicycurrently uses a simple fuzzy matching algorithm (case-insensitive containment + token-based matching on_/-delimited segments) to suggest corrections when the LLM hallucinates a tool name.Suggestion
Evaluate whether a dedicated fuzzy matching library (e.g. fuzzywuzzy, or similar) would improve match quality over the current approach.
Considerations
ragbot_vectorSearch→vectorSearch)Raised during review of #1478.