A query is a request for information sent to a database, search index, or another information source, phrased in a way the receiving system can interpret and act on. In its simplest form, it can be a structured command like a SQL statement asking a database for specific rows; in an AI context, it more often refers to the question or prompt a user sends, which the underlying system uses to retrieve relevant data before formulating a response.
Many modern AI assistants combine a language model with a retrieval step: the user's input is first treated as a query against a knowledge base or document store, the most relevant matches are pulled back, and the model then uses those results, alongside its own training, to generate an answer grounded in that retrieved information rather than relying purely on what it memorized during training.
