All projects
FreeIntermediate 60 min pytest -q → 3 passed

Triage Agent: a tool loop with a budget

Search issues, add labels, comment — with a hard step limit and a full trace.

A minimal agent loop you can actually reason about. The model is injected as a plain decide() function, so the control flow is deterministic and testable without an API key. Every action and observation is recorded in a trace, and a step budget stops runaway loops.

README

# Triage Agent — a real agent loop with tools

A small agent that searches issues, adds labels and can comment — with a hard step budget so it can never loop forever. The model is injected as a plain decide() function, which makes the loop testable without an API key.

## Run it

python3 run_demo.py
python3 -m pytest -q     # 3 passed

## What to learn here

  • A tool is a name, a description and a function. Keep tools small and typed.
  • The loop records every action and observation in a trace, so failures are debuggable.
  • max_steps is a safety rail, not an afterthought.
  • The model never executes code directly: it returns a decision, and the loop validates it.
  • For real use, replace scripted_decide with an LLM tool-calling call and persist writes

behind human approval.

MIT licensed.

Files in this download

agent.py

data/issues.json

README.md

requirements.txt

run_demo.py

tests/test_agent.py

tools.py

Push this project to GitHub

Create a repository and upload every file as one commit. Use it for your portfolio, a code review, or your first deploy.

Classic token: tick `repo`. Fine-grained token: give this repository Contents → Read and write and Metadata → Read. Create a token · Fine-grained token

Your token is stored in this tab's sessionStorage and sent only to api.github.com. keepUp AI never receives it.

No GitHub account? The project ZIP works on its own — push later whenever you like.

All projects

Generated from the same content the course teaches. If a lesson changes, its download and tests change with it.