One contract.
Several kinds of agentic work.
A guided conversation, a document extraction, and a reviewed answer have different interfaces. They still need prompts, accepted facts, model policy, validation, and inspectable results.
A conversation that follows your business rules.
Collect driver, vehicle, insurance history, and coverage details. Rate the quote in code, then present options, accept changes, and record the chosen tier.
Each stage exposes the tools it needs. Accepted details belong to typed node channels. Named histories control which dialogue carries across stages, while explicit transitions support corrections and handoffs.
Explore the complete walkthroughA customer's details and coverage revisions → validated facts, calculated quote tiers, and an explicit acceptance record. This is a demonstration application with a deterministic example rating engine.
- Schema and domain validation before advancing
- Code-owned rating and confirmation content
- Saved session facts and named histories
A request that returns structured data.
Fetch a configured hotel receipt PDF, attach it to the model's input, and capture itemized expense JSON through a typed tool schema.
The graph declares requiresUserMessage: false and responseMode: "json". The extraction node validates the capture and completes the request. Model configuration and empty-response recovery live in the same graph definition.
return {
llmConfig: ModelCatalog.model("openai:gpt-5.4", {
retries: 3,
reasoningEffort: "medium",
forceToolCalls: true,
}),
requiresUserMessage: false,
responseMode: "json",
llmTimeoutMs: 120_000,
historySpaces: [[ExtractExpenseNode, "expense"]],
// Other graph and recovery settings omitted.
};A configured receipt PDF → validated expense JSON and an inspectable session. Running the demo requires the file configuration and a live vision-capable model provider.
A generated answer with a review policy.
Search a code-owned hotel catalog, draft a grounded presentation, and evaluate it before publishing the answer.
The presentation node saves a draft and moves to a typed decision node. Application code checks the returned judgment and confidence, then publishes the accepted draft or uses a deterministic fallback.
The same separation can be used for reviewed support replies or reports. For nested workers and judges, runNode() returns a typed result; the parent decides what to merge and publish.
Validated hotel criteria and catalog matches → a grounded draft, a typed review decision, and either an accepted presentation or a fallback. Model judgment is an input to application policy.
- Typed decision answers with code-owned routing
- Explicit review and revision policy
- Decision diagnostics in the session document
Start with deterministic evidence.
Clone the example repository and run the scripted conversation suites. They exercise engine turns without model credentials. The documented live scenarios are a separate step with provider and environment configuration.
Read the testing guidegit clone https://github.com/picoflowio/ezgraph-demo.git
cd ezgraph-demo
yarn
yarn test:quote-graph
yarn test:decision-hotel-graphGive your next LangGraph application a consistent foundation.
Run the starter, inspect the session, and decide whether the node contract fits your team.