LangChain šŸ”—what is all about?

Anton Selin
4 min readNov 17, 2024

--

Have you ever wondered how companies create those amazing AI apps that can converse with users, examine documents, and interpret enormous volumes of data? To answer this question it involves much more then just knowing what is AI or LLMs, you need to know the whole infrastructure that allows you to use the power of AI in reliable way.

Why is there such a buzz?

Imagine youā€™re building a house. You could make everything from scratch by your own: the foundation, walls, plumbing, electrical systems, etc... Or you could use pre-built components and focus on designing your dream home. Thatā€™s exactly what LangChain does for AI applications.

In todayā€™s world, we see AI everywhere. Itā€™s already the reality when it comes to customer service chatbots, document anaysis systems, virtual assitants with research capabilities, content generation tools, you name itā€¦

LangChain makes building such application much easier by providing you with the standardized building blocks.

We could imagine some real world use cases where we might want to use such building blocks to focus on providing business value and not struggling with under the hood technology. For example you have a documentation nightmare with thousand of documentas across different systems. In a traditional way you would need to manually search them, or create some integrations and knowledge base indexes, while with LangChain you could build an AI assistant capable of: read all your documents, answer specific questions, summarize keypoints and when needed reference to exact documents.

Another example could be the custumer service challenges, where support team is overloaded in repetitive questions from customers. Instead of hiring more people or using basic chat bots, you could build and AI assitant that could access your data, understand the context, provide accurate answers and when needed escalate to human assitante.

This examples might involve a lot of techincal and architectural challenges to achieve reliable results, but with use of platforms wich as LangChain it becomes very easy and stragith forward to implement.

Appearance of tools such as LangChain is also a good signal of maturity level of a AI based technologyā€¦

Building Blocks

Letā€™s walk through the basics of LangChainā€™s main component

Model I/O

Think of this as your AIā€™s communication system. Like a translator who understands and knows how to talk to different AI models. It can help you to format your queries properly and interprete responses. (Do not forget that what you see in ChatGPT for example is not what it looks like under the hood, and if you need to build your own system there are a lot of technical details.)

Retrieval

LangChain provides built in support for retrieval mechanisms, that allow you to easily configure and connect things like RAG. Think of it as a librarian with super-efficiency. Who always knows what custom data you have, where it is located, and can quickly find and retrieve relevant documents.

Agents

Agent is your problem solver. Itā€™s a LangChainā€™s building block that allow you to configure an action which AI can execute for you. What normally would take tremendous amount of time becomes very easy with LangChain, where you can ā€œteachā€ you AI app when and how to use this Agent. For example you could have an agent that checks hotel and flight prices and availability, and another agent capable of making reservations. So the end user of your AI chat assistant could start a conversation and your AI would be aware that it can search for hotel and flight and make reservations and perform such actions when needed.

Chains (Assembly Line)

Chain is the feature of LangChain that allows you to seamlessly connect different component (such as Agents, VectorDBs for RAG, LLM models, etcā€¦) together in a single system.

Imagine a content creating system that can: Research on a topic, create an outline, write a content, check this content for accuracy (validation), and write and format the output. This would be very tedious to do without a simple chain mechanism. And that precisely what Chain building block is responsible for ā€” is to connect all the pieces together.

Memory

Memory block of LangChain allows you to easily integrate different kinds of memory storage for the context of your interaction with LLM. It helps to remember important details, maintain context and when needed (and depending on your own configuration) to recall relevant information.

Example

A real live example where LangChain could help could be some kind of Smart AI HR Assistant. Where the main challenge to solve would be processig hundreds of resumes and matching candidates to job. LangChain could, based on building blocks

Read and understand resumes ā€” Retrieval

Match candidateā€™s skills to job requirements ā€” Chains

Keep track of candidate interactions ā€” Memory

Schedule interviews and send follow-ups ā€” Agents

Without going into much technical details, i hope you can see how we can map some real life business work (normally performed by humans) into LangChain based AI application.

Honestly i believe that many companies (such as Google or Meta) already use such tools for they HR processes, and many othersā€¦

Conclusion

Weā€™re at a turning point in technology where AI is becoming essential for businesses. There are of course much more techical details and functionalities to cover about LangChain, but main goal in this article is to explain that LangChain is not just another buzz word, itā€™s an actual toolkit for building the future of business applications without need to understand all under the hood details of LLMs, APIs, Automations, etcā€¦

šŸ’» This article is powered by curiosity and coffee! If youā€™d like to contribute to the next idea, Buy me a coffee ā˜•.

Sign up to discover human stories that deepen your understanding of the world.

--

--

Anton Selin
Anton Selin

Written by Anton Selin

I am an entrepreneur who loves science, technology, and innovation. I enjoy learning about everything in this life. šŸ‡ŗšŸ‡¦ / šŸ‡µšŸ‡¹ / šŸ‡ØšŸ‡­

No responses yet

Write a response