No video

Learn LangChain.js - Build LLM apps with JavaScript and OpenAI

  Рет қаралды 82,798

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

LangChain.js is a framework for building AI apps. Click here to get to the course's interactive challenges: scrimba.com/li...
At the end of this course, you will be able use LangChain's Expression Language to build GPT-powered chatbots that have specific knowledge about an underlying dataset. You will use text embeddings and a vector database to perform retrieval-augmented generation (RAG).
The course requires an understanding of JavaScript. Here is a free JS course if you need a refresher:
scrimba.com/le...
✏️ If you have any feedback to the teacher Tom Chant, please reach out to him on X here:
/ tpchant
Also, feel free to follow Scrimba on KZfaq: / scrimba
⭐️ Code ⭐️
🔗 Download via Scrimba: scrimba.com/li...
⭐️ Chapters ⭐️
⌨️ (0:00:00) Introduction
⌨️ (0:02:01) What you'll learn and build
⌨️ (0:04:08) Introduction to LangChain from Jacob Lee (Lead Maintainer of LangChain.js)
⌨️ (0:05:36) App Flow Diagrams
⌨️ (0:09:04) What are embeddings
⌨️ (0:15:20) Supabase Setup
⌨️ (0:19:27) Split the text
⌨️ (0:21:28) Split the text II
⌨️ (0:27:47) Upload to supabase
⌨️ (0:31:53) Starter code
⌨️ (0:33:19) Explainer The Standalone Question
⌨️ (0:35:31) Aside Prompt Templates
⌨️ (0:38:59) Aside Prompt Templates II
⌨️ (0:42:08) Adding the first chain
⌨️ (0:46:11) Retrieval
⌨️ (0:52:45) Add StringOutputParser
⌨️ (0:55:15) Fetching the answer the template
⌨️ (1:00:39) Serialize the docs
⌨️ (1:02:53) Aside RunnableSequence
⌨️ (1:07:54) Aside RunnableSequence 2
⌨️ (1:10:57) Aside RunnableSequence 3 RunnablePassthrough
⌨️ (1:14:47) Super Challenge - add the RunnableSequence
⌨️ (1:17:10) Super Challenge - solution
⌨️ (1:21:47) Wire up the UI
⌨️ (1:24:34) Setting up the memory
⌨️ (1:27:27) Super Challenge Wire up the memory
⌨️ (1:33:51) Performance Issues Check-list
⌨️ (1:37:44) Outro
🎉 Thanks to our Champion and Sponsor supporters:
👾 davthecoder
👾 jedi-or-sith
👾 南宮千影
👾 Agustín Kussrow
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Justin Hual
👾 Otis Morgan
👾 Oscar Rahnama
--
Learn to code for free and get a developer job: www.freecodeca...
Read hundreds of articles on programming: freecodecamp.o...

Пікірлер: 112
@kasper369
@kasper369 8 ай бұрын
Scrimba teachers have mastered the art of teaching. Thank you for this video.
@jessecasey8295
@jessecasey8295 9 ай бұрын
I was just teaching myself this, you guys always seem to know what we need
@paul-olof
@paul-olof 9 ай бұрын
I'm a few lessons into the free Js course above and it's really good. Without a doubt I'm following both of these to the end. Thanks really!
@legobuildingsrewiew7538
@legobuildingsrewiew7538 9 ай бұрын
Awesome! Exactly what I needed
@abdelhaibouaicha3293
@abdelhaibouaicha3293 9 ай бұрын
📝 Summary of Key Points: 📌 The video discusses the use of Lang chain, a tool for building AI applications, specifically focusing on the concept of output passers and the use of runnable sequences. 🧐 Lang chain offers various output passes for different situations, such as outputting in JSON or binary data. The video demonstrates the use of the string output passer, which passes the output as a string. 🚀 The video introduces the concept of a runnable sequence, which allows for more complex chains of prompts and models. The video provides examples of how to use the pipe method and the runnable sequence to chain together prompts, models, and output passers. 🚀 The importance of formatting the output and using input variables effectively is discussed. 🚀 Performance can be improved by adjusting parameters such as chunk size, overlap size, and OpenAI settings. 💡 Additional Insights and Observations: 💬 "Lang chain offers a powerful and flexible way to build AI applications by chaining together prompts, models, and output passers." 📊 No specific data or statistics were mentioned in the video. 🌐 Lang chain is a tool provided by OpenAI, a reputable source in the field of artificial intelligence. 📣 Concluding Remarks: The video provides a comprehensive overview of using Lang chain to build AI applications. It explains the concept of output passers and demonstrates the use of the string output passer. The video also introduces the concept of a runnable sequence and provides examples of how to chain together prompts, models, and output passers. It emphasizes the importance of formatting the output and using input variables effectively. Overall, Lang chain offers a powerful and flexible way to build AI applications, and performance can be optimized by adjusting various parameters. Made with Talkbud
@MelvinPaulbrains
@MelvinPaulbrains 7 ай бұрын
Did you use llm to summarise this?
@abdelhaibouaicha3293
@abdelhaibouaicha3293 7 ай бұрын
@@MelvinPaulbrains yes, I have used Talkbud chrome extension, it’s free.
@carpanojr
@carpanojr 6 ай бұрын
Apparently AI can't tell "passers" from "parsers "
@noneofyourbusiness8625
@noneofyourbusiness8625 9 ай бұрын
This channel is so amazing
@samssjubair
@samssjubair Ай бұрын
Great teaching
@huangvivi7925
@huangvivi7925 2 ай бұрын
How do you setup all the langchain and supabase dependencies locally?
@AB-kq9xm
@AB-kq9xm 6 ай бұрын
The scrimba ui with the video on the code editor is dreadful. Improve it if you want it to thrive
@girishanker3796
@girishanker3796 6 ай бұрын
That's a great tutorial ⭐ Thank you
@FatemehDamarchilou
@FatemehDamarchilou 9 ай бұрын
You exactly know what we need. Awesome
@p-a8230
@p-a8230 6 ай бұрын
Ty very much for this course
@noobra9chess616
@noobra9chess616 9 ай бұрын
Thanks for the video !
@anotherappointment
@anotherappointment 9 ай бұрын
Oh good tech never slows down
@ItsMe-ry7mk
@ItsMe-ry7mk 3 ай бұрын
if some one like me (noob) encountering error while document load add the just 3 columns in supabase metadata jsonb,content text,embedding and disable database->edit (RLS) if im wrong please correct me
@vedicmusings
@vedicmusings 5 ай бұрын
I think they have updated. When we do the punctuation Prompt it is corrected the grammar also, so no need to run the grammarPrompt
@chinmayjoshi6984
@chinmayjoshi6984 4 ай бұрын
Is it the RAG architecture?
@Padilhavic
@Padilhavic 2 ай бұрын
This is also my question. If it is not, what would be the differences?
@MSs_.
@MSs_. 9 ай бұрын
Hello, I really like your videos and I'm able to learn a lot from the courses you have here. As a Brazilian, I only wonder if there is a way to translate some videos, in addition to the Brazilian language into other languages. KZfaq's own translation is not that good and some words often make no sense at all.
@thomaschant
@thomaschant 8 ай бұрын
Hey! We are really hoping to bring high quality subtitles to Scrimba lessons in the near future - it's something we are making progress on as we speak.
@fhbthenorthstar
@fhbthenorthstar 6 ай бұрын
Amazing - Job Done
@inaamullah7192
@inaamullah7192 9 ай бұрын
Perfect, thanks. How does that works with data bases with more than one parameters retrieval?
@samshosho
@samshosho 8 ай бұрын
great tutorial indeed. Thanks a bunch. Just one question, can this technique be used with another LLM downloaded on one's computer? like llama for example. So doing the same thing without having to pay for tokens and such. Thanks,
@thomaschant
@thomaschant 8 ай бұрын
Probably, yes. I haven't done it myself and I would think the performance would be bound to suffer to some extent, at least at the moment. If you get it working, come back and share your repo - would be really interested to see and hear about it!
@samshosho
@samshosho 8 ай бұрын
I think everything you have explained would be done the same. Only the way you talk to the LLM will differ. In the terms of ready made API when it comes to OpenAI and no set methods to talk to the downloaded LLM. Any idea how something like that could be done? like any service out there or ready code from GitHub or so that would facilitate such thing? you know it's not a good idea to reinvent the wheel.@@thomaschant
@jonu.1504
@jonu.1504 3 күн бұрын
Ollama
@caiyu538
@caiyu538 8 ай бұрын
👍
@stephenjames2951
@stephenjames2951 8 ай бұрын
I got a quota failure when I tried to upload to supabase, is the free tier not sufficient to complete this tutorial? BTW, great course.
@thomaschant
@thomaschant 8 ай бұрын
Should be able to do it on the free tier. Are you using a very large document?
@stephenjames2951
@stephenjames2951 8 ай бұрын
@@thomaschant I was using your document from the tutorial. Following along locally.
@thomaschant
@thomaschant 8 ай бұрын
@@stephenjames2951 that's really strange. Nothing's changed as far as I can see. You should have 500mb of database space. Have you been a really heavy supabase user for another project?
@fieworjohn5697
@fieworjohn5697 7 ай бұрын
I had this same error. Did you eventually resolve it?@@stephenjames2951
@clerov
@clerov 9 ай бұрын
Cool ✨✨
@neerosity
@neerosity 5 ай бұрын
can we push new data embeddings in same document / table which we already have embeddings? or should we have new table for each new docuemnt?
@piotrzaborszczyk483
@piotrzaborszczyk483 7 ай бұрын
this video is flashing a lot (full white screen for split second) when changing screens inside the app that the author is showcasing us. Really painful. Although the content seems good.
@dhiransapkota-u1g
@dhiransapkota-u1g 12 күн бұрын
when the conversation increases and in every invikation we need to pass the whole conversation history, doesn't that increases the token size we are consuming which could be very costly. Is there any solution to that. Suppose chatbot responses with more that 1000 tokens for 10 token question and we need to give this size of token along with next question, that doesnot seems efficient way or am i missing something here? What is the solution.
@sa34w
@sa34w 9 ай бұрын
What I feel is lacking is lang chain updated their site and all the references are moved
@rishiraj2548
@rishiraj2548 9 ай бұрын
👍💯
@hope42
@hope42 5 ай бұрын
Who was flying? My father trained in Stearman before becoming a Corsair pilot.
@BuyCarsTVPakistan
@BuyCarsTVPakistan 5 ай бұрын
Thanks but when I tried your example on my webpage, I ran into all sorts of problems, don't know how it works on your end. For me, it required to have "" above the script, that did it but now i am stuck at dotenv and fs as it seems they cannot be used inside webpage. How did you run in your demo please ?
@soorajthekkepatt
@soorajthekkepatt 2 ай бұрын
will this work with the latest langchain updation
@gagsy17
@gagsy17 5 ай бұрын
Does it works with image also
@mrjoe64-dz4pr
@mrjoe64-dz4pr 9 ай бұрын
Make video about pos
@lucasfrutig4945
@lucasfrutig4945 6 ай бұрын
why in my application node can't load the file with fetch
@quanxom840
@quanxom840 4 ай бұрын
The database has a large number of records of about 16666 records and has error 57014 canceling statement due to statement timeout null. Is there any way to fix it?
@user-wr4yl7tx3w
@user-wr4yl7tx3w 6 ай бұрын
how about for python?
@_sahildahat_
@_sahildahat_ 9 ай бұрын
How to run this in the local machine? When I tried to run this, It throws error about the type of module etc but even after fixing this error, it doesnt run. Can someone please help me out here! Thank you!
@thomaschant
@thomaschant 8 ай бұрын
Hey how far did you get? Did you download the zipped file from the scrim and do NPM install and NPM start?
@_sahildahat_
@_sahildahat_ 8 ай бұрын
@@thomaschant yes, earlier there was some issue but now it's running. So basically the zip file code is vite? And the scrimba-info.txt should always have questions & answers format like the one used?
@thomaschant
@thomaschant 8 ай бұрын
@@_sahildahat_ Yes the zip is vite and you just have to follow the instructions in the readme file. The text can be any format you like but I guess in a customer service/support bot/info bot environment it is likely to be question and answer. But the same technique would work on, for example, an academic paper.
@_sahildahat_
@_sahildahat_ 8 ай бұрын
@@thomaschant Thank you so much! I will continue the video. This comment thread would be of great help to me! Please continue to reply to me here! And thanks for making this awesome video!
@thomaschant
@thomaschant 8 ай бұрын
@@_sahildahat_ my pleasure! Good luck 🍀
@sushantabhowmick1031
@sushantabhowmick1031 5 ай бұрын
what is the openAIApiKey ? please anyone give me response.
@diegogonzalezcruz6952
@diegogonzalezcruz6952 3 ай бұрын
Hello, is anybody getting this error? Error: Error searching for documents: 57014 canceling statement due to statement timeout null when using the retriever?
@qaw392
@qaw392 9 ай бұрын
Movie review rating web app with Laravel pls 🙏
@Shriramkrishnhari
@Shriramkrishnhari 9 ай бұрын
🖐️🌐 👍
@soumadip_skyy_banerjee
@soumadip_skyy_banerjee 9 ай бұрын
🧐
@Anonymous____________A721
@Anonymous____________A721 9 ай бұрын
?
@mohammedseid810
@mohammedseid810 8 ай бұрын
Is there a source code
@thomaschant
@thomaschant 8 ай бұрын
Yes, if you click the first link in the description, in the Scrim (interactive code editor) click the settings ⚙ and select "download as zip". That will give you all the files to run locally :)
@faruk_
@faruk_ 9 ай бұрын
🫡❤️‍🔥
@jeremyh9841
@jeremyh9841 9 ай бұрын
you use openai key so its not free ? and if openai changes its term of service, this code doesnt work anymore ?
@duck3y27
@duck3y27 9 ай бұрын
An openai key is free, you just have to make an account then make a key :)
@jeremyh9841
@jeremyh9841 9 ай бұрын
but i had to put my credit card and they take 1 cent for each request@@duck3y27
@SacWebDeveloper
@SacWebDeveloper 9 ай бұрын
...and it's gone. OpenAI is going to implode soon. Hundreds of staffers are going over to Microsoft.
@Huru_
@Huru_ 9 ай бұрын
almost all of them. which is the same.@@SacWebDeveloper
@pedrogorilla483
@pedrogorilla483 9 ай бұрын
The key is free, you get some free credits, and you can use the code to work with any other LLM.
@abimbolasalawu299
@abimbolasalawu299 9 ай бұрын
Second viewer 😊
@sagarsingh2601
@sagarsingh2601 9 ай бұрын
At time span 31:29 I am not getting the table data it's empty. I have pasted the API keys properly. Can anybody help
@_sahildahat_
@_sahildahat_ 9 ай бұрын
are you writing your code in scrimba or in your local machine?
@reginaldosano6593
@reginaldosano6593 9 ай бұрын
Is there an error showing? Can you type the error message here.
@roshannayak5982
@roshannayak5982 8 ай бұрын
same , did u sloved
@roshannayak5982
@roshannayak5982 8 ай бұрын
​@@_sahildahat_ In scrimba, but it shows
@roshannayak5982
@roshannayak5982 8 ай бұрын
@@reginaldosano6593 I receive an error and can't collect data on supabase since the env key isn't supplied in the video.
@guillermohinostroza1016
@guillermohinostroza1016 8 ай бұрын
Finally a Freecodecamp tut whose lecturer speaks English natively 😂😂😂
@originalpne1060
@originalpne1060 9 ай бұрын
First
@victorpinasarnault9135
@victorpinasarnault9135 9 ай бұрын
Like 503º
@wilonweb
@wilonweb 8 ай бұрын
Someone do that on Visual Studio Code ? I got some error ...
@reginaldosano6593
@reginaldosano6593 8 ай бұрын
Yup I was able to code it in VS Code. What is your error?
@wilonweb
@wilonweb 8 ай бұрын
@@reginaldosano6593 import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; ^^^^^^ SyntaxError: Cannot use import statement outside a module at internalCompileFunction (node:internal/vm:73:18) at wrapSafe (node:internal/modules/cjs/loader:1176:20) at Module._compile (node:internal/modules/cjs/loader:1218:27) at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) at Module.load (node:internal/modules/cjs/loader:1117:32) at Module._load (node:internal/modules/cjs/loader:958:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 Node.js v18.14.2
@lucianoperez2454
@lucianoperez2454 8 ай бұрын
where is the zip file?
@wilonweb
@wilonweb 8 ай бұрын
@@lucianoperez2454 wich zip file ?
@lucianoperez2454
@lucianoperez2454 8 ай бұрын
@@wilonweb I was trying to work on my local machine, never worked on scrimba before, i didn't know how to download the project, now i know... idk if it's on the video , maybe i missed it.
@sivaprasad905
@sivaprasad905 8 ай бұрын
Not worth learning programming for jobs anymore. You can learn it for fun
@manan-543
@manan-543 8 ай бұрын
Bruh chat gpt can't build a full scale software for u which has to be used by millions of users lmao. We still need software engineers and programmers
@4399lol
@4399lol 8 ай бұрын
i dont like scrimba
@paul-olof
@paul-olof 8 ай бұрын
What do you like?
@SacWebDeveloper
@SacWebDeveloper 9 ай бұрын
After the Sam Altman fallout over the weekend, this did not age well. What's more surprising is that you still released this after everyone is dumping OpenAI. Did you guys even know about it? RIP OpenAI.
@theencryptedpartition4633
@theencryptedpartition4633 9 ай бұрын
I’m still using ChatGPT. Although do have to agree that the idea of Prompt Engineering is kinda meh
@Huru_
@Huru_ 9 ай бұрын
My thoughts exactly. That board just killed (or at least hurt it seriously) an entire nascent industry. There's literally no point learning anything that relies on openAI API right now. I don't see them keeping the service open with no workers.
@Huru_
@Huru_ 9 ай бұрын
Prompt Engineering has got nothing to do with chatGPT. It's like, prompt engineering is the technique and chatGPT is the product. It's here to stay.@@theencryptedpartition4633
@kevingage4157
@kevingage4157 9 ай бұрын
Langchain works just fine with other AI models, including locally hosted ones.
@pedrogorilla483
@pedrogorilla483 9 ай бұрын
That’s just your opinion. Just don’t watch it.
@bullyversal5313
@bullyversal5313 8 ай бұрын
What are the prerequisite?? @freecodecamp
@nasimreja7312
@nasimreja7312 8 ай бұрын
is the source code available on scrimba.? i am not finding the download option
LangChain Crash Course for Beginners
1:05:30
freeCodeCamp.org
Рет қаралды 158 М.
Run your own AI (but private)
22:13
NetworkChuck
Рет қаралды 1,3 МЛН
小丑把天使丢游泳池里#short #angel #clown
00:15
Super Beauty team
Рет қаралды 34 МЛН
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 8 МЛН
Has Generative AI Already Peaked? - Computerphile
12:48
Computerphile
Рет қаралды 950 М.
Essential AI prompts for developers
8:31
Visual Studio Code
Рет қаралды 52 М.
LangChain Explained in 13 Minutes | QuickStart Tutorial for Beginners
12:44
Build Anything with AI Agents, Here's How
29:49
David Ondrej
Рет қаралды 258 М.
COMPUTER SCIENCE explained in 17 Minutes
16:49
Wacky Science
Рет қаралды 847 М.
Let's reproduce GPT-2 (124M)
4:01:26
Andrej Karpathy
Рет қаралды 467 М.
Learn RAG From Scratch - Python AI Tutorial from a LangChain Engineer
2:33:11
OpenAI Embeddings and Vector Databases Crash Course
18:41
Adrian Twarog
Рет қаралды 444 М.
小丑把天使丢游泳池里#short #angel #clown
00:15
Super Beauty team
Рет қаралды 34 МЛН