A simple AI agent in less than 100 lines

submited by
Style Pass
2025-01-23 08:30:06

I’ve been building a lot of complex agents at work, and wanted to solidify my understanding — so thought I’d make the simplest barebones agents I could.

All the magic here is in the prompt and context of steps taken. By providing past steps, results, and instructions to terminate if it’s looping or has a good answer -- it actually does a pretty good job!

Maybe due to confusion with Code Interpreter, I actually didn’t fully grasp that the functions were run locally, and that built-in function calling essentially just provides a more robust, structured version of our function-name-check in the non-function calling example.

Leave a Comment