LangGraph + Ertas
Build production agents with LangGraph — the graph-based orchestration framework with audit trails, checkpoints, and stateful workflows, fully compatible with Ertas-trained local models.
Overview
LangGraph is the production-tier successor to LangChain agents, designed specifically for the operational requirements of running agents in production: explicit state machines, durable checkpoints, audit trails, and human-in-the-loop interruption points. Where LangChain's older agent abstractions used implicit ReAct-style loops, LangGraph requires you to define the agent as a directed graph of states and transitions — an upfront cost that pays back in dramatically improved debuggability, recoverability, and reliability under production conditions. By early 2026, LangGraph passed CrewAI in GitHub stars and is now the dominant production agent framework in the Python ecosystem.
The graph-based design enables capabilities that flat agent loops can't easily provide: parallel branch execution with structured aggregation, conditional routing based on intermediate state, durable checkpoints that allow agents to pause and resume across hours or days, and rollback points that let you replay an agent run from any state. For enterprise deployments where agents need to handle long-running workflows, integrate with human approval steps, or recover from infrastructure failures, LangGraph is increasingly the default choice over the simpler alternatives.
How Ertas Integrates
Ertas-trained models work with LangGraph through the same provider interface as LangChain — the two frameworks share their underlying LLM abstraction. After fine-tuning your model in Ertas Studio and deploying to an OpenAI-compatible endpoint (Ollama, vLLM, or Ertas Cloud), you configure a LangChain ChatOpenAI or ChatOllama instance pointed at your endpoint, then pass that LLM to your LangGraph nodes. Every node that calls the LLM uses your Ertas-trained model, and LangGraph's orchestration features (checkpoints, branches, human-in-the-loop) work transparently regardless of which model is behind the LLM interface.
For production deployments, the LangGraph + Ertas combination addresses two concerns simultaneously. LangGraph handles the operational concerns: workflow durability, audit logging, and reliability. Ertas handles the quality concerns: domain-specific model specialization for substantially better task performance than general models can deliver. The result is agents that are both well-engineered (durable, debuggable, recoverable) and well-trained (domain-specialized, accurate, fast). For teams building agents in regulated industries — healthcare, finance, legal — this combination is particularly compelling because LangGraph's audit capabilities and Ertas's on-premise deployment together meet most compliance requirements without compromise.
Getting Started
- 1
Fine-tune a domain model in Ertas Studio
Train a model that captures your domain expertise. For LangGraph workflows specifically, training data with explicit reasoning steps and tool-use traces produces the best results.
- 2
Deploy to an OpenAI-compatible endpoint
Export to GGUF and serve via Ollama, vLLM, or Ertas Cloud. LangGraph calls any standard chat-completion endpoint via the LangChain provider abstraction.
- 3
Install LangGraph and configure your LLM
Install langgraph and a LangChain provider package (langchain-openai or langchain-ollama). Create an LLM instance pointed at your Ertas inference endpoint.
- 4
Define your agent as a graph
Model your workflow as a directed graph: nodes for each step, edges for transitions, and conditional logic for routing. Add checkpoints for durable state and human-in-the-loop interruptions where needed.
- 5
Deploy with LangGraph Cloud or self-hosted
Deploy your graph to LangGraph Cloud for managed orchestration, or self-host using LangGraph Server. Both options work with self-hosted Ertas inference.
from typing import TypedDict, Literal
from langchain_openai import ChatOpenAI
from langgraph.graph import StateGraph, END
from langgraph.checkpoint.memory import MemorySaver
# Point LangGraph at your Ertas-trained model
llm = ChatOpenAI(
base_url="http://localhost:11434/v1",
model="ertas-claims-adjuster-14b",
api_key="not-needed",
temperature=0.1,
)
class ClaimState(TypedDict):
claim_id: str
claim_data: dict
classification: str
requires_review: bool
decision: str
def classify(state: ClaimState):
response = llm.invoke(f"Classify this claim: {state['claim_data']}")
return {"classification": response.content}
def route(state: ClaimState) -> Literal["auto_approve", "human_review"]:
return "human_review" if state["requires_review"] else "auto_approve"
# Build the graph
graph = StateGraph(ClaimState)
graph.add_node("classify", classify)
graph.add_node("auto_approve", lambda s: {"decision": "approved"})
graph.add_node("human_review", lambda s: {"decision": "pending_review"})
graph.set_entry_point("classify")
graph.add_conditional_edges("classify", route, {
"auto_approve": "auto_approve",
"human_review": "human_review",
})
graph.add_edge("auto_approve", END)
graph.add_edge("human_review", END)
# Compile with persistent checkpointing
app = graph.compile(checkpointer=MemorySaver())
# Run with full audit trail
result = app.invoke(
{"claim_id": "C-12345", "claim_data": {...}},
config={"configurable": {"thread_id": "claim-12345"}},
)Benefits
- Explicit state machines deliver dramatically better debuggability than implicit agent loops
- Durable checkpoints — agents can pause and resume across hours, days, or infrastructure failures
- Audit trails for every state transition support compliance in regulated industries
- Human-in-the-loop interruption points handle approval workflows naturally
- Parallel branch execution with structured result aggregation
- Combine LangGraph orchestration with Ertas domain specialization for production-grade agents
Related Resources
Fine-Tuning
GGUF
Inference
LoRA
Getting Started with Ertas: Fine-Tune and Deploy Custom AI Models
Fine-Tune AI Models Without Writing Code
Running AI Models Locally: The Complete Guide to Local LLM Inference
Privacy-Conscious AI Development: Fine-Tune in the Cloud, Run on Your Terms
AutoGen
CrewAI
LangChain
Ollama
vLLM
Ertas for Healthcare
Ertas for Customer Support
Ertas for Legal
Ertas for AI Automation Agencies
Ship AI that runs on your users' devices.
Early bird pricing starts at $14.50/mo — locked in for life. Plans for builders and agencies.