learning-it by example

Back to the video

Plan, Act, Reflect: Does It Help a Small Model?

One example in the prompt took a small model from 2 of 6 to 6 of 6. Reflection added nothing.

Video #26 ยท AI agents and MCP

Steps in the video

  1. 0:00 Can a small model plan
  2. 0:33 The idea
  3. 1:08 Setup
  4. 1:25 Two tools
  5. 1:49 A plan is data
  6. 2:06 Asking for a plan
  7. 2:24 Two ways to reflect
  8. 2:49 Five ways
  9. 4:01 What this does not show
  10. 4:32 Mistakes to avoid
  11. 4:51 My take and next steps
  12. 5:19 Recap

Files

  • agent.py (86 lines)
  • compare.py (43 lines)
  • tasks.py (9 lines)
  • tools.py (27 lines)

Download the code (zip)

Tested with

Python 3.12.15 | ollama==0.6.3, pydantic==2.14.1

What this does not show

Six made up shopping questions, one worked example that looks like them, one small model (llama3.2), one run at temperature zero. No larger model and no tool-choosing loop was tested.

Sources

Learning IT by Example.