---
title: "AgentOfCode"
description: "An \"agentic\" LLM solution uses various AI models to iteratively work through Advent of Code problems."
canonical: "https://temporal.io/code-exchange/agent-of-code.md"
source: "https://temporal.io/code-exchange/agent-of-code"
published: "2025-03-08"
authors:
  - "Jason Steving"
languages:
  - "Python"
tags:
  - "Demo"
  - "Machine Learning"
  - "Artificial Intelligence"
  - "Fun"
reviewed_by_temporal: false
community_contribution: true
---

# AgentOfCode

An "agentic" LLM solution uses various AI models to iteratively work through Advent of Code problems.

- [View repo](https://github.com/JasonSteving99/agent-of-code)

AgentOfCode is an "agentic" LLM solution that leverages various Gemini models & Sonnet 3.5 to iteratively work through [Advent of Code](https://adventofcode.com/) problems, committing its incremental progress to Github along the way.

The agent parses the problem HTML, extracts examples, generates unit tests/implementation, and then automatically executes the unit tests. After that, it iteratively "debugs" any errors or test failures by rewriting the unit tests and/or implementation until it comes up with something that passes tests, and then it tries executing the solution over the problem input and submitting to see if it was actually correct.

__Temporal Workflow__

To give you a sense of the agent's debugging process, here's a screenshot of the Temporal workflow implementing the agent that passed day 1's part 1 and 2.
![AgentOfCode Screenshot](https://images.ctfassets.net/0uuz8ydxyd9p/1npQXmd61VX3Hh18A2xXkE/a48c071ea8d0ba86e48cce45a35153e9/AgentOfCode_Screenshot.png)
