AI - the wonders of Langchain

·

4 min read

I've already done two too many posts this week, I am trying to limit myself to a single post a week. If only to avoid boring everyone shitless. But, I have been playing with some really cool stuff these last few days.

This is another AI post, this one is aimed at the techies amongst us. So everyone else, take the day off and don't bother reading any further.

I started using and writing Python properly about a year ago, so I am getting reasonable now. Another 6-12 months and I'll be the business, at least in the packages I use regularly. Python is huge.

Anyone using Copilot knows how handy it is. That combined with something like chatGPT and you can get away with having to write a lot less code. I'm going to avoid the "use it or lose it" argument that is for another day. The point is, that these are pretty good tools that can help with our coding productivity. I have been able to produce a lot more Python solutions than I would have if I was writing code without help.

This is all well and good until you come up against something that is not very common in coding circles. If you are using a bespoke software package with few examples online you are going to struggle even with Copilot. I have been messing about with AI recently, creating vector databases, RAG, finetuning, and so on. It is great, right up until it stops working, then it is an absolute pain in the arse.

When you are working with AI there are still a lot of gaps and Copilot, chatGPT and the other LLMs can struggle to deliver help of any real value. So wtf do we do then? Well, here is one possible solution. First things first, I have no affiliation with these guys, don't work for them, or know anyone who works for them. I just use their site, courses and code.

This post is all about something called Langchain. I'll be doing another next week about Microsoft/OpenAI and some of the amazing things they have going on. Over the coming weeks we will be looking at Llama.cpp which is remarkable, I genuinely, don't even know where to start. Then we have Anthropic, just starting on this, anyway, I'm starting to go off on one. Coming back Langchain.

There are a whole bunch of things that just have me whooping for joy these days. Yes, I said whooping and I'm happy to be judged for my use of the word. Bring it on. AI has me clapping my hands like a 5-year-old excited child sometimes. The truth is that while there is a way to go, this stuff is just magic. Which brings me to Langchain.

So what is Langchain?

Langchain is a product, a suite of tools, whatever you want to call it. On their site they describe themselves as "the platform developers and enterprises choose to build AI apps from prototype to production."

They go on to say that

"We're on a mission to make it easy to build the LLM apps of tomorrow, today. We build products that enable developers to go from an idea to working code in an afternoon and in the hands of users in days or weeks."

This is exactly what they do. There is a tonne of documentation, examples and courses (some over on Deeplearning.ai) that you can use to get yourself trained up on prompt engineering, application dev, building chat, agents, functions and on and on. They cover loads of cool stuff. Best of all, it's ALL FREE.

On top of everything else, they also have something called LangSmith, which is what I have been learning about and playing with this week. This thing appears to be tailored for language models, allowing you to fine-tune, optimize, improve your model accuracy, and deploy amongst other things. It's mind-blowing.

It is not perfect, but it is trying its best and is currently one of my go-to places while developing anything AI. If you are a dev and you're wondering where the hell to start when it comes to AI, this is a great place to begin your journey.

Right, that is enough for this week. Have a great weekend everyone.

Bryan
ps. Yep, human content for better or worse!