Context Engineering: What to Keep From Chat History
I cut my chat to the last three turns and the model forgot all five facts.
Video #39 ยท AI agents and MCP
Steps in the video
Files
- chat.py (30 lines)
- compare.py (24 lines)
- strategies.py (35 lines)
Tested with
Python 3.12.15 | ollama==0.6.3
What this does not show
A made-up ten turn chat, one run, one small local model, five questions I wrote, scored by whether the reply contains a word. The summary is capped at 80 tokens and I did not check whether the cap or the model dropped the two facts. Ten turns is tiny, so this says nothing about long chats. Timings are from one laptop.
Sources
Learning IT by Example.