Simplifying LangGraph
This is one of those projects that started as a simple idea, and then grew into something bigger.
It started with langgraph. The concepts made sense, but there were some areas of the implementation that were too complicated for me.
The real source of the complication is that langgraph and langchain are very flexible. This is great when you need it.
But what I wanted were some pre-built architectures, that sort of follow a formula, where I can change the pieces I want without having to design the architecture.
Areas I wish were simpler
-
Conditional Edges
I wanted was to attach conditions to the edges, boolean functions that take the graph state, and return
True
if the graph execution should continue down an edge.To me, this is a natural way to make a conditional edge.
-
Visualizing the Graph
Since these are graphs, I wanted to design visually.
Langgraph Studio has very nice graph visualizations. The problem with these is that you have to write builder code and its dependencies BEFORE you can see the graph.
-
Knowing what functions to write
Once you have your graph designed, it would be good to know what functions are needed.
With the text representation, it is easy to see which functions are needed, and know what their signature is.
-
Testing the Graph
During development, I continually call models with exactly the same input. It’s totally avoidable, but I’d like to be able to avoid it without changing code.
-
Evaluating the graph
If test areas are deterministic (see #4), evaluations can be limited to much smaller areas like a single prompt or node.
-
Embedding monitors and debuggers in the graph
If we graph is generated, it is possible to inject human or monitor software around models.
The experimental code for the first three is here, most of the examples are taken from langgraph documentation.
Since this changes every day, here’s what it looks like today: