Find and rank similar strings using Levenshtein distance
Find the most similar strings from a list by comparing them to a search term. This is useful for fuzzy matching, finding near-duplicates, or ranking items by syntactic similarity. Like if someone typed in “I want to see Doctor Shallsy” and the Dr’s name is actually “Shellzy”, you could use this skill to find the matching doctor from a list of options.
The similarity search uses Levenshtein distance to measure how similar two strings are. This algorithm calculates the minimum number of single-character edits (insertions, deletions, or substitutions) needed to transform one string into another.
Distance Scoring:
Smart Extraction: When enabled, smart extraction focuses on meaningful parts of text by:
/
)Example: Instead of comparing entire file paths, it extracts just the meaningful filename parts:
"documents/reports/quarterly_sales_report_2024_v2.pdf"
→ "quarterly sales report"
"documents/archive/quarterly_sales_report_2023_final.pdf"
→ "quarterly sales report"
Required:
search term
- The string you want to find matches for
items to search
- Array of strings to search through
Optional:
use smart extraction
- Extract and compare only the most relevant parts of paths (default: false)
exclude patterns
- Patterns to exclude during smart extraction (default: none)
split value
- Character used to split paths when using smart extraction (default: /)
max results
- Maximum number of results to return (default: 5)
The command returns:
Find similar product names from a list
Find similar document names by extracting meaningful parts from file paths, ignoring version numbers and dates
Find similar customer names in a database for deduplication