A ReAct agent that solves questions using tool calls.
-
Install uv if you don't have it.
-
Copy
.env.exampleto.envand add your API key:cp .env.example .env
Then edit
.envand replaceyour-key-herewith your key from Google AI Studio.To use a different provider, change the
MODELvariable inagent.pyand set the matching key in.env. -
Make sure
.envis in your.gitignoreso you don't commit your key.
uv run agent.pyuv will install dependencies automatically on first run.
The agent will work through each question in math_questions.md and print the ReAct trace (Reason / Act / Result) for each one.
agent.py- the ReAct agent (this is the file you'll modify)calculator.py- calculator toolproducts.json- product catalog with pricesmath_questions.md- the questions the agent solves.env.example- template for your API key