Simon Willison demonstrates how to use SQLite and datasettes to do autocomplete in very little JavaScript. Fast Autocomplete Search for Your Website Code