Introduction to AI Agents
Adel Nehme
VP of AI Curriculum, DataCamp
Thought | Example |
---|---|
Planning | "To help them move apartments, I'll need to find moving companies, compare prices, check availability for their date" |
Thought | Example |
---|---|
Planning | "To help them move apartments, I'll need to find moving companies, compare prices, check availability for their date" |
Analysis | "Looking at their spending patterns, they're overpaying for subscriptions they rarely use" |
Thought | Example |
---|---|
Planning | "To help them move apartments, I'll need to find moving companies, compare prices, check availability for their date" |
Analysis | "Looking at their spending patterns, they're overpaying for subscriptions they rarely use" |
Decision-making | "Since they need it by tomorrow, I should suggest express shipping despite the extra cost" |
Thought | Example |
---|---|
Planning | "To help them move apartments, I'll need to find moving companies, compare prices, check availability for their date" |
Analysis | "Looking at their spending patterns, they're overpaying for subscriptions they rarely use" |
Decision-making | "Since they need it by tomorrow, I should suggest express shipping despite the extra cost" |
Problem-solving | "To optimize this code, I should first profile it to identify bottlenecks" |
Thought | Example |
---|---|
Memory integration | "They mentioned being lactose intolerant last week, so I'll exclude dairy from these recipe suggestions" |
Thought | Example |
---|---|
Memory integration | "They mentioned being lactose intolerant last week, so I'll exclude dairy from these recipe suggestions" |
Self-reflection | "I was too technical in my explanation - let me simplify this using everyday analogies" |
Thought | Example |
---|---|
Memory integration | "They mentioned being lactose intolerant last week, so I'll exclude dairy from these recipe suggestions" |
Self-reflection | "I was too technical in my explanation - let me simplify this using everyday analogies" |
Goal-setting | "Before planning their workout routine, I need to understand their fitness level and available time" |
Thought | Example |
---|---|
Memory integration | "They mentioned being lactose intolerant last week, so I'll exclude dairy from these recipe suggestions" |
Self-reflection | "I was too technical in my explanation - let me simplify this using everyday analogies" |
Goal-setting | "Before planning their workout routine, I need to understand their fitness level and available time" |
Prioritization | "They should book the flights before the hotel, since flight prices increase faster" |
Chain of thought prompting
[Prompt...]. Think step by step.
Chain of thought prompting
[Prompt...]. Think step by step.
Thought > Action > Observation examples
[Prompt...]. Follow this format:
- Thought: [Think about what to calculate first]
- Action: [Perform calculation]
- Observation: [Result of calculation]
- ...repeat as needed...
- Final Answer: [Complete solution]
$$
Calculate the total cost if I buy 3 laptops at $899 each with a 15% discount and 8% sales tax
$$
$2475.85
Prompt used
Calculate the total cost if I buy 3 laptops at $899 each with a 15% discount and 8% sales tax. Only return the answer.
Prompt used
Calculate the total cost if I buy 3 laptops at $899
each with a 15% discount and 8% sales tax. Think step by step.
Follow this format:
Thought: [Think about what to calculate first]
Action: [Perform calculation]
Observation: [Result of calculation]
...repeat as needed...
Final Answer: [Complete solution]
Example:
Thought: Calculate base cost first
Action: 2 × $50 = $100
Thought: Apply 10% discount
Action: $100 - ($100 × 0.10) = $90
Final Answer: Total is $90
The correct answer $2475.85
ChatGPT answer: $2,776.63
The correct answer $2475.85
ChatGPT answer: $2475.85
ReAct is part of the model's system prompt
System prompt are hidden instructions that tell the model how to behave throughout all conversations.
$$
$$ Example of reasoning models
Introduction to AI Agents