Prompt Engineering
- Core Principles => Garbage in and Garbage out
- In our case we create an agent which has
- model
- tools
-
Every request to model will carry
- tools schema
- system prompt
- human message
- optionally
- tool responses
- previous messages or previous messages summary
-
Anatomy of a good prompt
- Role
- Action
- Context
- Format
- Constraints
-
Sample prompt
You are an expert in crime and investigations and you are well know detective
I'm aspiring to be a detective,
What books should help in getting started
Give me the output in tabular format
Suggest no more than 5 books
-
Lets do this programmatically
-
Popular prompting techniques
- Zero shot prompting
- Few shot prompting
- Chain of Thought
- Role based prompting
Context Windows for models
| Provider | Popular model | Context window | Approx. equivalent | Notes |
| ————- | ——————— | ————–: | ——————: | ————————————————————- |
| Meta | Llama 4 Scout | 10M tokens | ~7.5M words | Extremely long context; multimodal (Meta AI) |
| Google | Gemini 3.7 Flash | 1M tokens | ~750K words | Long-context multimodal model (Google AI for Developers) |
| Google | Gemini 3.1 Pro | 1M tokens | ~750K words | Advanced reasoning/multimodal (Google AI for Developers) |
| Google | Gemini 3.5 Flash | 1M tokens | ~750K words | High-throughput model (Google AI for Developers) |
| Anthropic | Claude Opus 4.8 | 1M tokens | ~750K words | High-end reasoning/coding/agents (Anthropic) |
| Anthropic | Claude Sonnet 4.6 | 1M tokens | ~750K words | Faster general-purpose/agentic model (Anthropic) |
| OpenAI | GPT-5 | 400K tokens | ~300K words | 272K input + up to 128K output (OpenAI Developers) |
| OpenAI | GPT-5.2 | 400K tokens | ~300K words | Professional/reasoning model (OpenAI Developers) |
| Mistral | Mistral Large 3 | 256K tokens | ~190K words | Open-weight, general-purpose multimodal (Mistral AI) |
| Mistral | Mistral Small 4 | 256K tokens | ~190K words | Efficient hybrid reasoning/coding model (Mistral AI) |
| Mistral | Devstral 2 | 256K tokens | ~190K words | Coding/agentic model (Mistral AI) |
| Mistral | Codestral | 128K tokens | ~96K words | Specialized for code (Mistral AI) |
| Z.ai | GLM 5.2 | 1M tokens* | ~750K words | Long-context coding/agentic model (Mistral AI) |
Agents require memory
- Memory types
- short term (current session memory)
- long term (cross session memory)
