LangChain is AMAZING | Quick Python Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025

ความคิดเห็น • 76

  • @ArjanCodes
    @ArjanCodes  ปีที่แล้ว

    👷 Join the FREE Code Diagnosis Workshop to help you review code more effectively using my 3-Factor Diagnosis Framework: www.arjancodes.com/diagnosis

  • @NGrimthrie
    @NGrimthrie ปีที่แล้ว +30

    This is great. Would you consider doing a video on ways to extend the models beyond their training cutoff dates? Possibly using vector databases and LangChain's document parsers?

  • @jumper0122
    @jumper0122 ปีที่แล้ว +4

    I must have missed that survey -- I would love to see more content about databases and best-practices with them. Like using SQLAlchemy efficiently and whatnot. I do a lot of web scraping and it was only this year that I graduated from heinously large JSON files to proper databases

  • @drag0zu
    @drag0zu ปีที่แล้ว +7

    Great video, i would really like to see how a Database Content + Model can be integrated into an LLM application (can be also GPT4all i think), so users can then ask stuff about the DB content.

    • @animelover5093
      @animelover5093 ปีที่แล้ว +1

      Been thinking about this as well recently 🤔

  • @malgindesilva2758
    @malgindesilva2758 ปีที่แล้ว

    This is very simple yet informative into Ajan, love your videos

  • @bharatkundapur
    @bharatkundapur ปีที่แล้ว +1

    can not wait for your long-chain tutorials.

  • @kaiohenriqueps
    @kaiohenriqueps 2 หลายเดือนก่อน

    This video got me so excited about studying LLM more. Thank you a lot, sir! 🙏🏽❤️

    • @ArjanCodes
      @ArjanCodes  2 หลายเดือนก่อน

      You’re welcome!

  • @aungkyawkyaw9114
    @aungkyawkyaw9114 ปีที่แล้ว

    Do all the more on all topics please. Never stop.

  • @WirelessGus
    @WirelessGus 7 หลายเดือนก่อน

    Hey Everyone 👋
    Find the parts that interest you:
    0:00 - Introduction to Lang chain and AI content
    1:00 - Setting up a large language model object
    3:00 - Working with templates in Lang chain
    6:07 - Generating response for LM with chat prompts
    7:26 - Combining Lang chain with pedantic for output formatting
    10:02 - Accessing and utilizing formatted response data
    12:05 - Potential applications for Lang chain
    13:33 - Design patterns in Lang chain
    15:59 - Importance of defining concepts in libraries
    Recap by Bumpups ✏️

  • @TacticalTruth
    @TacticalTruth ปีที่แล้ว +1

    Looks perfect for Data Cleaning and Record Linkage.

  • @TNothingFree
    @TNothingFree ปีที่แล้ว +2

    Fantastic cover.
    A. it shows how complex it is, you need to understand the API correctly to make the maximum out of it.
    B. I just can imagine what it can do with many products, every app/web site can integrate such automatic tools which may generate ton of content.
    My favorite are infinite dungeon crawlers.

  • @paulomtts
    @paulomtts ปีที่แล้ว

    Very interesting. Thanks for the video!

  • @MicheleHjorleifsson
    @MicheleHjorleifsson ปีที่แล้ว +4

    Please Please do one on embeddings :)

  • @torstenschindler1965
    @torstenschindler1965 ปีที่แล้ว +5

    Hi Arjan, what’s your take on Max Woolf’s Blog: “The Problem with Langchain” ?
    Loading the environment variables via the os module is not necessary. It is done in the ChatOpenAI class anyhow.

    • @ivanherreros7773
      @ivanherreros7773 ปีที่แล้ว +4

      Wow.
      I truly like Arjan's content, spirit, everything. But I have to admit that the post that you've linked here is (I am very sorry to say) of more value to me than the video itself.
      Indeed, it reflects my issues when I was trying to tweak a "RAG" demo in LangChain to my use case. Namely, asking myself, "what is all this complexity good for?". The post answers: for nothing, really.
      I think that the ones who enjoyed Software Engineering content in this channel will be more inclined to see what concepts are very useful in LangChain, and then reimplement them ourselves (or find a leaner framework- it must exist somewhere).
      So, Arjan, if you read this, please take it as constructive criticism.
      And I will of course stay subscribed :)

    • @rafaeel731
      @rafaeel731 2 หลายเดือนก่อน +1

      I thought it was me being slow, but this thing is complicated. I am comfortable using vanilla responses, crafting my own systems and wouldn't be slowed down or tied up using a framework that is not adding benefit. Won't learn, thanks for the comment!

  • @InglesConConfianza
    @InglesConConfianza ปีที่แล้ว

    Great tutorial!

  • @moondevonyt
    @moondevonyt ปีที่แล้ว +1

    mad props for diving deep into Langchain
    however, the real game changer for me would be direct integration with modern frameworks
    still, your explanations? on point
    always appreciate the effort you put in, but there's always room to elevate

    • @JohnWalz97
      @JohnWalz97 ปีที่แล้ว +3

      What do you mean direct integration with modern frameworks?

    • @midprogramming
      @midprogramming ปีที่แล้ว

      I'm not too sure what he means either considering Jason Zhou and multiple researchers on Twitter already have integrated Langchain into real world products... @@JohnWalz97

  • @fuba44
    @fuba44 ปีที่แล้ว +5

    But can you run your own models? Like can I download the llama 2 from huggingface, and query it using langchain?

    • @jakecyr
      @jakecyr ปีที่แล้ว +2

      You can! You can extend the LLM class and add your own implementation for any custom model.

  • @melvingeorge2729
    @melvingeorge2729 ปีที่แล้ว

    wow! this is phenomenal :) thanks, Arjan! Also, which are the books in the shelf behind you?

  • @pypypy4228
    @pypypy4228 9 หลายเดือนก่อน +1

    This is a paragon of explanation: succinct and to the point, gradually increasing the difficulty, with an apt digression into principles and design patterns. I would love to see YOUR tutorials about LCEL - langchain chain expression language. I don't grasp the concept of RunnablePassthrough and nobody seems to explain it the way you explain the Python magic. ❤

  • @jeffrey5602
    @jeffrey5602 ปีที่แล้ว +8

    I actually enjoy the original python content the most. Especially in this AI craze I try to avoid AI content from people who weren't doing AI content before all the hype, no fence. But your great python content is what I subscribed for :)

    • @TheVengeful0ne
      @TheVengeful0ne ปีที่แล้ว +3

      same. Unsubscribing for now. He has mentioned that he gets a lot more views from these type of videos so expect more from him. =/ Feels bad to see this kind of content from Arjan as someone who is working as a tech lead in the AI space. Stick to content you are great at please. Don't try to milk the hype and alienate your original subscribers by going into an area which you have superficial knowledge or a very narrow perspective/understanding about. Encouraging the use of a very opaque + opinionated framework that you have very little control over and has a very brittle foundation just doesn't work out well in production and is a bad idea.

    • @jeffrey5602
      @jeffrey5602 ปีที่แล้ว +1

      @@TheVengeful0ne
      As a mid data scientist with a focus on NLP I could not agree more. I am watching the channel to get better at SWE. Also from what I have seen there have not been much useful applications for any of the "openai wrapper" and related tech. For most use cases I can see in my company it would be wasteful to actually use openai apis and using smaller HF models makes way more sense. Noone without an actual PyTorch/TF background should touch those use cases though.

  • @default_youtube_profile
    @default_youtube_profile ปีที่แล้ว +1

    Hello Arjan,
    What keyboard are you using ?

  • @adrianzuur5589
    @adrianzuur5589 ปีที่แล้ว +8

    One of the things about LangChain that irritates me is how when you use the ConversationChain class with memory to communicate with GPT>=3.5, it DOES NOT use the chat completion endpoint OpenAI has. Instead, it uses simple completion, formatting all of the messages in the history into a single string. I suppose this is because they want the ConversationChain to work with all sorts of LLMs, including those without a chat completion mode, but... it's not the behavior you would expect for GPT>=3.5.

    • @davidyoung623
      @davidyoung623 ปีที่แล้ว

      That is how the regular API endpoint functions as well 🤔 You have to send prior messages as part of your API call, or the endpoint doesn't know about them either 🤷

    • @manomancan
      @manomancan ปีที่แล้ว +3

      I think it's a straight-up bug!

  • @adrianobleton
    @adrianobleton ปีที่แล้ว +5

    I actually have a lot of trouble following the langchain model.
    For example, it's not clear to me why you use a human prompt and a system prompt in the country example. Wouldn't the system prompt alone be sufficient?
    For my use cases, doing a thin wrapper around the chat gpt calls is sufficient. I do use the system prompt templates though for the initial context messages.

    • @berdgg
      @berdgg 9 หลายเดือนก่อน

      Its so overly complicated. You initiate so many classes, call so many methods, and then realize at the end it just constructed a big string and called a simple API...

  • @fra4897
    @fra4897 ปีที่แล้ว +20

    langchain is actually (all love to the creator)a OOP hell and not really good

    • @Lanc840930
      @Lanc840930 ปีที่แล้ว

      I agree

    • @oc3academy
      @oc3academy ปีที่แล้ว

      I couldn't igree more

    • @PmmSoares
      @PmmSoares ปีที่แล้ว +1

      Ya, is very confusing and documentation doesn't help. There's any alternative?

    • @judgelaloicmoi
      @judgelaloicmoi ปีที่แล้ว

      Llamaindex ?

    • @chriskeo392
      @chriskeo392 ปีที่แล้ว

      Maybe too advanced for you?

  • @nuurnwui
    @nuurnwui 11 หลายเดือนก่อน

    When this video came out, I didn’t understand it. Now I do, but to me it means Arjan wasn’t quite as good at explaining as usual. Please do more on Langchain or related technologies.

  • @pypro
    @pypro ปีที่แล้ว +1

    Dude you are amazing! thanks for the content, really good to get a "best practices" view on all of these topics! thanks so much, greetings from México! let me know when you come to the caribbean (mexican) I will buy you some drinks!!

  • @hugobarretto
    @hugobarretto วันที่ผ่านมา

    Hi, could help me ? Is there any python library to IA with structure data, better If sql server ?

  • @RedCloudServices
    @RedCloudServices ปีที่แล้ว

    Is it possible to chat with langchain documentation? How would you train an LLM using Langchain documentation?

  • @svaponi
    @svaponi 10 หลายเดือนก่อน

    Does anybody have the transcript of the code? git repo maybe?

  • @aniketgninawe4963
    @aniketgninawe4963 ปีที่แล้ว

    I am working with CSV data and using create_csv_agent, looks like its facing difficulty with complex queries, any solution? Thanks

  • @Benemortasia666
    @Benemortasia666 ปีที่แล้ว

    Goud

  • @torbjrnwikestad28
    @torbjrnwikestad28 ปีที่แล้ว

    Discord invite didn't work.

  • @AmitKumar-yd1cp
    @AmitKumar-yd1cp 5 หลายเดือนก่อน

    Markville

  • @VoloInTech
    @VoloInTech ปีที่แล้ว

    💛💙👍

  • @thezachdrake
    @thezachdrake 11 หลายเดือนก่อน

    I didn't know John Greene knew how to code.

  • @pipi_delina
    @pipi_delina ปีที่แล้ว

    Can you explain llama

  • @BorrWick
    @BorrWick ปีที่แล้ว +12

    Langchain is so bad what are you saying 😅

    • @Ringoshiiro
      @Ringoshiiro ปีที่แล้ว

      Why is it bad?

    • @TheVengeful0ne
      @TheVengeful0ne ปีที่แล้ว

      yeah. A lot of people (myself included) have moved away from using it in production in our companies too because outside of its data/platform connectors it is just way too restrictive and has too many layers of unneeded abstractions for even very simple stuff. Pretty disappointing to see it being promoted here.. but hey as a content creator it makes sense to make content about the most popular thing out there. Like he mentioned in another comment here, he gets more viewers making these kinds of videos >.>
      ​ @Ringoshiiro you can easily find a lot of threads complaining about using it in prod on hackernews. There are also 2 very detailed articles from the Buzzfeed AI team diving into details of the problems langchain has

  • @Piipolinoo
    @Piipolinoo ปีที่แล้ว +7

    Please no more AI content :( the fucking space is flooded by it. it was nice having at least you talk about other stuff. please please please no more ai crap

    • @ArjanCodes
      @ArjanCodes  ปีที่แล้ว +8

      It looks like the majority of viewers disagree with you. Whenever I cover AI on the channel, the views are higher than on my other videos. I do try to keep a balance between different types of content - the last video covering AI stuff was several weeks ago.

    • @Piipolinoo
      @Piipolinoo ปีที่แล้ว +3

      @@ArjanCodes haha I totally get it, i just wanted to be the loud minority ;) Keep up the good work!

    • @ArjanCodes
      @ArjanCodes  ปีที่แล้ว +3

      No worries, and will do 😊

    • @Vanessa-vz5cw
      @Vanessa-vz5cw ปีที่แล้ว

      ​@@ArjanCodes One thing that I think would be super interesting to do that is still very related to AI but a little more general is a more general ML modelling tutorial or video that is slightly lower-level. One thing I'd love to see your take on is how to best structure code that uses mlflow (maybe fine do hugging face language model or something to still generate interest from the LLM crowd).
      I work in machine learning and mlflow is widely, but I have yet to see someone implement it while following the programming principals you explain so well on this channel. It seems to be often called out of no where during feature engineering, model training, etc. to log metadata, which makes it quite hard to test and also keep track of where it's being called and what it's logging.

  • @ermalai
    @ermalai ปีที่แล้ว +1

    I get Country is not a subclass of BaseModel, though I inherited frm BaseModel in the definition. why? raise validation_error
    pydantic.v1.error_wrappers.ValidationError: 1 validation error for PydanticOutputParser
    pydantic_object
    subclass of BaseModel expected (type=type_error.subclass; expected_class=BaseModel)

    • @edbeds
      @edbeds 11 หลายเดือนก่อน

      Me too, did you find a solution?

  • @PostMasterNick
    @PostMasterNick 7 หลายเดือนก่อน

    qq. what is a `ticktoken_model_name" @ 3:21

  • @ermalai
    @ermalai ปีที่แล้ว

    I even tried with your exact code, I still get the same error

  • @imaderraiss1609
    @imaderraiss1609 ปีที่แล้ว

    arjaound. god no.