A walk-through of the assignment in one notebook plus a small web demo and a standalone loop script.
| File | Purpose |
|---|---|
assignment7.ipynb |
All 5 parts in one notebook. Start here. |
improvement_loop.py |
Part 5, but as a standalone script you can run for real (default: every 15 min). |
memory/ |
Where the research agent (Part 3) writes findings. The reader agent (Part 4) reads from here. |
WRITEUP.md |
The reflection: could you do it all? Why or why not? |
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# then edit .env and put your real Anthropic API keyYou can either put your key in .env, export it in your shell, or paste it into the second cell of the notebook.
jupyter notebook assignment7.ipynbRun cells top-to-bottom. The cells are small and self-contained.
python improvement_loop.py # every 15 min, infinite — Ctrl-C to stop
python improvement_loop.py --interval 15 --max 4 # 4 iterations then exitWhile it's running, a LOOP_RUNNING.flag file exists at the repo root. To stop the loop cleanly from another terminal:
rm LOOP_RUNNING.flagEach iteration appends to IMPROVEMENT_NOTES.md.
- The notebook caps the loop demo at 2 iterations with a 10-second interval so it can't run away.
improvement_loop.pyuses Haiku 4.5 (cheap) and the agent loop has a hard cap of 8 tool calls per iteration.- Web search is limited to 3 calls per task.