AI-generated pipelines accumulate slop code. Building larger systems with AI is a challenge. They hide state, silence bugs, and cheat to pass tests.
My approach is a layered architecture. I subdivide my code into layers with clean API-first designs. Each layer defines its inputs, outputs, and process in pseudocode. The full solution is easy to understand because it is a graph.
What I Built
Social Media Pipeline
I built a social publishing pipeline around Gamma chart. In my initial draft, I fed raw data directly into the AI, which produced poor results. A non-linear graph really helps with analysis writing, which often requires consideration of multiple sources. I can add judgment nodes for fact-checking to catch errors before they are posted.
Json Data -> Extract Facts -> Sort and Filter Facts -> Add Voice -> Publish
Mechanics of Graph Engineering
Graph engineering decomposes complex systems into discrete processing nodes connected by explicit, typed data edges. Each node performs a single transformation. Each edge carries state. Execution flows from node to node, and if something is wrong, I can click on a node to observe and review its I/O.
Visual editors like ComfyUI, Unity Shader Graph, and Unreal's Blueprints have used node-based execution for years. Applying this pattern to AI systems turns observability into a structural safeguard against output degradation.
The Rules
Graph engineering succeeds when you constrain the system along three axes.
1. Limit your primitives. Restrict what can flow across an edge. Unix restricted I/O to string streams passed through pipes, making components reusable across arbitrary pipelines. When edges carry only a few well-defined types, nodes become interchangeable.
2. Abstract your processes. Write nodes to operate on primitive types rather than domain-specific structures. I scaled an MVVM architecture by giving technical artists visual binders that connected exclusively to primitives. The artists daisy-chained those primitive binders into complex animations. Strict constraints forced creative compositions.
3. Observe every edge. Graph architectures make observability native rather than additive. Instead of parsing separate log files, you inspect edge states directly. Placing judgment nodes between action nodes creates self-correcting feedback loops that score downstream results.
Restrict edge types, standardize node boundaries, and compose nodes into predictable systems.
4. Right Model, Right Job
Reserve frontier models for nodes requiring deep reasoning.
Stripping whitespace from JSON requires execution speed, while risk analysis demands cognitive depth.
I used this approach in Making Small Models Scale: delegating work downward to smaller models until output degrades, then promoting it back up. That strategy cuts token spend tenfold without sacrificing output quality.
Graph Workflow Patterns
The graph acts as a simple map that lets the system customize its work. It breaks tasks into clear steps, shows how those steps connect, and sets checks to score and improve results.
Anthropic's new workflows in Claude Code use this design. The system builds its own step-by-step process as it runs. It creates smaller helper tasks, sends work to the right place, and checks its own answers by breaking tasks into smaller pieces, testing for mistakes, and comparing different options. Instead of just holding instructions in memory, the plan turns into running code that builds itself.
All views are my own, and I do not represent any employer. All ownership of attached open source code is waived.
