Scaling Generative AI Evaluation at Reiwa Travel: LangSmith for AI Observability

published
published
author
authorDisplayName
Lukas Frannek
category
AI
mainImage
20251204_lukas_001.png
publishedAt
Dec 4, 2025
slug
Advent-Calendar-20251204
tags
advent calendar
AI
notion image
 
💡
この記事は、NEWT Product Advent Calendar 2025」Day4 および「MLOps(LLMOps、生成AIOps、AI AgentOps) Advent Calendar 2025」Day4 の記事となります。
NEWT Product Advent Calendar 2025」4日目は、令和トラベル AX室のlukasが、Backendエンジニア kitaからバトンをもらい、「Scaling Generative AI Evaluation at Reiwa Travel: LangSmith for AI Observability」というテーマで執筆。ぜひ、最後までご覧ください!
 
(※日本語訳は、後半に記載しています。)

Introduction

At Reiwa Travel, we've been integrating generative AI into our travel platform in various areas. From intelligent chatbots to automated itinerary generation, and data enrichment pipelines. However, as our AI ecosystem expanded, we faced a critical challenge: how do you maintain visibility, reliability, and continuous improvement across multiple AI agents and workflows? The answer led us to LangSmith, and in this post, we'll share one of its’ use cases, the unique advantages we discovered, and how LangSmith's evaluation capabilities improved our AI quality assurance.

Our Generative AI Landscape

Our AI ecosystem encompasses several applications, for instance:
Data Enrichment Agents
Our data enrichment pipeline leverages AI agents to enhance travel listings with rich, contextual information. These agents process thousands of hotel descriptions, attraction details, and local insights, automatically generating compelling content while maintaining accuracy and cultural sensitivity. The agents work in multi-step workflows, combining data from various sources including our property database, local APIs, and external content providers.
 
Intelligent Customer Chatbots
Our customer-facing chatbots handle complex travel inquiries, and all kinds of other questions. These conversational AI systems use various knowledge bases to provide personalized, real-time assistance across multiple languages and cultural contexts.
 
Dynamic Itinerary Generation
Another AI application, our itinerary generation system, combines user preferences and local seasonal events to create personalized travel experiences.
 

The Observability Challenge

As our AI solutions matured from prototypes to production-scale systems serving thousands of queries, we encountered several critical observability challenges:
 
Distributed Trace Complexity
Our agentic workflows often involve multiple different AI model calls, API integrations, and decision points. Understanding how data flowed through these complex pipelines, where bottlenecks and errors occurred, and how different components interacted became increasingly difficult with traditional monitoring tools.
 
Cost and Performance Optimization
With AI model costs directly impacting our bottom line, we needed granular visibility into:
- Token usage patterns across different models and use cases - Latency distributions to identify performance degradation - Cost attribution per customer interaction and project - Model performance comparisons to optimize our LLM selection
 
Quality Assurance at Scale
With thousands of AI-generated responses daily across several services, manual quality control became impossible. We needed automated systems to evaluate:
- Response accuracy and relevance - Factual consistency across different information sources - User satisfaction correlation with AI interaction patterns
 

Why We Chose LangSmith Over Alternatives

After extensive evaluation of the AI observability landscape, including Langfuse, Helicone, and other solutions, LangSmith emerged as the clear choice for our needs.
Comprehensive Integration Ecosystem
Having built our initial AI prototypes with LangChain, LangSmith's native integration eliminated the need for extensive code refactoring. Unlike alternatives that required significant instrumentation changes, LangSmith began capturing comprehensive traces immediately upon deployment, providing instant visibility into our existing workflows.
In addition, LangSmith's Python and TypeScript SDKs provide functionalities for seamless integration whether we're building backend services in Python or frontend applications in TypeScript.
LangSmith also provides excellent integrations with modern AI frameworks like the Vercel AI SDK that we extensively use. Here's how simple it is to add LangSmith telemetry:
 
result = streamText({ model: this.model, messages: enhancedMessages, tools, stopWhen: stepCountIs(effectiveMaxSteps), temperature: effectiveTemperature, maxOutputTokens: AI_CONFIG.maxTokens.default, experimental_telemetry: { isEnabled: true, metadata: { agent_id: this.currentAgentId, taskId: this.taskId, team_id: this.teamId || "unknown", ls_run_name: "researchRun", }, }, });
 
This simple experimental_telemetry configuration automatically captures all our AI interactions, tool calls, and performance metrics without requiring complex instrumentation or additional dependencies.
 

LangSmith's Trace Structure: Visibility Into Every Decision

LangSmith's trace architecture provides good visibility into our AI workflows. Each trace captures:
Hierarchical Execution Flow
Every query generates a structured trace showing the complete execution path through our AI agents. For example, a hotel enrichment request creates a trace tree with:
- Root span: Initial customer request processing - Child spans: Individual agent invocations - Tool call spans: External API calls - LLM spans: Each model invocation with complete prompt and response data
notion image
 
 
Comprehensive Metadata Capture
Each span contains rich metadata including:
- Input/output tokens and costs - Model parameters and configurations - Execution timing and latency - Error conditions and retry attempts - Custom business metrics (customer satisfaction scores and comments)
 
notion image
 
Tool Call Transparency
LangSmith's tool call visibility has been transformational for debugging our agentic workflows. We can see exactly how our AI agents interact with external services, identify failed API calls, and optimize tool selection patterns.
 

The Evaluation Framework

LangSmith's evaluation framework offers various features that help to streamline evaluation. It allows us to directly use traces for evaluations, either online or offline batch evaluations that can be set up programmatically or via the UI with the help of an LLM. LangSmith comes with pre-configured evaluators for common use cases like correctness, helpfulness, and harmfulness, allowing us to get started with evaluation immediately without building everything from scratch. Even custom LLM-as-a-judge workflows can be created that way, enabling us to conduct various evaluations, from regression tests after prompt updates, conversation quality, or hallucinations when using Retrieval Augmented Generation (RAG) systems.
 
notion image
notion image
 
Finding Hallucinations With Grounding Search
There are various methods for detecting hallucinations in agentic workflow outputs.
Using multiple LLMs to evaluate another model’s output can help reduce single-model bias, but it is often prohibitively expensive and still struggles with fact-checking real-time data. Improving prompt engineering—for example, using chain-of-thought verification during multi-step workflows—is another strong approach for reducing hallucinations.
However, these methods assume that the real-time data retrieval step is correct. In practice, retrieval itself may fail: the system might pull data from unreliable sources, return incomplete results, or miss critical information, even if the LLM’s reasoning is otherwise sound. Real-time internet search is fundamentally different from vector search over a fixed, curated knowledge base.
When retrieval can be wrong, the most reliable way to detect hallucinations and omissions is still human verification. But for a small startup, full human review is often unrealistic. In that case, the next best alternative is to have the system perform internet searches in the same way a human would when validating information.
One popular tool for research grounding with Gemini APIs is Google Grounding Search. When using Vercel's AI SDK, it can be used as a regular tool that the LLM can call. It allows the agent to specify one or multiple google search queries to clarify specific facts. On a larger scale this becomes prohibitively expensive, which is why we decided to use it on important mission-critical fields only. To make sure that the workflow produces those expected fields the last step in the agentic workflow uses a structured output that can be extracted by the evaluator. That way, the LLM judge sees the output and can conduct a grounding search to determine if there was a hallucination or if the information can actually be retrieved at all. Such a system can of course still make mistakes but it is a major improvement over having a human check a very small subset of results.
 
notion image
 
Other LangSmith Features
LangSmith offers more features such as prompt management, HITL evaluation pipeline management, LangGraph agent deployment, and a new visual agent builder. In addition, while open-source alternatives like Langfuse offered customization benefits, LangSmith's commercial backing provided the reliability guarantees essential for our production environment. With 99.9% uptime SLAs and optional enterprise support, we could focus on AI innovation rather than infrastructure maintenance.
 

Conclusion

LangSmith has improved how we approach AI observability and quality assurance for some of our AI solutions. While the AI observability landscape offers numerous alternatives, LangSmith's combination of enterprise reliability, sophisticated evaluation capabilities, and seamless integration made it the ideal choice for our complex, production-scale AI ecosystem. The platform's trace visibility gives us confidence in our AI decision-making, while its evaluation framework ensures continuous improvement and quality assurance. While LangSmith was a fit for our technical and business requirements, it naturally might not be the best choice for all teams as they have different requirements.
 
 
※以下、日本語訳。

イントロダクション

令和トラベルでは、生成 AI をさまざまな領域で当社の旅行プラットフォームに統合してきました。インテリジェントなチャットボットから自動旅程生成、データエンリッチメントパイプラインまで、幅広く活用しています。
 
しかし AI エコシステムが拡大するにつれ、複数の AI エージェントやワークフロー全体の「可視性・信頼性・継続的改善をどのように維持するか」という重要な課題に直面しました。
 
その答えとして私たちが辿り着いたのが LangSmith です。
この記事では、具体的なユースケースや導入によって得られたメリット、そして LangSmith の評価機能がどのようにして当社の AI 品質保証を改善したかをご紹介します。
 

当社の Generative AI 活用領域

当社の AI エコシステムは複数のアプリケーションで構成されています。例えば以下のようなものです。

データエンリッチメントエージェント

当社のデータエンリッチメントパイプラインでは、旅行情報をより豊かで文脈的な内容にするため AI エージェントを活用しています。ホテル情報、観光スポットの説明、地域情報など数千件におよぶ情報を処理し、正確性や文化的配慮を保ちながら魅力的なコンテンツを自動生成します。
エージェントは、地域特性のデータベース、地域 API、外部コンテンツプロバイダーなど、複数のソースからのデータを組み合わせてマルチステップワークフローを実行します。
 

インテリジェントカスタマーチャットボット

ユーザー向けのチャットボットは、複雑な旅行相談やあらゆる種類の問い合わせに対応します。複数のナレッジベースを活用し、複数言語・文化背景に応じたパーソナライズされたリアルタイムサポートを提供します。
 

動的旅程生成

旅程生成システムでは、ユーザーの嗜好や季節イベントを組み合わせ、個々に最適化された旅行体験を自動で提供します。
 
 

直面したオブザーバビリティの課題

AI ソリューションがプロトタイプ段階から数千件のクエリに対応するプロダクション規模へと成長するなかで、以下のような重要なオブザーバビリティ課題が見えてきました。

分散トレースの複雑性

当社のエージェントワークフローは複数の AI モデル呼び出し、API 統合、意思決定ステップから構成されます。
データがどのように流れているか、どこでボトルネックやエラーが発生しているか、各コンポーネントがどう相互作用しているかを従来の監視ツールで把握するのは困難でした。
 

コストとパフォーマンス最適化

AI モデルの利用コストは事業収益に直結するため、次のような細かな可視化が必要でした:
  • モデル別・利用ケース別の トークン使用パターン
  • レイテンシ分布 による性能劣化の検知
  • 顧客インタラクションごとの コスト可視化
  • LLM 選定最適化のための モデル比較
 

大規模な品質保証

複数サービスで毎日数千件の AI 出力が生成されるため、手動での品質管理は不可能でした。以下の内容を自動で評価する仕組みが必要でした:
  • 回答の正確性と関連性
  • 複数情報源にわたる 事実整合性
  • ユーザー満足度と AI 対話パターンの関連性
 
 

LangSmith を選んだ理由

Langfuse や Helicone を含む複数の AI オブザーバビリティツールを比較した結果、当社の要件に最も合致したのが LangSmith でした。

高度な統合エコシステム

当社では初期プロトタイプを LangChain で構築していたため、LangSmith のネイティブ統合により大規模なコード修正が不要でした。他ツールでは多くの計装が必要でしたが、LangSmith は導入直後から包括的なトレースを自動取得し、既存ワークフローへの可視性が即座に得られました。
 
さらに、LangSmith は Python/TypeScript の SDK を提供しており、バックエンド(Python)・フロントエンド(TypeScript)どちらでもシームレスに統合できます。
 
また、当社が多用する Vercel AI SDK とも非常に高い互換性があります。以下は LangSmith テレメトリーを有効化するシンプルな例です:
result = streamText({ model: this.model, messages: enhancedMessages, tools, stopWhen: stepCountIs(effectiveMaxSteps), temperature: effectiveTemperature, maxOutputTokens: AI_CONFIG.maxTokens.default, experimental_telemetry: { isEnabled: true, metadata: { agent_id: this.currentAgentId, taskId: this.taskId, team_id: this.teamId || "unknown", ls_run_name: "researchRun", }, }, });
 
この experimental_telemetry 設定だけで、AI インタラクション・ツール呼び出し・パフォーマンス指標がすべて自動で記録され、複雑な計装や依存関係は不要となりました。
 
 

LangSmith のトレース構造:すべての意思決定を可視化

LangSmith のトレースアーキテクチャは、AI ワークフロー全体に対して高い可視性を提供します。

階層型実行フロー

各クエリは、AI エージェント全体の実行経路を階層構造でトレース化します。たとえばホテルデータのエンリッチメントでは以下のような構造になります:
  • ルートスパン:初期リクエスト処理
  • 子スパン:各エージェントの実行
  • ツールコールスパン:外部 API 呼び出し
  • LLM スパン:各モデル呼び出し(プロンプト/レスポンス含む)
notion image
 
 

豊富なメタデータ取得

各スパンには以下が含まれます:
  • 入出力トークン数とコスト
  • モデル設定・パラメータ
  • 実行時間・レイテンシ
  • エラー状況・リトライ記録
  • 独自ビジネスメトリクス(満足度スコア等)
 
notion image
 

ツールコールの透明性

ツールコールの完全な可視化により、エージェントがどの外部サービスをどう利用したか、どの API 呼び出しが失敗したか、ツール選択パターンをどう最適化すべきかが一目で分かるようになりました。
 
 

評価フレームワーク

LangSmith の評価機能は非常に強力で、評価プロセスを大幅に効率化できます。
トレースをそのまま利用してオンライン評価・オフライン一括評価の両方を実行でき、プログラムや UI(LLM の支援付き)からセットアップ可能です。
 
正確性・有用性・有害性など一般的な評価指標があらかじめ用意されており、一から自作しなくてもすぐに評価を開始できます。
 
また、LLM を審査員として使う独自評価パイプラインも容易に構築でき、プロンプト更新後の回帰テスト、会話品質評価、RAG システムでのハルシネーション検出など幅広く対応できます。
 
notion image
notion image
 
 

Grounding Search によるハルシネーション検出

ハルシネーション検出の課題

ハルシネーションを検出する方法はいくつかあります。複数の LLM を使って別の LLM の出力を相互評価する方法は単一モデルバイアスを軽減しますが、
  • コストが非常に高い
  • リアルタイムデータの事実確認には弱い
といった課題があります。
 
チェーン・オブ・ソート(CoT)による思考プロセスの検証も有効ですが、前提としてリアルタイム検索が正しく行われていることを仮定しています。
 
しかし実際には、検索結果そのものが誤っていたり、不十分だったり、不正確なソースを拾うことはよくあります。リアルタイムのインターネット検索は、固定されたベクトルデータベースに対する検索とは本質的に異なります。
 

検索が間違っている場合の対策

検索が誤っている可能性がある場合、最も確実なのは 人間による確認 です。しかし小規模スタートアップでは全件チェックは現実的ではありません。
そこで次善策として、人間が行うのと同じ方法でインターネット検索を行わせ、結果を検証する 仕組みを採用しました。
 

Google Grounding Search の活用

Gemini API で人気のツールである Google Grounding Search は、Vercel AI SDK を使う場合は通常のツールと同様に LLM から呼び出すことができます。
エージェントは必要に応じて一つまたは複数の Google 検索クエリを指定し、情報を明確化できます。
 
ただし、大規模に使うと非常に高コストになるため、当社では重要なミッションクリティカル領域に限定して利用しています。
 
期待される出力項目を確実に生成するため、ワークフローの最後に構造化出力を行い、評価者(LLM)がその項目を確認し、
  • grounding search が必要か
  • ハルシネーションか
  • 情報がそもそも取得可能か
などを判断できるようにしています。
この仕組みも万能ではありませんが、人間による極小サンプルチェックに比べれば大きな改善となりました。
notion image
 

その他の LangSmith 機能

LangSmith にはその他にも以下の機能があります:
  • プロンプト管理
  • HITL(Human-in-the-loop)評価パイプライン管理
  • LangGraph エージェントのデプロイ
  • 新しいビジュアルエージェントビルダー
 
また、Langfuse などのオープンソースツールは高いカスタマイズ性を持つ一方で、LangSmith の商用サポートはプロダクション運用に必要な信頼性を提供します。
99.9% アップタイムの SLA やエンタープライズサポートは、当社がインフラ維持ではなく AI イノベーションに集中する助けとなりました。
 

結論

LangSmith の導入により、当社の一部 AI ソリューションにおけるオブザーバビリティと品質保証のアプローチは大きく改善されました。
多様なツールが存在する AI オブザーバビリティ領域において、LangSmith はエンタープライズレベルの信頼性、洗練された評価機能、シームレスな統合性により、当社の複雑かつ大規模な AI エコシステムに最適な選択肢となりました。
 
トレースの可視性によって AI の意思決定過程を信頼できるようになり、評価フレームワークは継続的な改善と品質保証を可能にしています。
 
もちろん、各チームの要件によって最適なツールは異なりますが、当社にとって LangSmith は技術的にもビジネス的にも最もフィットしたソリューションでした。
 
 

📣 12月のイベント開催のお知らせ

令和トラベルでは、毎月技術的な知識や知見・成果を共有するLT会を毎月実施しています。発表テーマや令和トラベルに興味をお持ちいただいた方は、誰でも気軽に参加いただけます。

【本日開催!】2025年総決算!エンジニアリングマネージャーお悩み相談室 LIVE

2025年最後のイベントとなる「NEWT Tech Talk Vol.19」は エンジニアリングマネージャーお悩み相談室 を開催いたします!本日のコンテンツは、株式会社カケハシ・株式会社スマートバンク・株式会社LayerXを交えパネルディスカッションを開催。
2025年7月7日に発売された書籍『エンジニアリングマネージャーお悩み相談室』の著者と、書籍レビューに参加したEM実践者たちが集い、EMたちのさまざまな課題や悩み、またそれに対する解やアプローチについてここ限りのオフレコトークを語り合います!
そのほか、毎月開催している技術発信イベントについては、connpass にてメンバー登録して最新情報をお見逃しなく!
 

【NEWT Chat リリース記念】AI × Travel Innovation Week 開催!

12月3日より、「NEWT Chat」誕生の裏側や開発ストーリーをお届けする特別企画 “AI × Travel Innovation Week” を令和トラベルのnote上で開催中です!
「NEWT Chat」のリリース背景、プロダクトの価値、開発体制、そして今後の展望など、新規事業の “舞台裏” を12月3日〜6日まで毎日公開予定です。特に、AIプロダクト開発に関わるエンジニア・PMの皆さまにとって学びの多い内容となりますので、ぜひご覧ください。
▼ AI × Travel Innovation Week のnoteはこちら:
 
旅行・観光業に特化したAIエージェントチャット「NEWT Chat(ニュートチャット)」についてはこちらから。
 

1年間の感謝を込めた、”クリスマスセール🎄” 開催中!

NEWTでは現在、海外旅行やホテルをおトクにご予約いただける『クリスマスセール🎄』を12/4〜スタートしています!ぜひこの機会にご利用ください!
 

令和トラベルでは一緒に働く仲間を募集しています

この記事を読んで会社やプロダクトについて興味を持ってくれた方は、ぜひご連絡お待ちしています!お気軽にお問い合わせください!
フランクに話だけでも聞きたいという方は、カジュアル面談も実施できますので、お気軽にお声がけください。
 

📣宣伝

次回のNEWT Product Advent Calendar 2025Day5は、「ノーコードツール(Zapier)でデザインレビューを資産化する方法」と題してコミュニケーションデザイナーのmaimaiが担当します。次のブログもお楽しみに!

# advent calendar

# AI