Skip to content

AI

#306: A PDF Bot With LangChain

In the last two posts we got our hands dirty with the LangChain ecosystem and build a bot that talked to a CSV file and one that connected to a database. The packages langchain_community and langchain_experimental helped us a lot with our structured data. But what about unstructured data, like in a PDF file?

Creating a bot that answers based on a PDF file is a straightforward task with LangChain. As long as the PDF is small enough to fit into the context size of our LLM, we can even skip all the overhead of vector databases. Let us see what we need to create this bot.

#305: Chat With a Database in LangChain

The CSV bot we created last week uses a lot of unsafe practices. If you are not that happy with running Python code generated by an LLM on your machine, you may want to try a different approach. One approach I find helpful is to load the CSV file into an SQLite database and then use a SQL agent to query the data. Let us find out how we can do that.

#304: Chat With CSV Files in LangChain

If you have a CSV file to explore and have no idea what is going on, asking broad questions would be a great help. By using LangChain and some additional packages we can build a chat bot that allows us to do that. Let us figure out what we need to make it happen.

#303: Use a Search Engine With LangChain

All LLMs have a knowledge cut-off point. All things that happened after that point are unknown to the LLM. What can we do if we need a bot that can answer questions on more current events? LangChain has us covered and gives us all the tools we need to ask search engines about current events (or anything else they know about). Let us see what we need to build such a chat bot.

#302: Create a LLM Client With Chat History

LLMs work state-less. That way they gain scalability, but we as users end up with a problem: The chat bot does not know anything about the answer it gave to the previous question. If we try to ask a follow-up question, we only end up with something like this:

How many entries are there?

Could you please clarify what you are referring to when you ask about the number of entries? Are you asking about entries in a list, dictionary, or some other data structure? Or perhaps you are referring to something else entirely? Providing more context will help me give you an accurate and concise response.

Let us see how we can use LangChain to add conversational memory to a chat bot.

#301: Introducing LangChain for AI Applications

There is a lot going on in the AI space. New tools and models show up in short succession, while other AI services suddenly change their behaviour and deliver poorer results. Whatever we use today is probably outdated in a few months. In such a fast-changing place it is a pain to develop software.

Over the next few weeks we explore LangChain, a tool that allows us to use an abstraction over the different products we could use. While we need to learn yet another tool, we gain the benefit of swapping out parts of our solution while the rest of our application can stay the same. Let us see how that works.

#300: Learning Python in the Age of AI?

As AI tools grow in popularity and AI agents for code generation become more common, the question naturally arises: Should we even bother learning Python anymore? Or is it a waste of time when the machine can generate the application for us?

The more I think about it, the harder it gets to find a satisfying answer. Many of the cherished reasons of the past will disappear. Others no longer matter that much when we can change large parts of code in an instant. Let us explore the main points I came up with that we should consider.

#299: A Minimalistic FAQ Bot

A few weeks back I stumbled upon a course on Python chatbots by John Bura. I am still impressed by how little it takes to create a FAQ bot that answers your questions without burning resources with an LLM. Let us see how this minimalistic bot works.