A basic Python agent built with the Anthropic SDK that processes each user message independently, with no conversation history retained between turns. Each message sent to the model is treated as a fresh conversation — the agent has no memory of prior exchanges.
- Python 3.8+
- An Anthropic API key
- The
anthropicPython package
Install the required package:
pip install anthropicSet your API key as an environment variable:
export ANTHROPIC_API_KEY="your-api-key-here"python chat.pyOnce running, type a message and press Enter to get a response. Type quit to exit.
If you run into any problems or have questions, please file an issue.