When executing the pgx_similarity_search function, you must grant the executing user function privileges that exist in the ai schema.
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA ai TO <user>;