Skip to content

LangGraph (v2)

AgentV provides native support for LangGraph, allowing you to evaluate state-aware agentic graphs and loops.

Expose your LangGraph agent via a standard HTTP endpoint.

from langgraph.graph import StateGraph
from fastapi import FastAPI
app = FastAPI()
# ... (your graph definition) ...
@app.post("/execute_task")
async def execute(request: dict):
# Process turn with state
state = {"input": request["task_description"]}
result = graph.invoke(state)
return {"action": "final_answer", "summary": result["output"]}

Use the langgraph protocol to connect the harness to your agent service.

Terminal window
agentv run \
--path scenarios/loan_scenario.json \
--protocol langgraph \
--agent langgraph://localhost:8000/execute_task \
--agent-name "LangGraph-Fintech-Orchestrator"

The langgraph:// protocol is optimized for the Visual Debugger. It captures the internal state transitions between graph nodes and visualizes them as atomic events in the trajectory map.

Terminal window
# Launch the console to see the graph transitions
agentv console