Skip to content

LangChain

AgentV provides native support for LangChain, allowing you to evaluate chains, agents, and complex RAG workflows.

Expose your LangChain agent via a standard HTTP endpoint or using LangServe.

from langchain.chat_models import ChatOpenAI
from langchain.schema import HumanMessage
from fastapi import FastAPI
chat = ChatOpenAI()
app = FastAPI()
@app.post("/execute_task")
async def execute(request: dict):
# Process turn
result = chat([HumanMessage(content=request["task_description"])])
return {"action": "final_answer", "summary": result.content}

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

Terminal window
agentv run \
--path scenarios/loan_scenario.json \
--protocol langchain \
--agent langchain://localhost:8000/execute_task \
--agent-name "LangChain-Retail-Bot"

If your LangChain agent uses RAG, AgentV can track and visualize Grounding Coverage heatmaps to show which parts of your knowledge base were used to answer specific tasks.

reports/coverage/
# Reports are generated automatically in: