Tutorial | Chat with any Website using Python and Langchain (LATEST VERSION)

  Рет қаралды 52,338

Alejandro AO - Software & Ai

Alejandro AO - Software & Ai

Күн бұрын

Build a Website-Interacting Chatbot with LangChain, GPT-4 and Streamlit | Python Tutorial
--------------------
LINKS
🐱 GitHub repository: github.com/alejandro-ao/chat-...
🔥 Learn to deploy these apps for your team: link.alejandro-ao.com/deploym...
💬 Join the Discord Help Server: link.alejandro-ao.com/HrFKZn
❤️ Buy me a coffee... or a beer (thanks): link.alejandro-ao.com/l83gNq
✉️ Join the mail list: link.alejandro-ao.com/AIIguB
--------------------
🔥 In this video, we're embarking on a project-driven journey to create a chatbot that can interact with any website, extracting information with a RAG algorithm. This RAG chatbot leverages the power of large language models like GPT-4, Mistral, Llama2, and ollama, making it a cutting-edge tool. Perfect for both beginners and experienced programmers, this tutorial is packed with practical insights and step-by-step guidance. 🚀
👨‍💻 What You'll Learn:
How to integrate LangChain with GPT-4 and other large language models (LLMs) for dynamic website interaction.
Building a sleek GUI using Streamlit, making your chatbot user-friendly and visually appealing.
Implementing Python coding techniques to enhance the functionality of your LangChain chatbot.
Utilizing the latest features of LangChain 0.1.0 and understanding the advancements in LangChain 2024.
Integrating AI technologies like Pinecone, Hugging Face models, and ChromaDB for advanced data handling and processing.
🌟 What Makes This Tutorial Special:
Real-World Application: Learn to create a chatbot that's not just theoretical but has practical use in interacting with websites.
Latest Tech Stack: Explore the newest advancements in AI, including the latest LangChain 0.1 library, and Chroma database technologies for embeddings and vector storage.
Hands-On Experience: This project-driven approach ensures you get hands-on experience, making the learning process interactive and engaging.
User-Friendly Design: Understand the importance of GUI in AI applications and learn to build one with Streamlit.
Comprehensive Explanation: Every step is explained in detail, making it easy to follow along, regardless of your skill level.
✅ Who Should Watch:
Aspiring and experienced AI enthusiasts.
Python developers looking to expand into AI and chatbot development.
Anyone interested in understanding how to integrate LLMs like GPT-4 with web technologies.
💡 Don't forget to like, share, and subscribe for more content on AI, Python programming, and cutting-edge technological tutorials. Drop your questions and feedback in the comments below. Stay tuned for more innovative projects and tutorials!
--------------------------------
CHAPTERS
0:00 Intro
1:41 Create a Virtual Environment
3:24 Install Required Packages
4:33 Create Graphical User Interface
8:17 Create Chat Component
11:36 Make Chat Interactive
13:13 Add Mock get_response() Function
15:30 Add Chat History
19:57 Make Chat History Persistent
23:02 Display Message History
25:58 Test for URL
27:47 Explanation of RAG Algorithms
33:47 Scrap HTML Page with LangChain
38:20 Split Text into Chunks
41:51 Create Vector Store
45:01 Get OpenAI API Keys
48:40 Create Retriever Chain
57:32 Test Retriever Chain
1:00:54 Create Conversational RAG Chain
1:08:52 Refactor Session State
1:11:14 Test Conversational RAG
1:14:20 Update get_response() Function
1:18:30 Final Tests
--------------------------------

Пікірлер: 292
@alejandro_ao
@alejandro_ao 3 ай бұрын
🐱 GitHub repository: github.com/alejandro-ao/chat-with-websites 🔥 Join the LangChain Master Program (early access): link.alejandro-ao.com/langchain-mastery 💬 Ask your questions in our Discord Server (but please leave a comment here too for engagement): link.alejandro-ao.com/981ypA ❤ Buy me a coffee (thanks): link.alejandro-ao.com/YR8Fkw
@xspydazx
@xspydazx Ай бұрын
when fine tuning a model : it seems that it is adjusting the model weights based on the input and expected output? that would mean the brain is @Open? so its basically live when taking to the brain in training does this effect its weights ? can only the trainer effect the weights of the model ? i expect this is happening in memory? based on Positive and Negative feedback in Chat could we not be talking to the brain and teaching it and adjusting its weights on the fly? Also (sorry) When using the Rag type systems are the documents being tokenized using the tokenizer from the model ? (i know it locks the database down a bit) , as then we could consider the local rag as the working memory system ? and the llm as the long term memory system , should there be a bridge between the database and trainer so that it could essentially update the Longterm memory periodically releasing the local rag data? ie essentially training a lora to be applied (or merged) ... hence the llm should have a lot of loras from each interval of updates or training Or not if the strategy is full merge?
@christophemarie-reine1624
@christophemarie-reine1624 5 күн бұрын
Incredible! It's the first time I understand everything just by watching a tutorial once. A true educator
@alejandro_ao
@alejandro_ao 4 күн бұрын
it means a lot! keep it up 💪
@paalhoff63
@paalhoff63 3 ай бұрын
Exceptional clarity - great video!!!
@alejandro_ao
@alejandro_ao 3 ай бұрын
Glad you liked it!
@kazimali07
@kazimali07 27 күн бұрын
Did not take a break for an hour and 20 mins so committed :) excellent video
@ajaynorman8141
@ajaynorman8141 7 күн бұрын
Its an amazing tutorial! Really really good. Clear articulation and reasoning behind every line
@regisgesnot6840
@regisgesnot6840 2 ай бұрын
I very rarely comment a video. It was very clear, good flow to understand. Thanks a lot
@alejandro_ao
@alejandro_ao 2 ай бұрын
i appreciate it :) i hope you learned a lot! keep it up!
@davidtindell950
@davidtindell950 2 ай бұрын
Yes! We did learn a lot about the latest version of LANGCHAIN!! Thank You!!!
@alejandro_ao
@alejandro_ao 2 ай бұрын
it is my pleasure! stay tuned for more :)
@yanbinhei8673
@yanbinhei8673 3 ай бұрын
I like your style, warm and peaceful
@alejandro_ao
@alejandro_ao 3 ай бұрын
i am very warm and peaceful indeed
@OkayNoway
@OkayNoway 2 ай бұрын
underrated content, edit: forgot to say thanks, was too focused with your content, Thanks!
@alejandro_ao
@alejandro_ao Ай бұрын
thank you! i really appreciate it :)
@smzhd9642
@smzhd9642 2 ай бұрын
such a gem this video is .... i don't know why your tutorials are not on trending page ..... Bro you are just awesome 🔥🔥🔥🔥🔥🔥
@alejandro_ao
@alejandro_ao Ай бұрын
thank you!! hopefully i'll get there someday 🥲
@MarkOBrien-ue4vg
@MarkOBrien-ue4vg 14 күн бұрын
Fantastically clear and methodical walkthrough. Keep it up!!!
@alejandro_ao
@alejandro_ao 11 күн бұрын
Thanks, will do!
@student7261
@student7261 3 ай бұрын
Wow....seriously great tutorial....keep up the good work..👍
@alejandro_ao
@alejandro_ao 3 ай бұрын
Thank you so much 😀 let me know what other topics/libraries you would like to see covered
@azharmahmood7800
@azharmahmood7800 Ай бұрын
Exceptional clarity, keep it up👍
@alejandro_ao
@alejandro_ao Ай бұрын
thanks, will do!!
@AB-kb8yv
@AB-kb8yv 3 ай бұрын
Thank you, very helpful!! Will be interesting a video like this with the implementation of Mixtral.
@alejandro_ao
@alejandro_ao 3 ай бұрын
how are you reading into my mind?
@ThubaMamba
@ThubaMamba 7 күн бұрын
Learnt a lot from this tutorial. Thank you Alejandro.
@alejandro_ao
@alejandro_ao 7 күн бұрын
you're welcome!
@user-im3zw4ge7b
@user-im3zw4ge7b 3 ай бұрын
Man you're awesome! Some day I'll be too
@alejandro_ao
@alejandro_ao 3 ай бұрын
you're already awesome my friend, keep it up and keep improving every day! 💪
@FahadKiani1
@FahadKiani1 Ай бұрын
the GUI tutorials are fire - God Bless
@levinkrieger8452
@levinkrieger8452 2 ай бұрын
I was very impressed by your tutorial and your style of explaining. I am currently starting to dive deeper into AI, so this was very helpful to me :D
@alejandro_ao
@alejandro_ao 2 ай бұрын
i'm so happy to hear this! keep it up!
@levinkrieger8452
@levinkrieger8452 2 ай бұрын
@@alejandro_ao I will, thank you :)
@craftedbysrs
@craftedbysrs Ай бұрын
You are an amazing mentor. The way you explain is far better than university professors. Hope to learn more from you. Make more videos on this kind of AI app Development, Please.
@alejandro_ao
@alejandro_ao Ай бұрын
thank you man, i won't stop!
@touchthesun
@touchthesun 2 ай бұрын
This is great, thanks so much for sharing this with us!
@alejandro_ao
@alejandro_ao Ай бұрын
my pleasure!
@moglimogify
@moglimogify 8 сағат бұрын
Easy to follow, thank you
@AIdevel
@AIdevel 3 ай бұрын
Thank you so much for your amazing videos , this one in particular is outstanding as far as RAG is concerned , you are a real master in gen AI , I do find your videos tremendously helpful , keep on making them cheers from Saudi Arabia 😍😍😍💯
@alejandro_ao
@alejandro_ao 3 ай бұрын
i appreciate it! i'm glad that you're finding these useful :) i have many more coming
@walberc
@walberc 3 ай бұрын
Great work. Could you please make a vídeo about chainlit usage also?
@Mahammad_Nabi_D
@Mahammad_Nabi_D 2 ай бұрын
Great tutorial! I'm a new subscriber and found it really helpful. I'm interested in using the Pinecone vector database for my projects. Could you please provide some guidance on how to get started with it? Any tips or resources would be greatly appreciated. Thank you!
@Matepediaoficial
@Matepediaoficial 26 күн бұрын
Great video!! Thanks!
@joaosantos1294
@joaosantos1294 3 ай бұрын
Great video, u rock!! Waiting for a "Chat with any database using Python and Langchain" 💯💯
@alejandro_ao
@alejandro_ao 3 ай бұрын
Thanks! Coming soon!
@matten_zero
@matten_zero 2 ай бұрын
I think LlamaIndex has a MongoDB loader and JSON_query_loader.
@phoenixx9545
@phoenixx9545 14 күн бұрын
hey Alejandro, thanks for your video! This project is my first side project! I reaally appropriate your amazing job! If you are looking for the idea for next tutorial, the text-to-mindmap maybe a good idea!
@alejandro_ao
@alejandro_ao 11 күн бұрын
hey there! i'm glad you enjoyed the project. that sounds like a fun idea, I will probably me doing something like that in the future. Maybe something using knowledge graphs?
@nadiaboudjemline8104
@nadiaboudjemline8104 Ай бұрын
Thank you very much, I have a chatbot project and your video helps me a lot. Best wishes
@alejandro_ao
@alejandro_ao Ай бұрын
good luck with your project!
@nadiaboudjemline8104
@nadiaboudjemline8104 Ай бұрын
@@alejandro_ao Thank you
@adafina
@adafina 3 ай бұрын
Thanks! Your video is great and has very useful info.
@alejandro_ao
@alejandro_ao 3 ай бұрын
thank you! i'm glad it was useful. also, thank you for the tip!
@smtabatabaie
@smtabatabaie Ай бұрын
Awesome video thanks, one question, once it is deployed on a server, does it also run the chunks,embeddings,vector stores part each time a user loads the page, or will only be called at the time it is starts to run on the server? Thanks again
@alejandro_ao
@alejandro_ao Ай бұрын
hey there! yes it does! you would have to set up a persistent data store for it to be able to keep your data. you can do this in your own server or use a hosted service such as Qdrant Cloud or Pinecone
@maria-wh3km
@maria-wh3km 2 ай бұрын
Thanks for this app, you are awesome!
@alejandro_ao
@alejandro_ao 2 ай бұрын
you are awesome!
@seshuyt
@seshuyt Ай бұрын
Great video, thanks for doing it for us.
@alejandro_ao
@alejandro_ao Ай бұрын
i’m glad you appreciate it :)
@user-dv7qw7vt6n
@user-dv7qw7vt6n 2 ай бұрын
great tutorial - thanks so much!
@alejandro_ao
@alejandro_ao 2 ай бұрын
Thanks! Glad it was helpful!
@NasserTabook
@NasserTabook 2 ай бұрын
Great video, thank you for the hard work.
@alejandro_ao
@alejandro_ao 2 ай бұрын
thank you, i appreciate it! i will be putting more of these :)
@teddyperera8531
@teddyperera8531 5 күн бұрын
Amazing content as always. I have a request: Could you create a tutorial on creating a vector database with PDF files and using LangChain to query on it?
@draaken0
@draaken0 2 ай бұрын
Excellent video. But just for suggestion can you make video on how do we deploy the same code using some microservices like fastapi? As most of your videos are using streamlit ( I actually learned a lot about streamlit 😅) but in case of simple app deployment on even localhost with fastapi or flask will be very helpful.
@rachmanmohammad6210
@rachmanmohammad6210 2 ай бұрын
love your content !
@alejandro_ao
@alejandro_ao Ай бұрын
you are the best
@rickgeyer9685
@rickgeyer9685 3 ай бұрын
Also would this site work with an open source model like Mixtral?
@fbravoc9748
@fbravoc9748 3 ай бұрын
What a great tutorial!!! Really enjoyed it!! New subscriber here!! Only one question...just for testing purposes I used the chat to ask if he could answer topics different from the context of the websites I was chatting with, and it did. It even wrote code for me. Is there a way to restrict the app to only answer about the content of the website we are chatting with and not other questions? Thanks for the amazing video
@alejandro_ao
@alejandro_ao 3 ай бұрын
hey there, welcome onboard! yeah, that's on of the main complications of creating rag applications. i have seen several ways of dealing with this. you might want to try some of these: 1. the main thing to do to control this issue is to add a restrictive instruction to your initial prompt. so you would have to add something like this: "Don’t justify your answers. Don’t give information not mentioned in the CONTEXT INFORMATION" 2. to go even further, you can fine-tune your model with some of these edge cases. 3. lastly, a more complex approach would be to add a "policing" ai to read the main ai's answers and decide wether to accept them or not. this is, of course, more expensive and complex.
@fbravoc9748
@fbravoc9748 3 ай бұрын
@@alejandro_ao thanks for the quick answer
@ziangliu7866
@ziangliu7866 2 ай бұрын
Great video! subscribed and liked. Just one part that I could not understand. the stuff_documents_chain tasks input and context. How is the context being passed from retriever_chain to stuff_documents_chain? Dose LangChain just defined that creste_retrieval_chain can pass context from the first argument to the second?
@alejandro_ao
@alejandro_ao 2 ай бұрын
hey there! welcome to the club! yeah that's exactly what is happening. we are using a prebuild chain that does the `.invoke('{"context": [...]"})`by itself without us having to call the variable. if you look at the prebuilt chain's source code, you will see that it is calling the invoke method inside the runnable. i will make a future video creating chains ourselves so that this is easier to understand!
@felixkuria1250
@felixkuria1250 Ай бұрын
Good work 👏👏 Can you do one tutorial illustrating how you can implement the same in flask or fastapi
@InTheFuturePod
@InTheFuturePod Ай бұрын
Very helpful
@siavoshoon
@siavoshoon 3 ай бұрын
Great video. Thank you.
@alejandro_ao
@alejandro_ao 3 ай бұрын
thanks!
@vanessamacias2331
@vanessamacias2331 3 ай бұрын
Hi, your videos are excellent! You have saved me more times than I can count. I have a question, if instead of streamlit, we are using a flask server, how can I deal with the st.session_state? What about production, would it look the same as your script?
@alejandro_ao
@alejandro_ao 3 ай бұрын
hey vanessa! thanks! that is exactly the way to go for a more professional app. in this video, i am using session_state because i am doing everything in the front end, which is good for POC and showcasing the app. but ideally, you would have your API in flask with all the logic there and the front end interacting with it. in your API, you would have your controller that initializes your vector store from a persistent database. this API would expose an endpoint such as `get_response(user_query, chat_history)`. and your front end would make calls to this endpoint. so there would be no need to put your vectorstore in the front end (st.session_state) since it would be dealt with in flask. the only thing that you would take track of in the front end would be things related to the session, like the chat history. you can join the discord server too and maybe we can help you a bit more 👉 link.alejandro-ao.com/discord
@satyaviswapavanranga5915
@satyaviswapavanranga5915 3 ай бұрын
Hey! Great video! i have one doubt at 21:50 why did you use if condition for chat_history to be in session_state ? why not use directly?
@alejandro_ao
@alejandro_ao 3 ай бұрын
great question! remember that every time something happens in your application (you enter a value into a field, press a button, etc), streamlit runs the whole code again. let's call this a streamlit cycle. st.session_state is used to keep the values across each cycle. we test the condition before assigning the value because otherwise we would be running `st.session_state.chat_history = []`on every cycle, effectively reinitializing it every time and defeating the purpose of having a session state altogether... so we test if the variable is already defined in the session state on every cycle. if it is already there, it means it has some information so we should not reinitialize it. try testing the app without testing for this condition to see how this changes. i hope it is clear!
@satyaviswapavanranga5915
@satyaviswapavanranga5915 2 ай бұрын
@@alejandro_ao thank you so much for taking time and explaining it clearly! Can I ask you one more question off topic? How are the GPT’s from GPT builder different compared to these RAG applications?
@tanmayjagtap78
@tanmayjagtap78 2 ай бұрын
Hey Alejandro. I tried to deploy Chatwithpdf app to stream lit but its not working. whenever I upload pdf and start processing its starts to download weights. I am using huggingface APIs instead of OpenAI. Does streamlit has any sort of limitation ? IF yes is there any way I can perform this task without downloading weights just like OpenAI APIs?
@anitasharmaist
@anitasharmaist Ай бұрын
awesome tutorial!
@alejandro_ao
@alejandro_ao 29 күн бұрын
Thank you!
@funmiemore194
@funmiemore194 2 ай бұрын
Thank you...Thank you so much..Definitely learnt a lot. Got to create my first AI app!!!!
@alejandro_ao
@alejandro_ao Ай бұрын
you are amazing! keep it up!
@funmiemore194
@funmiemore194 Ай бұрын
@@alejandro_ao Thanks!
@moltak1453
@moltak1453 2 күн бұрын
Does it also have access to subpages (hyperlinks) that are at the main website?
@jingyao2997
@jingyao2997 3 ай бұрын
Hi, many thanks for the amazing tutorial video. May I ask what extensions you were using to make code suggestions?
@alejandro_ao
@alejandro_ao 3 ай бұрын
hey there, thanks! i was using github copilot, it's just amazing how good it is
@jingyao2997
@jingyao2997 3 ай бұрын
Many thanks!@@alejandro_ao
@SF-gn6uw
@SF-gn6uw 3 ай бұрын
love this guy
@alejandro_ao
@alejandro_ao 3 ай бұрын
i'm sure he loves you too
@alexiojunior7867
@alexiojunior7867 27 күн бұрын
wow this is a great resource🔥
@alejandro_ao
@alejandro_ao 27 күн бұрын
🔥
@alexiojunior7867
@alexiojunior7867 27 күн бұрын
what if you wnat to scrape all the data in all links in the webpage nt just using data from one page of the website
@alejandro_ao
@alejandro_ao 26 күн бұрын
@@alexiojunior7867 that's going to require more sophisticated crawling. i would go for browserless od puppeteer to make this work
@PerfectArmonic
@PerfectArmonic 3 ай бұрын
Great tutorial! ❤ Do you mind if you would tell what intellisense extension do you use in your vs code? Please? 😊
@alejandro_ao
@alejandro_ao 3 ай бұрын
thanks! i'm using github copilot. it's great :)
@hiper2d
@hiper2d 3 ай бұрын
Hey, good video, thank you for your work. Have you tried visual recognition instead of using RAG over site's http? I saw some attempts to give an LLM an ability to navige though a site using Puppeteer and recognize pages' content from screenshots. To me the quality of the recognition appeared to be too low but this is a viry interesting way of doing the web scrapping and chatting with the collected data. How good do you find the quality of your approach?
@alejandro_ao
@alejandro_ao 3 ай бұрын
that would be sick. this approach is pretty much for a single HTML file. but yeah, technically i guess it is possible to use a vision api like openai's gpt4-vision and plug it into an agent that would use puppeteer to navigate the site. it would be a one-fit-all scrapper. because usually, when you want to scrape a site, you have to check its structure and target what you want to scrape manually. let me know if you make the puppeteer thing, it sounds cool
@hiper2d
@hiper2d 3 ай бұрын
​@alejandro_ao Well, this is not my idea. I met it first in this video: kzbin.info/www/bejne/jJa0g2RtoJyZn7c I coded my version of the same idea to grab a list of new horror movies from one torrent tracker. Just to keep track of what new horrors are released. I was not satisfied with the recognition results. There was some room for improvement but I decided to switch to a different project. Later I met a continuation of this idea. It is possible to highlight links and buttons on a screenshot (also with Puppeteer) and let an LLM function to click on them. That sounds really interesting but this I haven't tried myself.
@sleepwonder5302
@sleepwonder5302 3 ай бұрын
Awesome job man! Just a question, can this work with forum-like site with multiple internal pages?
@simonsays...5061
@simonsays...5061 3 ай бұрын
Thats what Im very curious about. I made a pdf webscraper for mining documents to train a model, but i could only get it to pull the ones on the actual page the url directed to specifically. Wondering if theres a technique for automatically searching through all the pages associated with the original url. Im sure there is, I'm just a programming noob so im learning best I can.. ✌️
@alejandro_ao
@alejandro_ao 3 ай бұрын
hey there! there is a way indeed, but it is a bit more complex. you would have to either: 1. have access to the website database. this way is simpler because you would just have to apply a RAG algorithm to a database. 2. scrape the website. this is more complex, as it requires using something like python's beautifulsoup to scrape the contents of the entire website. but beware because some websites don't allow bots (sometimes they can even try to get you in trouble). a no-code tool for scraping that is very good is octoparse, but know that this is on the edge of what is allowed and they have had several lawsuits in the past for making scraping so easy.
@haiderkhalilpk
@haiderkhalilpk 3 ай бұрын
Awesome!
@alejandro_ao
@alejandro_ao 3 ай бұрын
you are
@ChhatreMihir
@ChhatreMihir 2 ай бұрын
Question - If retrieval chain is already finding the most relevant documents chunks based on conversation history and user's input and passing it through the {context}, what is the need to integrate retrieval chain using "create_retrieval_chain(retriever_chain, stuff_documents_chain)"
@vivayan
@vivayan 2 ай бұрын
Hey pretty cool of your video! Like it! BTW could you suggest which plugin you're using for the auto-code-completing feature? Looks very useful to me. Thx!
@vivayan
@vivayan 2 ай бұрын
I figured it out by installing plugin "Continue". Thx anyway.
@alejandro_ao
@alejandro_ao 2 ай бұрын
hey there! sure thing. i don't know about 'continue', but i am using gh copilot. how good is continue?
@vivayan
@vivayan 2 ай бұрын
I compared it a bit by following your video and turned out most of the time I could get similar code prediction as gh copilot did. Only sometimes it focused more on correcting the word but not giving the correct package name within a module. I can still fix it by debugging. So overall, Continue is good and enough for me, and free!@@alejandro_ao
@officialseethesky
@officialseethesky 3 ай бұрын
wonderful!
@alejandro_ao
@alejandro_ao 3 ай бұрын
you are
@Amr-Ibrahim-AI
@Amr-Ibrahim-AI 23 күн бұрын
Thank you Alejandro for your clear and insightful tutorials. They are much appreciated. I remade your full solution and it's working like a charm. However, when I ask it a question that's outside of the context of the webpage (like: What's the capital of France?, for example), it still answers. How can I ground it to answer only from the context? i tried to add the following to the system prompt of the get_conversational_rag_chain: ("system", "Answer the user question based on the below context. If the context does not contain the answer, do not make up an answer and respond with \"I am sorry I cannot answer this out-of-context question!\": Context:{context}") However, it still answers irrelevant questions. What do you think?
@davidoktavianusmendrofa2631
@davidoktavianusmendrofa2631 29 күн бұрын
Hi, thank a lot for your sharing. And also I want to ask about error message APIConnectionError: Connection error while running Chroma.from_documents(""chunkc","embeddings"). Here I use AzureOpenAIEmbeddings.. how to solve this error? thanks for helping.
@guanjwcn
@guanjwcn 3 ай бұрын
Thank you for the great video. Could you do a video showing how to add in the streaming feature?
@alejandro_ao
@alejandro_ao 3 ай бұрын
it's coming soon!
@abhishekmukundan8617
@abhishekmukundan8617 3 ай бұрын
@alenjandro_ao can you suggest some open models that can be used instead of openai models for this particular used case?
@alejandro_ao
@alejandro_ao 3 ай бұрын
hey there! go for mixtral, those guys are on fire. even mixtral-8x7B is just amazing and super lightweight!
@mainakseal5027
@mainakseal5027 2 ай бұрын
awesome sirji
@alejandro_ao
@alejandro_ao Ай бұрын
thank you sir
@Jassu-xj7hl
@Jassu-xj7hl 2 ай бұрын
Great video 👍👍👍
@alejandro_ao
@alejandro_ao 2 ай бұрын
Thank you 😊
@thomasgaye7580
@thomasgaye7580 2 ай бұрын
Awesome course Alejandro! By the way, I'm having issue with installing "Chroma" See....I'm getting "ERROR: Failed building wheel for chroma-hnswlib"
@sharonmachlisgartenberg3953
@sharonmachlisgartenberg3953 3 ай бұрын
Thanks for sharing! Suggestion: It would be great if the app would also include a way for the user to see the text chunks used to generate the answer, so people can check that the answer is accurate and not either hallucinated or taken from knowledge the AI has from elsewhere. Unfortunately, I've seen too many RAG apps where either answers are inaccurate or the LLM is responding based on other knowledge and not the documents it's supposed to use.
@alejandro_ao
@alejandro_ao 2 ай бұрын
hey there Sharon! thanks for the suggestion! i will mention how to do this in a future video. it has changed a little since the introduction of LCEL, so it would be a very good topic to cover :)
@ChatbotsGPT
@ChatbotsGPT 3 ай бұрын
Hola, he seguido casi todos tus tutoriales, son magnificos y tus explicaciones muy claras y precisas, no hablo mucho ingles asi que entre mira la traduccion y mira el video, jaja, entretenido. he aprendido mucho, muchas gracias de verdad, solo una pregunta, solo funciona con chatgpt 4 o se le pude poner chatgtp 3.5?. saludos desde Mexico
@alejandro_ao
@alejandro_ao 3 ай бұрын
Hola! Qué gusto saber que te hayan sido útiles estos videos :) De hecho, en el ejemplo del video, estamos usando el modelo gpt-3.5-turbo porque es el que Langchain usa por defecto. Si quieres usar gpt-4, tienes que indicar al inicializar tu LLM que quieres otro modelo. Así: llm = ChatOpenAI(model='gpt-4-0125-preview'). Sigue así! Puedes unirte al servidor de discord para participar en la comunidad si quieres. Está en inglés, pero no todos allí hablan inglés como lengua materna 👉 link.alejandro-ao.com/discord
@ChatbotsGPT
@ChatbotsGPT 3 ай бұрын
@@alejandro_ao Muchas gracias maestro, nos veremos por discord. que todo el bien que haces enseñando, se te multiplique
@oludelehalleluyah6723
@oludelehalleluyah6723 Ай бұрын
Hi. Thanks for the very nice tutorial, how do you create those beautiful flow diagrams? Is there an app that you use?
@alejandro_ao
@alejandro_ao Ай бұрын
that's miro.com/ but i have since switched to excalidraw.com/ (example here: kzbin.info/www/bejne/oXO7inmXj5V4hJI ) both have a free tier
@oludelehalleluyah6723
@oludelehalleluyah6723 Ай бұрын
@@alejandro_ao Thanks a lot
@officialseethesky
@officialseethesky 3 ай бұрын
waiting for the next video
@alejandro_ao
@alejandro_ao 3 ай бұрын
coming very soon!
@dlunlun7073
@dlunlun7073 Ай бұрын
Thanks for the video, it's great stuff. Wonder if you can do these videos with Gemini LLM, the LLM and embeddings are free as far as I can tell. I somehow made it work by watching your video, thanks man.
@alejandro_ao
@alejandro_ao Ай бұрын
hey there, that's a great idea. good that you made that work. i was going to use them for a video a few weeks ago, but then realized that i needed to set up a vpn before recording. these models were not available in the eu when i checked a few weeks ago (great)... so i got lazy and went for openai. i will set up this vpn thing (or move out of europe) :P
@digitalchild
@digitalchild 3 ай бұрын
How would you handle streaming with the response ? I The docs aren't exactly clear on how to achieve this when you aren't using LCEL and the new syntax.
@alejandro_ao
@alejandro_ao 3 ай бұрын
i agree with that, i'm working on a video about precisely this! it is a little trickier to deal with this in streamlit, but it can be done. i would think this feature is more aimed at more sophisticated front-end frameworks such as react, though
@sebastien3535
@sebastien3535 3 ай бұрын
Salut, super tuto !! Beaucoup de concepts se sont éclaircis grace à ce tuto. Prévois tu d'en faire un sur lang graph? Qui a l'air un peu plus complexe.
@alejandro_ao
@alejandro_ao 3 ай бұрын
salut ! merci ! en effet, je vais bientôt aborder LangGraph dans quelques tutos :) n'oublie pas de t'abonner pour recevoir les notifs :)
@user-gi6pv7xf6e
@user-gi6pv7xf6e 3 ай бұрын
Thank you for the great explanation. 🙏 I have two questions: 1. At some point the context window of the llm will be exceeded, how can I deal with that? 2. You used the llm with the context retrieval chain to get the query. Is there a way to get the query without using the llm? In this way the app would be a bit faster and some extra costs would be avoided. Thanks in advance
@alejandro_ao
@alejandro_ao 3 ай бұрын
Hey there, thanks for these questions. And sorry about the late reply, i was sick last week. 1. Yeah, as soon as your conversation becomes too long, you will exceed the context window. To fix this, you can use one of LangChain's memory classes. In short, they allow you to summarize the history of a conversation instead of sending the entire history in your prompt. Something like: "we are talking about .... and this and that was considered. Now answer the following question based on this context...". There are several ways to summarize a conversation (entity memory, buffer memory, etc) Here are the docs: python.langchain.com/docs/modules/memory/types/ 2. Good point. You could make your own chain that will make its own similarity search. But the problem here is that if your conversation is too long, then your similarity search will not be as efficient as if you had summarized it with a query beforehand. I suppose you can test both and see which one works best for your app. Because you're right, we are basically making 2 LLM requests for every user query here. Let me know if this helped!
@user-gi6pv7xf6e
@user-gi6pv7xf6e 3 ай бұрын
@@alejandro_ao no worries at all! I hope you're feeling better now. Yeah this answers my questions. Using langchain's memory classes would be better than just asking the user to start a new chat. I'll take a look at the documentation. Thank you and have a great day 🙏 Looking forward for your new videos :)
@alejandro_ao
@alejandro_ao 3 ай бұрын
@@user-gi6pv7xf6e thanks! have a good one!
@2glory
@2glory 3 ай бұрын
Thanks!
@alejandro_ao
@alejandro_ao 3 ай бұрын
thank you! you are amazing
@easysolution8208
@easysolution8208 22 күн бұрын
i like you learning and implementing style can you guide how i improve my learning speed in this dynamic tech world
@shivparashar2413
@shivparashar2413 2 ай бұрын
Great video, can we pass multiple website URLs like 2 or 3
@artislove491
@artislove491 3 ай бұрын
Excellent tutorial, awesome. Many Thanks! If you are able to show how to work with multimodal searches on uploaded PDF's with text and images and how to use private LLMs like OLLAMA that would be great 💪.
@alejandro_ao
@alejandro_ao 3 ай бұрын
i have been meaning to do videos on local LLMs indeed. have you tried mixtral?
@artislove491
@artislove491 3 ай бұрын
@@alejandro_ao hi. No, there are so many models and the evolution of each is advancing is fast, it’s hard to keep up as a noob. Happy to see a video on mixtral, a particular focus on image querying would be amazing. 🙏
@rolaina
@rolaina 25 күн бұрын
How can i use streamlit stream feature in this example ?
@matthiasandreas6549
@matthiasandreas6549 3 ай бұрын
Hi Alejandro, thanks for your videos, your videos helps me to solve my first steps in use of LLM models. Please is it possible, that you show some solution of your last Langchain videos but as GPU version, how to run ChatBot with own PDF on GPU? Thanks alot.
@alejandro_ao
@alejandro_ao 3 ай бұрын
hey Mathias, thanks mate, it means a lot! sure thing, i'm very glad that you share these video ideas that can be super useful to the community! i'll be working on a video about it!
@yazanrisheh5127
@yazanrisheh5127 3 ай бұрын
Please continue this and do a part 2
@alejandro_ao
@alejandro_ao 3 ай бұрын
what would you like to see in part 2? btw, you're hereby invited to join our Discord community: link.alejandro-ao.com/discord I hope to see you there!
@ifeolu8501
@ifeolu8501 10 күн бұрын
You are a rare gem. I really appreciate your knowledge sharing. Please help us release video that uses natural language to SQL and we can connect to WhatsApp. To make things more exciting that we can load image from WhatsApp to our database.
@chibuzoemelike6403
@chibuzoemelike6403 3 ай бұрын
This is so cool, thank you so much. Can this be applied to database with so many views or tables so you can ask questions and it's intelligent to perform joins to bring the answer? It will be interesting to see if it's possible or create a video. Thank you so much
@alejandro_ao
@alejandro_ao 3 ай бұрын
that's a great idea. i would build an agent do achieve that. i'll plan a video about that :)
@divyanshu_dubey
@divyanshu_dubey 20 күн бұрын
Great content buddy ! One question , how can we connect this chatbot to apps like WhatsApp ?
@akshaysdanthi7563
@akshaysdanthi7563 3 ай бұрын
On what basis does RecursiveTextSplitter split the document into chunks? The chunks don't seem to be of similar sizes.
@alejandro_ao
@alejandro_ao 3 ай бұрын
great question! this text splitter takes the text and breaks it down by section, then by paragraph, then by sentence. on each step, it checks if it's within the chunk_size parameter (default is 4000 characters), and if it is, then it leaves the chunk as is. it is like this that our text splitter got our intro paragraph in a single chunk. and it then got larger chunks for the rest of the html document. hope this helps!
@akshaysdanthi7563
@akshaysdanthi7563 3 ай бұрын
​@@alejandro_ao thank you !! waiting for your next video! (preferably with some free LLM)
@Travller211
@Travller211 3 ай бұрын
Please make an video for langchain evaluators that how can we use them using huggingface it would be helpful for us
@rickgeyer9685
@rickgeyer9685 3 ай бұрын
Great video! A suggestion for next is to combine retrieval from a site, combined with PDF documents. Also, it might be useful to spider a whole site. Thanks for the great work!
@alejandro_ao
@alejandro_ao 3 ай бұрын
thanks! yeah totally, we could technically combine many of these apps together and make a supercharged local llm app.... that's giving me ideas for an open source repo
@joseiltonmota9835
@joseiltonmota9835 3 ай бұрын
@@alejandro_ao About this, could you make a video to explain the diference between the PDF code and this?
@TonyStark-sc5hu
@TonyStark-sc5hu 2 ай бұрын
yeah that would be very helpful@@joseiltonmota9835
@nj_droidtech
@nj_droidtech 3 күн бұрын
How can i build this without showing the sidebar(url input), only the chat UI?
@mohsenghafari7652
@mohsenghafari7652 2 ай бұрын
❤❤❤
@meetvasa6955
@meetvasa6955 Ай бұрын
Please Mate can you upload videos about Agents , Function calling lansmith and langserve .....Also how to create user data personalized llm's
@srinivasvamshi5410
@srinivasvamshi5410 Ай бұрын
Hi can we use opensource Ollama llama2 or mistral ??
@alejandro_ao
@alejandro_ao Ай бұрын
absolutely. just initialize ollama and import it like this: python.langchain.com/docs/integrations/chat/ollama/
@albertogonzalezpascoe6937
@albertogonzalezpascoe6937 2 ай бұрын
Hi, I think there's a little error on line 66: "input": user_query; it must be "input": user_input, doesn't it?
@alejandro_ao
@alejandro_ao 2 ай бұрын
you are right! currently, it is working because it's getting the `user_query` variable from the wider scope. but it should be using the function param instead or it will stop working as soon as you modularize the app. thanks! i will push the corrected code in a moment :)
@shaquibkhan1609
@shaquibkhan1609 3 ай бұрын
It looks interesting. 👌 But One question: Can I give any website link into it and ask for the best keys used for this website (like using it for digital marketing concepts)
@alejandro_ao
@alejandro_ao 3 ай бұрын
i suppose you can! although i would think that this requires a different approach than using a LLM. you might need other NLP algorithms to deal with this. maybe some pipeline that strips your corpus of text, removes filler and useless words and gets the main words. it then could generate a bag of words for the keywords of your website. check it out, you can do all of this with python ;)
@user-im3zw4ge7b
@user-im3zw4ge7b 3 ай бұрын
Friend, could you teach me how to receive a data stream from OpenAI with langchain through document analysis? I swear I've put a lot of effort into figuring it out, but I'm struggling a bit with the language and the new documentation 😢
@alejandro_ao
@alejandro_ao 3 ай бұрын
hey my friend, sure thing. but i'm not sure i can help more without more info. why don't you bring that up in our discord server? maybe we can help you out there: link.alejandro-ao.com/discord
@shivanshuoliyhan
@shivanshuoliyhan 3 ай бұрын
Is openai api key free to use or do we need to add credit card info ?
@alejandro_ao
@alejandro_ao 3 ай бұрын
you will need a credit card to use it. we are using 2 models here: - the LLM: gpt-3-turbo - the embeddings model : text-embedding-ada-002 however it's like 2 cents per question and as long as you are not embedding like a hundred textbooks, the cost for using OpenAI's embeddings should be insignificant. but keep track of your expenses in the OpenAI dashboard on the tab "usage". you can also add monthly limits to keep your expenses under control.
@amrinderrandhawa6799
@amrinderrandhawa6799 3 ай бұрын
What is the Microphone model you use in your videos ? And please share the camera details as well. thnx
@alejandro_ao
@alejandro_ao 3 ай бұрын
hey there, the mic is a simple TnB SC 420 USB that I borrowed from a friend. But i'm buying an audio technica at2020 very soon. And the camera is just my iPhone 13 :) I do much more post prod recently than in earlier videos, mostly with the audio, though
@Digital__Insights
@Digital__Insights 3 ай бұрын
Awesome thanks.
@jamalnuh8565
@jamalnuh8565 3 ай бұрын
This guy is a legend
@alejandro_ao
@alejandro_ao 3 ай бұрын
nah you are
@mohammadumair6858
@mohammadumair6858 28 күн бұрын
For anyone looking to chat with a website---- It’s a whole lot of work when you want to dynamically ‘crawl’ the website and then kind of repeat the same process which is happening here in theory. But remember-- ‘Finding Needle is a haystack’ would be the the limitation of such project. It depends on the depth and complexity of the question, and obviously how experienced you are with web scraping and crawling. market solutions won’t provide you a generic scraping tool available for all websites.
@mohammadumair6858
@mohammadumair6858 28 күн бұрын
I recently finished a POC of such project, the tech used is as follows- Langchain, Scrapy, Unstructured, Open ai(gpt-4), OpenSearch, Gemma, but still the results vary on your use case, and what you are trying to achieve. The question prompt like - explained this, what is this, etc etc are easy to answer when you have dedicated paragraphs or web pages for that topic.
@99352786qwe123
@99352786qwe123 Ай бұрын
Is there a reason why on the github you changed the chromadb version to 0.3.29 from 0.4.22?
@alejandro_ao
@alejandro_ao Ай бұрын
whoops, the reason is an overlooked line in a PR 😅
@nazarmohammed5681
@nazarmohammed5681 3 ай бұрын
make a video on chating with pdf and website url both combined
Chat with MySQL Database using GPT-4 and Mistral AI | Python GUI App
1:01:00
Alejandro AO - Software & Ai
Рет қаралды 15 М.
CrewAI Step-by-Step | Complete Course for Beginners
1:07:43
Alejandro AO - Software & Ai
Рет қаралды 32 М.
Monster dropped gummy bear 👻🤣 #shorts
00:45
Yoeslan
Рет қаралды 13 МЛН
😱СНЯЛ СУПЕР КОТА НА КАМЕРУ⁉
00:37
OMG DEN
Рет қаралды 1,8 МЛН
маленький брат прыгает в бассейн
00:15
GL Show Russian
Рет қаралды 4,1 МЛН
26 Incredible Use Cases for the New GPT-4o
21:58
The AI Advantage
Рет қаралды 143 М.
LangChain Explained in 13 Minutes | QuickStart Tutorial for Beginners
12:44
Chat with Multiple PDFs | LangChain App Tutorial in Python (Free LLMs and Embeddings)
1:07:30
Alejandro AO - Software & Ai
Рет қаралды 411 М.
RAG + Langchain Python Project: Easy AI/Chat For Your Docs
16:42
Stream LLMs with LangChain + Streamlit | Tutorial
18:26
Alejandro AO - Software & Ai
Рет қаралды 14 М.
Reliable, fully local RAG agents with LLaMA3
21:19
LangChain
Рет қаралды 72 М.
Chat with a CSV | LangChain Agents Tutorial (Beginners)
26:22
Alejandro AO - Software & Ai
Рет қаралды 56 М.