Skip to main content

Overview

Quraite provides a built-in adapter for LangChain agents. This adapter allows you to integrate LangChain agents with Quraite and run evaluations on them. This adapter supports two ways of capturing the trajectory of the agent:
  • direct conversion of the agent graph’s output to Quraite trajectory format, but this does not capture the latency and token usage.
  • using OpenInference instrumentation.

Prerequisites

  • Agent dependencies: langchain, a supported LLM (for example Gemini via langchain-google-genai), and any tools you want to use.
  • Quraite dependencies: quraite[langchain-oi] package. Optional if you don’t want to capture latency and token usage.

Define Your LangChain Agent

You create a normal LangChain agent first, exactly as you would in any LangChain project.

Set up Tracing

Quraite provides a tracing setup helper. For LangChain, pass the Framework.LANGCHAIN enum:

Wrap the LangChain Agent

Wrap the agent with the LangchainAdapter and pass the tracer_provider to it.

Run the Agent

Once wrapped, you expose the adapter using Quraite’s run_agent helper.

End-to-End Examples