AGNTCourse

Agentic AI / AI agents

Lessons7modules
Total65mfull study
Quick7mtrailer
Projects7docker labs

hello-agent

Minimal ReAct loop in 80 LOC. One tool. Writes a file, exits clean.

snap/agentic-ai:helloRepo · agentic-ai-hello
$git clonehttps://github.com/snap-dev/agentic-ai-hello.git
docker-compose.yml
# docker-compose.yml — hello-agent
services:
  agent:
    image: python:3.11-slim
    working_dir: /app
    volumes:
      - ./src:/app/src:ro
      - ./out:/app/out
      - ./requirements.txt:/app/requirements.txt:ro
    environment:
      OPENAI_API_KEY: ${OPENAI_API_KEY:?set OPENAI_API_KEY in your shell}
      MODEL: gpt-4o-mini
      MAX_STEPS: "6"
    command: >-
      bash -c "pip install -q -r requirements.txt &&
               python -m src.agent --task 'Write hello.txt with the current UTC timestamp.'"
Run
~/agentic-ai-hello · zsh
$ docker compose up --abort-on-container-exit
[step 1] tool_call: write_file(path='out/hello.txt', body='2026-04-28T...Z')\n[step 2] tool_result: ok\n[step 3] FINAL: wrote out/hello.txt
What you'll observe
Container exits with code 0 within 30 seconds
File out/hello.txt exists on host filesystem
out/hello.txt contains an ISO-8601 UTC timestamp string
stdout contains the line FINAL: wrote out/hello.txt
stdout contains exactly one tool_call: write_file line
Lift this to your work

Drop this skeleton into any internal one-off automation: a nightly script that writes a CSV from your warehouse, a release-note generator that writes RELEASE.md from the merged PR titles, a runbook bot that drops an incident summary into shared/incidents/<id>.md. Replace the write_file tool with whatever side effect you actually want (Slack post, Jira create, S3 put). The loop, the step counter, the FINAL guard — all stay. We use this exact shape at Snap to back our 'fill out the weekly metrics doc' bot.