LangChain
AgentV provides native support for LangChain, allowing you to evaluate chains, agents, and complex RAG workflows.
1. Setup Your Agent API
Section titled “1. Setup Your Agent API”Expose your LangChain agent via a standard HTTP endpoint or using LangServe.
from langchain.chat_models import ChatOpenAIfrom langchain.schema import HumanMessagefrom 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}2. Run Evaluation
Section titled “2. Run Evaluation”Use the langchain protocol to connect the harness to your agent service.
agentv run \ --path scenarios/loan_scenario.json \ --protocol langchain \ --agent langchain://localhost:8000/execute_task \ --agent-name "LangChain-Retail-Bot"3. Verify Grounding
Section titled “3. Verify Grounding”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 are generated automatically in: