David Kimura PRO said about 3 years ago on Autocomplete with StimulusJS :
Basically, You would need to add this code as if it were one of your own stimulus controllers and give it a proper file name so that it works with your existing code which invokes the controller. You would also need to add lodash.debounce via yarn.

https://github.com/afcapel/stimulus-autocomplete/blob/master/src/autocomplete.mjs