Skip to content

Repository files navigation

Assignment 7 — ChatBot, Tools, Memory, and a Self-Improvement Loop

A walk-through of the assignment in one notebook plus a small web demo and a standalone loop script.

What's here

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?

Setup

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 key

You can either put your key in .env, export it in your shell, or paste it into the second cell of the notebook.

Run the notebook

jupyter notebook assignment7.ipynb

Run cells top-to-bottom. The cells are small and self-contained.

Run the 15-minute improvement loop

python improvement_loop.py                  # every 15 min, infinite — Ctrl-C to stop
python improvement_loop.py --interval 15 --max 4    # 4 iterations then exit

While it's running, a LOOP_RUNNING.flag file exists at the repo root. To stop the loop cleanly from another terminal:

rm LOOP_RUNNING.flag

Each iteration appends to IMPROVEMENT_NOTES.md.

Stopping cost / safety notes

  • The notebook caps the loop demo at 2 iterations with a 10-second interval so it can't run away.
  • improvement_loop.py uses 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.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages