AI-driven database querying