The SpatiaLite extension (https://www.gaia-gis.it/fossil/libspatialite/index) handles spatial data and includes indexing. It's solid and we've been using it in production for years. The only real downside I've experienced is that the SpatiaLite-gui browser is a bit flaky.