Saturday, 25 May, 2024 UTC


Summary

The first time I wrote a computer program was 26 years ago, in Turbo Pascal. To someone who did not know how to code it felt like casting spells. But I understood how spells were made. If - then - else statements, functions, variables. This was how you make spells.
The only time I've had again this feeling was in 2022 when a friend showed me ChatGPT. It felt like some mystical magic. But this time I was not the one who was writing the spells. I did not truly understand how that 'AI thing' was made; you couldn't create it with just the programming I was used to.
So, I went down to the "learn how AI works" rabbit hole. And oh boy, this was a deep one. I was trying to understand this thing from the ground up.
I was trying to build and train my models from scratch. After some time, my only practical project was a pure JavaScript neuronal network. The model was written from scratch and could be trained to detect if a hand-drawn shape was a digit.
I gave up after some time. With all the different architectures, bias neurons, training data sets, backpropagation, or gradient descent. It was too much for my mediocre brain. The AI thing was a bit more logical and less mystical but I was far away from being able to use the new learnings practically.
Therefore I went back to my normal job as a web developer. But in the background of my mind was still the feeling that I should still pay attention to AI. There was something there.
After a while, I was listening to an episode of the excellent Latent Space podcast. I was following Swan Swyx Wang, the co-founder of this podcast from the time he has speaking about React (the JavaScript framework, not ReAct Prompting).
In that episode, Swyx mentioned something about LangChain. This LangChain framework was made for integrating AI models with "traditional" apps. I realized that I did not fully understand all the inner mechanics of databases, or operating systems, but I was using them. Therefore decided to give AI another shot. But this time from a more practical angle.
One book later I can now say that I love LangChain for all it taught me about how Large Language Models (LLMs for short) work. The abstractions, the mental models, and the use cases of this framework will teach you a lot about AI models and how to use them in conjunction with JavaScript-powered apps.
LangChain can be seen as the orchestrator that connects nearly everything in the AI-Webapp integration system. This makes it an excellent gateway for understanding how all the components work together.
So, let's learn!