Skip to main content

β›“ LangChain - How you can get the most of LLMs

Large language models are only powerful, when we can connect them to outside sources of truth. LangChain helps develop these types of applications. Basically it is an interface to work with Language Models in a more organized way.

Using an LLM is ok, for simple applications. More complex ones require chaining calls together. You can take a chain that takes user input, format it with a prompt template and then pass it to an LLM. The more individual elements you put together, the better your end product will be.

LangChain offers modules to; manage prompts, connect to LLMs (like OpenAI GPT), load documents, use utilities, organize and decide on information, and finally chain those actions together.

Other readers enjoyed - Llama Index

Do more with documents

How you can use LangChain​

All of this is a bit abstract until you understand exactly what these tools can do.

Use Outside Data​

Language models have no idea of what the truth is. However, you can augment LLMs with sources of truth. This makes them incredibly useful. LangChain offers a way to use outside data with Large Language models.

In these situations you do not want the LLM to generate sensitive information. You want it to fetch the right source of truth at the right time.

When you use outside data, you can create a summary of a piece of text, answer questions against it, or call external data via apis to augment the LLM. This creates a far surperior resultant product.

Agents​

Agents are systems that use language models to interact with other tools, based on verbal instructions. Imagine a personal assistant... that acutally works (looking at you Siri).

They can make decisions on which tools to use, when you query specific questions. This can be a programming interface, search engine, API call,

Chatbots​

Since LLMs are good at producing text, they are ideal for building chat bots. LangChain offers a memory interface to do this. This makes it really easy to help the LLM understand the context of the conversation, and use previous messages to respond to future messages.

Chat is predicted to grow fast over the next decades. Customer Support is a field that could be supplemented by AI driven chat bots.