Previously when building our coding agent, LlamaBot, we made a very simple Agent workflow, as described by this diagram here:

This is an intuitive & simple implementation of a coding agent that can take a user’s initial message, decide if the user wants to write code or not, create a “design plan”, and then write code that gets saved to the file system in order to implement that plan.
I like this approach because it’s simple, straightforward, and easy to understand.
There’s a natural progression of thinking from first principles that arrives at this simple agent workflow. That thought process can be seen in real time, by watching videos 1-16 of building our coding agent from scratch, here: https://www.youtube.com/watch?v=AadSBNKglMM&list=PLjxwvRWwj8anN2aTUhX2P0oKc0ghnhXHQ&pp=gAQB
We use LangGraph because it helps us build more reliable agents. One definition of an agent is allowing the LLM to decide the control flow of our application. By representing our application as a set of nodes and edges, we give the LLM autonomy to decide what code should be executed next.
There’s a fatal flaw of our current implementation: the LLM has limited authority to decide the control flow of our application.

For our current implementation, we are on the far-left of this curve. Our current implementation is essentially just a router.
And this is great, because it’s very reliable and simple.
BUT, if we want to build a more impressive and capable coding agent, we need to give the LLM more autonomy.

Our current agent only writes a single file to our file-system right now, into page.html
.
This is simple, but limited.
What if we wanted our agent to be able to write the styles.css
or script.js
into separate files in our file system?
Under our current paradigm, we would need to add two separate nodes, and 2 additional LLM prompts, and an additional 4 edges to make this workflow work.
New Agent Architecture (ReAct agent architecture)

Leave a Reply