Framework guide

Test your LangChain agent

LangChain agents chain LLM calls, tools, and memory into multi-step workflows, so a lot can go wrong between the prompt and the answer. Connect yours to ClientCoded in two lines and every step gets captured, scored, and testable.

1. Install

Add the ClientCoded package to your LangChain project.

Terminal
$ pip install clientcoded

2. Initialize

Add two lines at the top of your LangChain app, before your agent runs. Your agent_id and team api_key come from your dashboard.

Python
import clientcoded
clientcoded.init(agent_id="your-agent-id", api_key="your-team-api-key")
# Every LangChain call is now captured and scored.

3. What gets auto-traced

Once init runs, ClientCoded auto-instruments LangChain. You do not change your agent code. On every run, these are captured automatically:

  • LLM calls (ChatOpenAI, ChatAnthropic, and other chat models)
  • Chain steps (LLMChain, SequentialChain, and your custom chains)
  • Tool calls and agent-executor runs
  • Intermediate agent actions and observations
  • Retriever and vector-store lookups

4. See your results

Each run is scored and sent to your dashboard, with the overall grade, the per-dimension breakdown, and the exact step where your agent went wrong.

Output
✓ Connected. Tracing LangChain calls.

Run scored: 7.8 / 10
15 steps traced · 2 issues flagged
# View the full breakdown in your dashboard

Open your dashboard to see traced runs, scores, and flagged failures. From there you can run the full adversarial test suite against your LangChain agent and track quality on every change.

Next steps

See the full integration docs for the production monitoring webhook and the Query API, or start free, your first adversarial test is on us.

Testing another framework? CrewAI · AutoGen · LlamaIndex