Home › Learn › AI Agents
AI Agents

What is Few-shot prompting?

Giving the model a few example input/output pairs in the prompt so it learns the pattern you want, without any training.

How it works

Examples communicate format and style far better than description alone. Two to five well-chosen examples usually beat a paragraph of instructions. The tradeoff is they consume context window.

Example

In practiceYou show three examples of 'messy note -> structured JSON' and the model reliably produces that JSON shape for new notes.

How many examples do I need?

Often 2-5 well-chosen ones. More isn't always better — pick diverse examples that cover the cases you care about.

Go deeper: Deploy Your First AI Agent

The complete, step-by-step guide — every command, config, and the reasoning behind it.

Get the guide