LangGraph-based 3-agent workflow replacing double-annotation with LLM annotation at 80%+ accuracy, reducing total annotation workload by 40% for ML training data.
Built a 3-agent annotation workflow using LangGraph to generate training data for the PAM-ML product matching model. The workflow replaces the second human annotator in the traditional double-annotation process.
How it works: The ML model matches receipt products to catalog items. The quality team samples these matches for labeling to create training data. Previously, two humans annotated each sample and a third resolved disagreements. Now the LLM acts as the second annotator - when it agrees with the first human (80%+ of cases), the label is accepted. The second human only reviews the 20% disagreement cases.
Training ML models for product matching required thousands of labeled examples with high agreement between annotators. The traditional double-annotation process was expensive and slow:
Built a 3-agent workflow with LangGraph orchestration:
3-Agent Pipeline:
Why 3 agents? Breaking the complex annotation task into focused steps improves accuracy. Each agent specializes in one aspect: normalization handles messy text, brand extraction isolates a key comparison factor, and classification applies consistent decision logic. This also provides interpretable intermediate outputs for debugging.
Classification Scale:
Human-LLM Agreement System:
Explainability Metadata: Each prediction includes structured reasoning:
AI/ML: LangGraph, OpenAI models
Framework: Python, Pydantic
Infrastructure: JFrog (internal package registry)
Data: Structured outputs, decision tree reasoning
This workflow transformed the annotation process from requiring two humans per example to a human-LLM collaboration, cutting total annotation workload by 40%. The high-quality training data directly improves the PAM-ML product matching model, which drives offer attribution accuracy.
Framework Adoption: Beyond the annotation workflow, this project produced an internal LLM framework library containing reusable agent abstractions and workflow orchestration. Published to JFrog, the library is imported by the False Positive Auditor and other production systems, demonstrating the value of building modular AI infrastructure.