Hey folks! This is my interview with Jacob Lee, the lead maintainer of LangChain.js and a founding engineer of the LangChain company.
This talk covers topics such as:
- what LangChain is and the benefits of using it
- a good learning roadmap for getting started with LangChain
- how other tools from the LangChain ecosystem, such as LangSmith, LangGraph, and LangServer, can help us, and much more.
In the notes of this video, you will find links to all the resources mentioned in the talk.
I would like to thank Jacob again for this interview and hope you enjoy it! Letβs get to it!
π» Mentioned Links
Below are the links metioned in during our talk:
- Jacob's Twitter profile
- LangChain documenation for JavaScript
- Build LLM Apps with LangChain.js - Depp Learning course
- LangGraph
- LangSmith
- The LangChain subreddit
π Transcript
Daniel Nastase: Hi there and welcome! My name is Daniel Nastase and I'm the author of The Lchain for JavaScript Developers book. This is my interview with Jacob Lee the main maintainer of LangChain JS and founding engineer of the LangChain company. In this talk, we go through topics such as what is LangChain and how it can help us, what is a good learning path for getting started with LangChain, how the products from the LangChain ecosystem (LangGraph, LangServe, LangSmith) work together and much more. In the notes of this video you'll find all the links mentioned during the talk thank you and I hope you like it! Let's get to it!
Daniel Nastase: hi Jacob and thanks a lot for this interview. Maybe we can start by telling us a bit about yourself like a very brief introduction
Jacob Lee: Sounds good I'm excited to be here Dan my name is Jacob I'm the lead maintainer for length chain JS and love building with LMS.
Daniel Nastase: Super and speaking about LLMs I'm I'm curious what did how was the first time you interacted with an LLM? what did what get you got you interested in LLMs
Jacob Lee: Yeah, absolutely. So I had my own startup working in basically cloud computing for the last probably six years before joining LangChain and I was ended up in a situation where I was figuring out my next move wasn't sure I wanted to do next and I was fortunate enough to find some contract work for a startup who wanted to build something with LMS and at the time I think ChatGPT had just come out it was sort of magical. It was like this amazing thing that can answer any question and I was able to you know there's a mystery at the time though around the practice and how to build with it. Like what are the actual mechanics and how does it work. I think a lot of things that are now maybe a bit clearer to the general sort of developer population were at that time a bit more opaque and I ended up using a very early version of LangChain for this contract and ended up really enjoying it, loved the experience of getting started and kind of as someone who had no experience with it working with LLMs or anything in AI really. LangChain just really opened up that door for me so of course I decided this is kind of what I want to do and what I want to work on. Started contributing myself and ultimately yeah and they're joining full-time.
Daniel Nastase: Nice, and speaking about LangChain how would you describe LangChain to someone who doesn't have has any clue what LangChain is? How would you describe it to a medium JavaScript developer? Someone who has a bit of experience but doesn't know too much about LMS and this whole landscape?
Jacob Lee: I would say the very simple high level explanation is that we're a framework that helps you build with LLMs. It's a new non-deterministic programming model with interesting considerations around streaming because calls can take a long time. I think as everyone saw in the early days of open AI providers can go down under heavy load and there's GPU shortages and things to worry about. So LangChain and LangChain.js really tackle a lot of these best practices and kind of little things you'll discover when you start working with LLMs and we've built a lot of things in the framework that make them much more pleasant to work with.
Daniel Nastase: From a beginner's perspective, what would be a good learning path for someone who wants to get started with LangChain? What concepts they should start with and is there a specific order in which they should tackle things?
Jacob Lee: On our docs page we have various tutorials. I think a very simple one is just type a prompt into a model. That's like kind of your simple one and I think that's a very intuitive one as well. You can see different methods like streaming or batching. There are all kinds of Chat Bots. You see ChatGPT, Claude AI. All the bespoke ones have some form of scaming because again calls can take I think as a sort of traditional developers using traditional API you'll see you'll be a little bit stressed out if your call is taking more than 500 milliseconds let's say whereas for LM it's very common for a call to take let's say 10 seconds and the streaming ux is very powerful and very kind of magical for folks who are building for these front-end experiences for end users and you know you can build your own chatbot that's like fun you can share with your family and friends we have some nice templates and tutorials for kind like front ends that go along with it playing out there there and I think you know one sort of area where I see a lot of and we see a lot of LLMs game put production is under retrieval augment and generation or rag which is basically this process of you've built a chaplot now you want it to access some kind of personal data or some be able to answer questions outside of its training data LMS are powerful but they don't have every token yet so RAG is one of those fields where it's kind of useful for a broad SWA of use Cas organizations and users and good practices have started to emerge so I think that's a pretty you know solid if you've never worked with LMS or LangChain before you kind of just get started with getting familiar with a few of the concepts and models and prompts and out pares and things like that and then work up to like a simple RAG use case.
Daniel Nastase: Would you recommend to someone first to start by picking up a model and interact directly with its API and only after that move to LangChain? Or it is okay to start directly with LangChain given the fact that it knows how to interact with all of these models?
Jacob Lee: Yeah, I can talk about my own experience. I guess I started with just LangChain.js directly. I you know don't you know end up trying the client ly as well just for I think it was in a bit of a newer State back then both libraries were but opening eyes was a bit more raw than it is currently I think now it's you know made some there have been some big improvements there around a lot of the sort of ux and sort of common patterns developers want to build with so I would say either one and with LangChain we have tried to make it like as light a wrapper as we can over the opening SDK we do throw in some bells and whistles around retries and like some nicer experience in various cases and of course it'll integrate well with the rest of the lent ecosystem so yeah I would say pretty agnostic there.
Daniel Nastase: Okay for me this is something that I like about LangChain. The fact that it also provides you with a learning model so it teaches you how to interact with all of these models and you can do this directly in a structured way so you don't have to pick up a bit of information from here, a bit of information from there. In general if you know LangChain it's enough to do your job with 80% of the models out there.
Jacob Lee: We tried to reduce the magic around the pure chat model wrappers and make the abstractions and concepts map one-to-one with the underlying client.
Daniel Nastase: I know you have a couple of products in this LangChain ecosystem. There is LangChain un itself after that we have LangSmith, LangServe LangGraph and so on. Can you please tell us a bit how these elements interact and how they work together and in what order they should be approached by a newcomer?
Jacob Lee: Sure thing! I think we've intended LangChain itself to be sort of this like nice entry point to general tasks with LLMs. Then as you sort of advance in your journey I think one thing that's really excited people recently and sort of was one of my first wow this is amazing technology moments was working with agents and this concept that LLMs can not only parse and make sense of lots of unstructured data but they can also make decisions and sort of decide on code execution like flow and then LangGraph is kind of the agent framework. We've built and we've taken a lot of the learnings we have gathered from community members and folks who use the framework and sort of like that's our next generation of these agents which can basically empower the LLM to make decisions about code execution. I think it's one thing that really got me excited about LLMs in general and LangGraph is sort of our newest and sort of like most customizable way to build these complex agent flows. LangSmith is a you know as people have built with these long LLMs there have been like sort of unique challenges that have come up with sort of debugging and like tracing. And you know it's it's hard to say it's it's harder anyway to write unit tests for an LLM because they're non-deterministic. So one way you can do that is through evaluation and sort of having some kind of data set and like basically checking to make sure your llm is an app is like constantly outputting good responses so we buil LangSmith as an accompaning platform around the rest of the open source.
Daniel Nastase: Okay so would it be safe to say that LangSmith is like the testing framework for LangChain?
Jacob Lee: I would say so, yeah. We I think have been calling it like productionize it's flashy it's cool now how do you know if it's working how do you know if I can put it in front of a user how do I debug failures that's kind of where LangSmith comes in.
Daniel Nastase: I think two weeks ago or one month ago released that talk with what we have learned from building one year with LLMs. I think a big part of this talk was around evals, how do you evaluate and how do you know that you didn't add any changes that actually broke some other stuff.
Jacob Lee: Exactly! Evals are more and more important in this context. I have a a colleague who likes to say that hard things are easy with LLMs which is taking a lot of unstructured input and it can make sense of anything really but then you have easy things that are not very hard because they're non-deterministic. Running the same thing many times can have different answers. In many cases so I think a lot of what guides us with what we built is like trying to provide good software practices and like sort of structure around this randomness and this non-determinism that this new kind of model of writing software presents.
Daniel Nastase: Correct! I have one question. Where does LangServe sits in this whole ecosystem? What does LangServe do and how does it link to all of the other components?
Jacob Lee: Sure. I think one other challenge with deploying LLMs is deployment. You've built something cool locally now you want it to be like accessible and live to users with kind of the you know again I think the streaming has been the streaming ux has been like a big shift I think a lot of developers would not have worked with streams very often or certainly not in like their kind of day-to-day as a central ux for like a front-end app so Lang serve was or is our like one solution we have for basically taking a chain you built like a you know series of calls with some other maybe steps in between and presenting to like a front end in a way that you know a user can interact with so there's a playground there's like different ways to different endpoints that like we present for things like streaming batching invoke like just general kind of response or full responses and then you get like a doc space too so you can see all the end points and like CL them in that page
Daniel Nastase: Oh nice! By the way, as a fun fact streaming was actually what got me into LangChain. I was listening to the Latent Space podcast. The one with Swyx. I heard about streaming and I said okay this is something simple enough that I may try to actually understand and from streaming I got to LangChain and after that this the whole the whole ramification started to to appear.
Daniel Nastase: LangChain.js is made in typescript and for someone who likes vanilla JavaScript, are they missing out on too much? Or is it feasible to use LangChain without TypeScript? I'm curious about this do you think that someone who is using LangChain without types are they missing a lot?
Jacob Lee: I think it's the age-old question and I think DHH David Heinemeier Hansson had like a pretty viral blog post recently where he came out pretty strongly against it and then you know you have folks who are like really I can't build anything without types like it's going to be you know not buggy and not very robust and you know I think with us we've try to have first class typ typescript support from day one and have the best kind of you know do the best we can to make sure for the people who do really want that kind of guidance and that typing we have a good solution and it does what you expect but yeah at the end of the day it's it is you know files down JavaScript you're totally welcome to use it without if you prefer
Daniel Nastase: What current or upcoming LangChain feature are you most excited about these days?
Jacob Lee: Yeah! We recently announced a product called LangGraph Cloud which is basically a I mentioned LangServe earlier that's more for General sort of General apps with LangGraph though I think there are even more considerations around building agents they're you know they take the non-determinism up to 10 right because now you have the agent deciding which next step to take instead of just maybe parsing out some data so to address some of these challenges LangGraph includes things like checkpointing and really easy support for hn in the loop so you can basically say if you have a customer support bot for example you don't want to just throwing refunds out maybe you want to have like a manager authorized a refund before the agent can give it so I think deployment around this stuff has been a bit trickier than even the normal and I think we've built some really cool things to provide good solutions for like managing these flows and sort of presenting a good sort of quick interface for debugging as well so you can go and take a agents flow and like go into individual steps rewind to a previous step that maybe went faulty update the prompt and then redeploy update your app from there so I think that's been pretty exciting pretty popular for the Python community and I'm really excited for that to come to JS.
Daniel Nastase: Sounds sounds very futuristic very science fiction. You have a fantastic GitHub repo about how to build a Next.js application that integrates LangChain. What other learning resources or GitHub repos would you recommend for someone who wants to get started with LangChain?
Jacob Lee: Sure thing! So, we have tried to make our docs I'd say like you know the tutorials is you know a nice resource for folks getting started I think like I said earlier you can just start with the very simple how does a chat model work how do I put a prompt into it how do I deal with the output and then kind of move up there to something like rag or you know if you want to go to building with agents right away you can do that too there's also an excellent course I did with Andrew Ang on deeplearning.ai which kind of walks through a lot of those simple like conceptual to like a fully functioning app and then the fine folks that the scrimba have this like very nice interactive tutorial that they've worked on it's I think using length chain some of the Imports are it's a bit older so some of the Imports are maybe a little bit different from the newer versions of LangChain but the content itself is pretty Evergreen I would say and one of the things nice things about them is that you can go and take some it's like a you have a code editor and then like a screencast walkth through and you know the as you play the lesson code will generate and you it'll run through like some examples there but you can actually pause a lesson at any point and update the code yourself and rerun it so G kind of gives us nice like interactive LST on learning which I think is really powerful yeah indeed inde the screen tutorial I also was I think was one of the first resources I've used in to yeah it was super nice super nice and
Daniel Nastase: A final question. This is a question I got from a newsletter subscriber. In your in your opinion what makes a good software engineer and how do you become one?
Jacob Lee: I think software in general is you know only been around for what maybe I guess if you go way back to the 50s and early computers or probably less the field itself is less than you know a few decades old it's only a few decades old right and since that time it's been changing enormously like from whatever vacutubes to C to JavaScript to you know browsers and the web mobile whatever I think the most important thing is just stay flexible and stay learning you know I think LLMs are a new paradigm that people had to get used to but it won't be the last kind of I think how could it be the last big shift right cor so I think the most important thing is just to kind of keep that kind of enthusiasm and love for Learning and like being mentally flexible and like mentally elastic enough to embrace and like try out new paradigms and judge for yourself what is useful like what kind of presents new and Powerful experiences for new products
Daniel Nastase: Correct and I would add to this do stuff! Always do stuff! I will link your Twitter account because I know you are active over there but beside Twitter is there somewhere else where would you recommend that someone follows you?
Jacob Lee: Mostly just Twitter. That's a great place to stay in the loop.
Daniel Nastase: Jacob thanks a lot for your time and keep up the good go work I mean you do a fantastic job with LangChain.
Jacob Lee: Thank you, Daniel.
π Build a full trivia game app with LangChain
Learn by doing with this FREE ebook! This 35-page guide walks you through every step of building your first fully functional AI-powered app using JavaScript and LangChain.js
π Build a full trivia game app with LangChain
Learn by doing with this FREE ebook! This 35-page guide walks you through every step of building your first fully functional AI-powered app using JavaScript and LangChain.js