← Back to projects

AI Agent Playground (Python + Anthropic)

An exploratory playground for building and testing agent patterns in Python, including tool calling, short-term memory, and local-first secret handling.

AI Agent Playground (Python + Anthropic)

Project Overview

This project is a personal playground to learn AI agent development in pure Python, with a focus on Anthropic models and APIs.

The goal was to understand the basics by building a minimal agent loop, wiring tool calls, and handling conversation state directly in code.

Why I Built It

  • Get comfortable building agents in pure Python.
  • Explore Anthropic model behavior and tool-calling flow.
  • Keep the setup simple so it is easy to modify and experiment with.

What It Includes

  • A lightweight agent loop using Anthropic Messages API.
  • Tool-calling with a calculator example.
  • Short-term conversation memory across turns.
  • Local API key handling via .env.local.
  • A small tool registry in tools/__init__.py.

Playground Direction

This repo is intentionally small so it can be taken further: you can play around from here, add more tools, and test new interaction patterns quickly.

For example, you can add: - greeting tools - formatting/utility tools - domain-specific tools for your own use cases

Notes

Adapted from Leonie Monigatti's article and then customized for learning and experimentation: https://leoniemonigatti.com/blog/ai-agent-from-scratch-in-python.html