Skip to Content
初めてのLangChain ―LangChainとLangGraphによるAI/LLMアプリケーションの構築
book

初めてのLangChain ―LangChainとLangGraphによるAI/LLMアプリケーションの構築

by Mayo Oshin, Nuno Campos, 新井 翔太, 嶋田 健志
September 2025
Intermediate to advanced
296 pages
4h 30m
Japanese
O'Reilly Japan, Inc.
Content preview from 初めてのLangChain ―LangChainとLangGraphによるAI/LLMアプリケーションの構築

6章エージェントアーキテクチャの基本

「5章 LangGraphによる認知アーキテクチャ」で説明したアーキテクチャをベースに、本章では現在のLLMアーキテクチャの中でおそらく最も重要なものであるエージェントアーキテクチャについて説明する。まず、LLMエージェントの特徴を紹介し、次にエージェントの構築方法と一般的なユースケースを想定した拡張方法を紹介する。

人工知能分野では、(知的)エージェントの作成に長い歴史がある。これは、教科書『Artificial Intelligence』(Pearson, 2020)のStuart RussellとPeter Norvigの言葉を借りれば、最も簡単に「行動するもの」と定義できる。この「行動する」という言葉には、実は見た目以上の意味がある。

  • 行動するには、何をすべきかを決める能力が必要である。
  • 何をすべきかを決めるということは、複数の可能性のある行動にアクセスすることを意味する。つまり、選択肢のない決断は決断ではない。
  • 決定するためには、エージェントは外部環境(エージェント自身の外側にあるもの)に関する情報にもアクセスする必要がある。

したがって、エージェント型(agentic)LLMアプリケーションとは、LLMを使って、世の中の現在の状態や次に望む状態について、何らかのコンテキストが与えられたときに、1つ以上の可能な行動コースから選択するものでなければならない。このような属性は通常、「はじめに」で紹介した2つのプロンプトテクニックを組み合わせて実装される。

ツール呼び出し
LLMが利用できる外部関数(すなわち選択可能なアクション)の一覧をプロンプトに含め、モデルが選択したアクションをどのようなフォーマットで出力に表現すべきかを指示することが望ましい。これがプロンプトでどのように記述されるかは、後ほど説明する。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

プラットフォームエンジニアリング ―成功するプラットフォームとチームを作るガイドライン

プラットフォームエンジニアリング ―成功するプラットフォームとチームを作るガイドライン

Camille Fournier, Ian Nowland, 松浦 隼人
レガシーコードからの脱却 ―ソフトウェアの寿命を延ばし価値を高める9つのプラクティス

レガシーコードからの脱却 ―ソフトウェアの寿命を延ばし価値を高める9つのプラクティス

David Scott Bernstein, 吉羽 龍太郎, 永瀬 美穂, 原田 騎郎, 有野 雅士

Publisher Resources

ISBN: 9784814401307Publisher Website