AI Engineering
Learn LLMs, RAG, agents, secure tools, and production AI through practical insurance examples.
State and reducers
State is the structured data shared by graph steps, such as current intent, evidence IDs, and task phase. A reducer specifies how a new update combines with an existing state field. Some fields replace earlier values; others safely combine multiple updates.
Nodes, edges, conditional edges, and routing
A node is a function performing one graph step. An edge describes the next step, while a conditional edge selects from allowed destinations based on state. Routing can use model output, deterministic checks, or both.
Practical TypeScript graph with an approval pause
This is a minimal orchestration demonstration, not an insurance backend. Dependencies are @langchain/langgraph and zod. It uses the documented StateSchema style; older tutorials may use Annotation.Root. Select compatible package versions before adopting…
Checkpoints, persistence, and memory
A checkpoint records execution progress and state at a recovery boundary. Persistence saves it outside the process. Memory is selected information reused by later turns or tasks; a checkpoint is not automatically good long-term user memory.
Interrupts and human review
An interrupt pauses graph execution and exposes a payload for external input. Resumption supplies the requested value. The node containing the interrupt can run again from its beginning on resume, so code before the pause may repeat.
Tool integration and the agent loop in a graph
A graph can separate model decisions, tool execution, and stop checks into different nodes. The model node proposes calls; the tool node uses approved business services. Conditional routing returns to the model only while permitted progress remains.
Subgraphs and multi-agent graphs
A subgraph is a smaller graph used as a component of a larger one. A multi-agent graph assigns model-driven responsibilities to separate nodes or subgraphs. Subgraphs support modularity even when no multi-agent behavior is involved.
Streaming graph events
Graph streaming exposes progress such as state updates, node events, and model token events. It lets a UI distinguish “retrieving,” “waiting for approval,” and “complete.” Stream modes and event APIs vary by version.
Errors, retry logic, and recovery
Error handling distinguishes recoverable infrastructure failures, invalid user input, unsupported model decisions, and business failures. Retry repeats an operation after an appropriate transient failure. Recovery uses persisted progress and reconciliation to…
Production architecture and choosing LangGraph
A production graph sits within an authenticated application, durable execution service, approved tools, checkpoint store, and monitoring system. LangChain supplies components; LangGraph controls stateful execution. A graph can be deterministic, agentic, or…
OpenAI Agents SDK
The OpenAI Agents SDK provides agent-oriented building blocks for model calls, tools, handoffs, and run management. It offers a higher-level agent interface than manually processing each API response. SDK features and provider integration details depend on…
Microsoft Agent Framework: agents and workflows
Microsoft Agent Framework, or MAF, provides agent abstractions and explicit workflows. An agent handles model-driven interaction and tool use; a workflow connects agents and ordinary functions through controlled paths. Microsoft describes it as the successor…
Semantic Kernel and AutoGen
Semantic Kernel is a Microsoft ecosystem for integrating models, plugins/functions, and agent capabilities into applications. AutoGen is known for multi-agent conversation and orchestration abstractions. Their historical APIs remain relevant in existing…
CrewAI and Google ADK
CrewAI organizes agent work around roles, tasks, and orchestration constructs such as flows. Google ADK is an agent development toolkit with agent and workflow-oriented components. Both provide reusable abstractions; neither makes a multi-agent design…
Deterministic workflows
A deterministic workflow follows explicitly coded transitions for given inputs and recorded external outcomes. It can call nondeterministic services, but its orchestration rules remain controlled. It is the natural extension of validation, transactions, and…
Agentic workflows
An agentic workflow allows a model to choose some steps based on observations. The surrounding application limits the actions, resources, and impact of those choices. It is useful for variable tasks but offers less predictable paths and call counts.
Hybrid workflows and state machines
A hybrid workflow combines deterministic control with model-driven interpretation or planning. A state machine defines named states and permitted transitions. The state machine constrains what can happen even when a model proposes something else.
State machines, DAGs, and event-driven workflows
A state machine models valid states and transitions. A DAG, directed acyclic graph, models dependencies without loops. Event-driven workflows react to events such as document.uploaded or review.approved instead of doing all work inside one HTTP request.
Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.