# What is a prompt in AI?

> A prompt is the text a person or system gives a language model as input. AI search assistants rewrite prompts into shorter search queries.

Canonical: https://promptlyfound.com/glossary/prompt
Updated: 2026-11-20

## Short answer

A prompt is **the text that a person or a system gives to a language model as input**. It can hold a question, instructions, examples and documents for the model to use. Developers add a system prompt that sets the model's role and rules. In AI search, the assistant often rewrites a user's prompt into shorter queries before it searches the web.

## Key findings

- OpenAI's API gives instructions different levels of authority. Developer messages take priority over user messages, and messages that the model generates have the assistant role. [1]
- Google's prompt design guide for the Gemini API recommends always including few-shot examples, and says prompts without them are likely to be less effective. [2]
- OpenAI says ChatGPT search typically rewrites a user's question into one or more targeted queries that it sends to search providers. [3]
- Anthropic recommends placing long documents above the query and instructions in a prompt. It says queries at the end can improve response quality by up to 30% in tests. [4]

The prompt a person types into ChatGPT is usually not the query its search engine receives. ChatGPT typically rewrites a question into one or more targeted queries, so a page is retrieved for words the site owner never sees.

A prompt is the input that a language model responds to. It can be one question typed into a chat assistant. It can also be a long request that an application builds from instructions, examples, documents and the user's message. The model reads the prompt as tokens and writes its answer from that text and its training.

## What a prompt contains

[OpenAI's prompt engineering guide](https://developers.openai.com/api/docs/guides/prompt-engineering) suggests that a developer prompt has these parts:[1]

- The identity sets the purpose, communication style and goals of the assistant.
- The instructions give the rules the model follows, including what it should never do.
- The examples pair sample inputs with the outputs the developer wants.
- The context adds information the model needs, such as private data or retrieved documents.

OpenAI places context near the end of a prompt, because it often changes from one request to the next. It says that adding relevant context to a request is sometimes called retrieval-augmented generation (RAG).[1] [What is retrieval-augmented generation (RAG)?](https://promptlyfound.com/ai-search/rag) explains how AI search systems add retrieved pages to a prompt.

The order of the parts can change the result. [Anthropic's prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) recommend placing long documents near the top of the prompt, above the query, instructions and examples. Anthropic says queries at the end can improve response quality by up to 30% in tests, especially with several documents.[4]

[Google's prompt design guide](https://ai.google.dev/gemini-api/docs/prompting-strategies) for the Gemini API names several kinds of input. A prompt can ask a question, set a task, give an entity to work on, or give partial text for the model to complete. The guide recommends clear constraints and a stated response format, such as a table or a list.[2]

## System prompts and message roles

Chat models receive a prompt as a list of messages, each with a role. OpenAI's guide names three roles. Developer messages carry the application's rules and take priority over user messages. User messages carry the end user's input, and assistant messages are the ones the model generated.[1]

The developer's instructions are often called the system prompt. Google calls them system instructions. Anthropic says setting a role in the system prompt focuses Claude's behavior and tone, and that even a single sentence makes a difference.[4][2]

## Examples in a prompt

A prompt with no examples is a zero-shot prompt, and one with a few examples is a few-shot prompt. Google recommends always including examples, and says clear examples can replace some instructions.[2] [What is few-shot prompting?](https://promptlyfound.com/glossary/few-shot-prompting) covers how many examples providers recommend and how to format them.

## Prompts in AI search

In AI search, the user's prompt is usually not the text that the search engine receives. [OpenAI's help page on ChatGPT search](https://help.openai.com/en/articles/9237897-chatgpt-search) says ChatGPT typically rewrites a question into one or more targeted queries for its search providers. In OpenAI's example, "What are some good restaurants near me?" becomes "top restaurants San Francisco" for a user in San Francisco.[3]

A page is retrieved for the rewritten queries, which the site owner does not see. [What is query fan-out?](https://promptlyfound.com/ai-search/query-fan-out) describes how one prompt becomes several searches. [What ChatGPT searches for before it answers](https://promptlyfound.com/research/chatgpt-search-queries) shows the queries that ChatGPT wrote in a sample of about 26,000 responses. [How to test AI search visibility with prompts](https://promptlyfound.com/measurement/ai-visibility-prompts) covers how to choose prompts that measure whether AI answers mention a brand.

## Sources

1. Prompt engineering. OpenAI API documentation. https://developers.openai.com/api/docs/guides/prompt-engineering
2. Prompt design strategies. Gemini API documentation. https://ai.google.dev/gemini-api/docs/prompting-strategies
3. Searching the web with ChatGPT. OpenAI Help Center. https://help.openai.com/en/articles/9237897-chatgpt-search
4. Prompting best practices. Claude API documentation. https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices

---

This is a plain-text copy of https://promptlyfound.com/glossary/prompt from Promptly Found. The web page is the canonical version and includes the charts.
