Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
LangChainやるならPythonよりTypeScriptの方がいんじゃね?
Search
Optimisuke
November 22, 2023
Technology
1
1.2k
LangChainやるならPythonよりTypeScriptの方がいんじゃね?
LangChain.jsの紹介です。
Optimisuke
November 22, 2023
Tweet
Share
More Decks by Optimisuke
See All by Optimisuke
量子コンピュータ勉強会#1
optimisuke
0
24
Node.jsでllama_2_.pdf
optimisuke
0
210
オンオフの切り替え
optimisuke
0
60
Other Decks in Technology
See All in Technology
Azure Well-Architected Framework入門
tomokusaba
1
130
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
14
82k
GraphRAG グラフDBを使ったLLM生成(自作漫画DBを用いた具体例を用いて)
seaturt1e
1
150
知覚とデザイン
rinchoku
1
590
[re:Inent2025事前勉強会(有志で開催)] re:Inventで見つけた人生をちょっと変えるコツ
sh_fk2
0
140
IoTLT@ストラタシスジャパン_20251021
norioikedo
0
140
Open Table Format (OTF) が必要になった背景とその機能 (2025.10.28)
simosako
2
300
もう外には出ない。より快適なフルリモート環境を目指して
mottyzzz
13
11k
プロファイルとAIエージェントによる効率的なデバッグ / Effective debugging with profiler and AI assistant
ymotongpoo
1
210
RemoteFunctionを使ったコロケーション
mkazutaka
1
120
AI時代、“平均値”ではいられない
uhyo
8
2.6k
オブザーバビリティと育てた ID管理・認証認可基盤の歩み / The Journey of an ID Management, Authentication, and Authorization Platform Nurtured with Observability
kaminashi
1
720
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Reflections from 52 weeks, 52 projects
jeffersonlam
353
21k
Embracing the Ebb and Flow
colly
88
4.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Balancing Empowerment & Direction
lara
5
700
Practical Orchestrator
shlominoach
190
11k
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Faster Mobile Websites
deanohume
310
31k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Transcript
LangChain.js使ってみた 🦜🔗
改め
LangChainやるならPythonより TypeScriptの方がいんじゃね? 🦜🔗 >> ※個人の感想です。効果には個人差があります。
LangChain 🦜🔗?
https://www.langchain.com/
LangChain 🦜🔗? https://gihyo.jp/book/2023/978-4-297-13839-4
LangChain.js 🦜🔗? https://github.com/langchain-ai/langchainjs https://js.langchain.com/docs/get_started/introduction
LangChain.js 🦜🔗? https://github.com/langchain-ai/langchainjs https://github.com/langchain-ai/langchain
仮説 🦜🔗 - 使うのってData ScientistsじゃなくてSoftware Engineersじゃね? - なら、PythonよりTypeScriptの方がよくね?
🦜🔗 LangChain + Next.js Starter Template! https://github.com/langchain-ai/langchain-nextjs-template https://langchain-nextjs-template.vercel.app/
🦜🔗 LangChain + Next.js Starter Template! Chat ChatGPT的な動き 🧱
Structured Output jsonで返してくれるように設定(この後、各種APIと連携するため) 🦜 Agents LLMがAPIを呼んでくれる!? 🐶 Retrieval LLMがデータベースの検索もしてくれる!? 🤖 Retrieval Agents LLMがデータベースを検索しつつAPIも呼んでくれる!?
🦜🔗 LangChain + Next.js Starter Template! Chat ChatGPT的な動き 🐶
Retrieval LLMがデータベースの検索もしてくれる!?
Chat
None
🐶 Retrieval プロンプトに検索結果を入れることで、 LLMが学習していない情報を加味して回答を生成できる
🐶 Retrieval プロンプトに検索結果を入れることで、 LLMが学習していない情報を加味して回答を生成できる
None
retrieval Chain answer Chain conversational RetrievalQA Chain chat_history question standalone
Question Chain 🐶 Retrieval 会話履歴から 質問生成 検索 回答生成 アウトプット
Vercel AI SDK https://sdk.vercel.ai/docs
フロントエンド バックエンド
LangChain.jsの中身を少し
Model いい感じに抽象化されていて、モデルを変更しやすい
参考:Ollama🦙 https://ollama.ai/
Runnable https://js.langchain.com/docs/expression_language/interface あれもこれもRunnableもしくはRunnableLike
LangChain.jsの中身おわり
LangChainやるならPythonよりTypeScriptの方がよくね? WebアプリするならTypeScriptでよくね? Data Scientistsじゃなくてよくね→TypeScriptでよくね? Pythonで型ヒント書くなら、TypeScriptでよくね? (ただ、Pythonでサクッと書いてJupyter Notebookで試行錯誤のログを残すのは良いと思う) ※個人の感想です。効果には個人差があります。
LangChain.js使おう! 🦜🔗