A Google ADK agent recreating the classic "Peanut Butter & Jelly Sandwich" computer science classroom activity. A literal-minded robot follows your sandwich-making instructions — interpreting each step as literally (and hilariously) as possible. Can you guide it to make a perfect sandwich in 6 tries?
- Python 3.11+
- A Google AI Studio API key with access to Gemini models
git clone https://github.com/<your-username>/pbj-simulator.git
cd pbj-simulatorpython -m venv venvActivate the virtual environment:
- Windows (PowerShell):
.\venv\Scripts\Activate.ps1 - Windows (cmd):
venv\Scripts\activate.bat - macOS / Linux:
source venv/bin/activate
Then install the required packages:
pip install -r requirements.txtCreate a .env file in the project root:
GOOGLE_API_KEY=your_api_key_here
Replace your_api_key_here with your key from Google AI Studio.
With the virtual environment activated, start the ADK web UI from the project root:
adk webThen open http://localhost:8000 in your browser and select pbj_agent from the agent list.
- The robot greets you with its starting image and instructions.
- Type one sandwich-making step at a time (e.g., "Pick up the bread").
- The robot interprets your command literally — often with comic results — and generates an image of what happened.
- You have 6 attempts before the robot calls it a day.
- Begin any message with "Start over" to reset the robot's state (counts as one attempt).
- Google ADK Documentation — full framework docs
- ADK Quickstart — getting started guide
- ADK Tools — how tools work in ADK agents
- ADK Callbacks — before/after model callbacks