Skip to content

LangGraph sample: what you configure

Aligned with e2e-tests/dragent/langgraph/.

workflow.yaml

Piece What you see
general.front_end._type: dragent_fastapi DRAgent’s HTTP/SSE front end.
llms.datarobot_llm._type: datarobot-llm-component One named LLM; routing follows LLM configuration and env.
workflow._type: langgraph_agent Tells DRAgent to use the LangGraph integration.
workflow.llm_name Must match the key under llms:.
workflow.description / verbose Shown in tooling and logs.

You do not describe the graph in YAML—the Python module supplies it.

myagent.py

This is where the StateGraph, prompt template, and your own tools live. The platform may also pass additional tools (for example MCP): your factory should combine those with yours so the model can call everything listed for the deployment.

Patterns visible in the file:

  • Chat history—included only if the prompt template expects a chat_history variable (see the sample template).
  • Graph factory—receives the LLM, injected tools, and verbosity from the runner so one codebase works locally and on DataRobot.

register.py connects this module to NAT/DRAgent; copy its shape when you add a new agent package.

Human in the loop

The sample myagent.py can include a review node that calls LangGraph’s interrupt() between other nodes (planner → human review → writer). That pattern needs a checkpointer and a stable thread_id across the interrupt and resume requests. See hitl.md to read more about behavior, langgraph_resume, and HITL_E2E_CHECKPOINTER example from e2e-tests.