Graph Engineering Explained: Nodes, Edges, and State for AI Agent Workflows
Bashiri Smith · Facebook reel · 2026-10-03 · 1:10 · 4,738 views · Open on Facebook
Topics: AI Agents, Tool Use & MCP, AI System Design & Architecture · Level: intermediate
Summary
The reel explains "graph engineering," which builds on prompt and loop engineering. Instead of prompting a model again and again by hand, you put the steps and decisions into a workflow graph that the system runs: AI writes code, tests run, failures go back for another try, and passing work waits for human approval. It covers the core ideas (nodes, edges, state), parallel branches and loops, and two warnings: put a limit on retries, and don't force every task into a rigid workflow.
Key points
- Prompting: you ask the AI to write code, check it yourself, and ask again. Loop engineering: the system does the work, checks the result, and retries on its own. Graph engineering: you design how those loops connect to the rest of the workflow.
- Example workflow: AI writes code, then tests run, then failed tests send the code back for another attempt, and when everything passes the workflow pauses for human approval.
- Nodes are the steps. A node can run regular code, call an LLM, or run a whole agent.
- Edges are the connections that decide which step runs next. State is the information passed through the workflow, such as the code and test results.
- Graphs can include loops, branches into different paths, and parallel work. For example, a front-end agent and a back-end agent work at the same time, their changes are merged for testing, and failures go back to the right agent.
- It is basically a flowchart your system actually runs. You decide where the AI gets flexibility and where fixed rules apply.
- Watch out 1: put a limit on retries so a task that keeps failing doesn't keep burning tokens.
- Watch out 2: don't force every task into a rigid workflow. Sometimes an agent needs room to work out the steps itself.
Resources mentioned
- Peter Steinberger (@steipete) · person · x.com · free · recommended by both Bashiri Smith & Melvin Vivas
The creator of OpenClaw. His tweet about moving from loops to graphs started the 'graph engineering' discussion.
Also in: CodexBar: Track Your Codex Usage Limits from the Mac Menu Bar (Melvin Vivas on X · notes), Track your Codex usage limits with CodexBar (Melvin Vivas on X · notes), Ollama Is Now an Official Provider for OpenClaw (Melvin Vivas on X · notes) - OpenClaw · tool · github.com · free · recommended by both Bashiri Smith & Melvin Vivas
Popular open-source personal AI agent project that showed strong consumer demand for agents.
Also in: Grok Bot vs OpenAI in the consumer AI agent market (Melvin Vivas on X · notes), Why Simpler Agent Bots Appeal to Non-Technical Users (Melvin Vivas on X · notes), Coworker: A Desktop AI Assistant App, Not a Coding Agent (Melvin Vivas on X · notes), Grok Bot's Real Competitors: OpenClaw and Hermes (Melvin Vivas on X · notes) and 9 more - LangGraph · tool · langchain.com · free
Graph-based agent framework with typed state, checkpointing, cycles and human-in-the-loop interrupts. The guide calls it the production default for complex stateful agents.
Also in: Basic vs Production AI Engineering: RAG, Agents, and Context over Prompts (Bashiri Smith on Facebook · notes), The 3 AI Engineering Skills: Generative AI, RAG, and Agentic AI (Bashiri Smith on Facebook · notes), Step-by-Step Roadmap to a $200K+ AI Engineering Role (Bashiri Smith on Facebook · notes), LangChain vs. LangGraph Explained with One RAG Chatbot (Bashiri Smith on Facebook · notes) and 5 more - LangChain · tool · github.com · free · recommended by both Bashiri Smith & Melvin Vivas
Named in the prompt as a beginner-friendly but powerful AI framework for building AI-powered projects.
Also in: The 5 Levels of RAG: From Naive Retrieval to Agentic RAG (Bashiri Smith on Facebook · notes), Find Hidden AI Engineering Jobs by Searching for Skills, Not Job Titles (Bashiri Smith on Facebook · notes), SWE-to-AI Engineer Plan for 2027: LLMs, RAG, Agents, Evals, Job Search (Bashiri Smith on Facebook · notes), Basic RAG Pipeline in 60 Seconds: From Documents to Grounded Answers (Bashiri Smith on Facebook · notes) and 6 more
From the PDF shared here: Agentic design patterns: The AI engineer's field guide to designing, building, and deploying agents (2026 edition)
Open the original · 48 pages
Bashiri Smith (BASWE) wrote this 48-page field guide for software engineers moving into AI engineering. It covers what an agent is, five core patterns (ReAct, planning, reflection, routing and supervisor-worker), 20 more workflow, reasoning, coordination, control and knowledge patterns, and how to design agents (context engineering, tool design, state, MCP/A2A and frameworks). It then covers evaluating agents (eval stack, LLM-as-judge, metrics, tracing) and deploying them (runtime, reliability, security, cost, rollout). It ends with a reference architecture, a production checklist, 12 interview questions and five portfolio projects. Read Parts 1–2 in order, do each build exercise, or pick one of the three reading paths (one evening, one week, one month).
- Model Context Protocol (MCP) · docs · modelcontextprotocol.io · free · recommended by both Bashiri Smith & Melvin Vivas
Open standard for connecting models to tools and data sources through one interface. It turns an N×M integration problem into N+M.
Also in: Extend Grok Bot with Your Own MCP Servers and Connectors (Melvin Vivas on X · notes), AI Engineer Vocab Quiz: 11 Acronyms to Know for Interviews (Bashiri Smith on Facebook · notes), The 3 AI Engineering Skills: Generative AI, RAG, and Agentic AI (Bashiri Smith on Facebook · notes), xAI's Experimental TypeScript SDK: Grok Text, Voice, Image and Video in One SDK (Melvin Vivas on X · notes) and 12 more - LangGraph · tool · langchain.com · free
Graph-based agent framework with typed state, checkpointing, cycles and human-in-the-loop interrupts. The guide calls it the production default for complex stateful agents.
Also in: Basic vs Production AI Engineering: RAG, Agents, and Context over Prompts (Bashiri Smith on Facebook · notes), The 3 AI Engineering Skills: Generative AI, RAG, and Agentic AI (Bashiri Smith on Facebook · notes), Step-by-Step Roadmap to a $200K+ AI Engineering Role (Bashiri Smith on Facebook · notes), LangChain vs. LangGraph Explained with One RAG Chatbot (Bashiri Smith on Facebook · notes) and 5 more - Langfuse · tool · langfuse.com · free
Purpose-built tool for viewing traces, running evals and managing prompts.
Also in: Step-by-Step Roadmap to a $200K+ AI Engineering Role (Bashiri Smith on Facebook · notes), 7 Habits to Become an AI Engineer: Books, Tooling, Research & Shipping (Bashiri Smith on Facebook · notes), Taking a RAG App to Production: Evals, Guardrails, Cost and Tracing (Bashiri Smith on Facebook · notes) - LangSmith · tool · docs.smith.langchain.com · free
Purpose-built tool for viewing traces, running evals and managing prompts.
Also in: Step-by-Step Roadmap to a $200K+ AI Engineering Role (Bashiri Smith on Facebook · notes), 7 Habits to Become an AI Engineer: Books, Tooling, Research & Shipping (Bashiri Smith on Facebook · notes) - CrewAI · tool · crewai.com · free
Framework for role-based multi-agent teams. The guide calls it the fastest prototyping path; it supports MCP and A2A.
Also in: The 3 AI Engineering Skills: Generative AI, RAG, and Agentic AI (Bashiri Smith on Facebook · notes), 8-Week Roadmap to a $200K+ AI Engineering Role (Bashiri Smith on Facebook · notes) - OpenTelemetry · tool · opentelemetry.io · free
Vendor-neutral tracing standard. The guide recommends it, with its GenAI semantic conventions, as the base layer for agent observability.
Also in: Prompt Claude to Plan 3 Production-Grade AI Portfolio Projects (Bashiri Smith on Facebook · notes), 7 Habits to Become an AI Engineer: Books, Tooling, Research & Shipping (Bashiri Smith on Facebook · notes) - Arize Phoenix · tool · github.com · free
Purpose-built tool for viewing traces, running evals and managing prompts. - Braintrust · tool · braintrust.dev · free
Purpose-built tool for viewing traces, running evals and managing prompts. - Claude Agent SDK · tool · github.com · free · recommended by both Bashiri Smith & Melvin Vivas
Anthropic's SDK for agents that work with files, commands, code and MCP tools, using the same loop that powers Claude Code. Subagents and hooks are built in.
Also in: Claude Plans Get Monthly Credit for Agent SDK and claude -p (Melvin Vivas on X · notes) - OpenAI Agents SDK · tool · github.com · free
OpenAI framework that provides agents, handoffs, guardrails, sessions and tracing with minimal code.
Also in: The 3 AI Engineering Skills: Generative AI, RAG, and Agentic AI (Bashiri Smith on Facebook · notes) - pytest · tool · docs.pytest.org · free
Python's most used test framework: plain assert statements, fixtures and a simple test runner.
Also in: Prompt Claude to Plan 3 Production-Grade AI Portfolio Projects (Bashiri Smith on Facebook · notes) - ReAct: Synergizing Reasoning and Acting in Language Models · paper · arxiv.org · free
The original ReAct paper behind the tool-use reason-act-observe loop.
Also in: 17-Step AI Engineer Roadmap: From Basic RAG to Agents, Evals, LLMOps & Governance (Bashiri Smith on Facebook · notes) - smolagents · docs · huggingface.co · free
Small Hugging Face library for code-as-action agents. It requires a real sandbox. - Vercel AI SDK · tool · ai-sdk.dev · free · recommended by both Bashiri Smith & Melvin Vivas
TypeScript SDK for adding AI and agent features to web products.
Also in: Swapping AI SDK for pi-ai as the LLM provider layer (Melvin Vivas on X · notes) - Weights & Biases Weave · tool · github.com · free
Purpose-built tool for viewing traces, running evals and managing prompts. - A2A (Agent2Agent) protocol · docs · github.com · free
Linux Foundation agent-to-agent protocol that standardizes how agents built on different frameworks find each other and exchange tasks. - Building effective agents (Anthropic engineering) · article · anthropic.com · free
Anthropic article that separates workflows from agents and describes core agent patterns such as prompt chaining, routing, orchestrator-workers and evaluator-optimizer. - Effective context engineering for AI agents (Anthropic engineering) · article · anthropic.com · free
Anthropic's guidance on context engineering, which treats context as a finite resource with diminishing returns. The guide says it is worth reading in full. - Executable Code Actions Elicit Better LLM Agents (CodeAct, Wang et al., 2024) · paper · arxiv.org · free
The CodeAct paper: agents write and run programs as their actions instead of making one JSON tool call at a time. - Google ADK (Agent Development Kit) · tool · google.github.io · free
Google framework for multi-agent hierarchies, with native A2A support, Python, Java and Go, and deployment on Google Cloud. - How we built our multi-agent research system (Anthropic engineering) · article · anthropic.com · free
Anthropic's write-up of its multi-agent research system, including token-usage findings (agents use about 4x and multi-agent systems about 15x the tokens of chat). - Language Agent Tree Search (Zhou et al., 2023) · paper · arxiv.org · free
LATS paper, which applies Monte Carlo tree search to full agent trajectories with tool calls. - Mastra · tool · mastra.ai · free
TypeScript agent framework for web products that add agent features. - Microsoft Agent Framework · tool · github.com · free
Successor to AutoGen and Semantic Kernel, for .NET and Python teams on Azure. - Pydantic AI · tool · ai.pydantic.dev · free
Python framework for type-safe single agents with structured outputs and minimal abstraction. - Reflexion: Language Agents with Verbal Reinforcement Learning (Shinn et al., 2023) · paper · arxiv.org · free
Paper on agents that write verbal reflections after failed attempts and use them to improve without weight updates. - ReWOO: Decoupling Reasoning from Observations (Xu et al., 2023) · paper · arxiv.org · free
Paper on planning every tool call up front, with placeholders for results, to cut token usage sharply. - Temporal · tool · temporal.io · free
Durable execution engine for long-running agent runs, with checkpointing, resume and human-input pauses. - The lethal trifecta for AI agents (Simon Willison, 2025) · article · simonwillison.net · free
Simon Willison's security model: an agent with private data, untrusted content and external communication can be turned into a data-exfiltration tool. - Tree of Thoughts (Yao et al., 2023) · paper · arxiv.org · free
Paper on generating, evaluating and searching over several candidate reasoning steps, with backtracking. - Writing tools for agents (Anthropic engineering) · article · anthropic.com · free
Anthropic article on designing and testing tools that agents can use well.
Try this
- Save the video if you're building AI agents.
- Comment 'graph' to get the creator's breakdown of the five most common agentic design patterns asked about in AI engineering interviews.
- Read the LangChain/LangGraph team's breakdown of graph engineering.
- Put a limit on retries in any agent loop.
- Decide which steps need fixed rules and which should leave the agent free to choose its own steps.
- Build a coding workflow graph: an LLM writes code, tests run, failures loop back with a retry limit, and passing code pauses for human approval.
- Build a parallel multi-agent graph: front-end and back-end agents work at the same time, their changes are merged for testing, and failures go back to the right agent.
More in AI Agents, Tool Use & MCP
- Coworker: open-source desktop app for AI agents with local models
- Grok Bot template: daily business-ideas agent
- Agent Harness Matters: Hugging Face's Open Guide to Multi-Harness RL
- An agent bot that installs and drives Codex on its own
- Asking a Coder bot to install Codex
- Organizing Grok Bot Lead Collection in One Google Sheet