Enterprise Analytics with LangChain and LLMs | by Naser Tamimi | Dec, 2023


GENERATIVE AI

A step-by-step tutorial on question SQL databases with human language

Picture by the writer (generated by way of Midjourney)

Many companies have numerous proprietary knowledge saved of their databases. If there’s a digital agent that understands human language and may question these databases, it opens up large alternatives for these companies. Consider customer support chatbots, they’re a typical instance. These brokers can take buyer requests, ask the database for info, and provides the client what they want.

The advantage of such brokers just isn’t restricted to exterior buyer interactions. Many enterprise house owners or folks in firms, even in tech firms, may not know SQL or comparable languages, however they nonetheless must ask the database for info. That’s the place frameworks like LangChain are available. Such frameworks make it simple to create these useful brokers/purposes. Brokers that may discuss to people and on the similar time, discuss to databases, APIs, and extra.

LangChain is an open-source framework for constructing interactive purposes utilizing Giant Language Fashions (LLMs). It’s a device that helps LLMs join with different sources of knowledge and lets them discuss to the world round them. One vital idea in such frameworks is the Chain. Let’s check out this idea.

What are Chains?

Chains are superior instruments on this framework that mix LLMs with different instruments to carry out extra sophisticated duties. Particularly, chains are interfaces that use a sequence of LLMs together with different instruments, reminiscent of SQL databases, API calls, bash operators, or math calculators, to finish a posh job. An instance could possibly be our utility receiving enter from a consumer and passing it to our LLM mannequin; then, the LLM calls an API. The API responds to the LLM, and the LLM takes the response to carry out one other process, and so forth. As you possibly can see, it’s a chain of inputs and outputs the place, in lots of elements of this sequence, we have now LLM fashions dealing with the scenario.

Now it’s time to get our arms soiled and begin coding a easy LLM-backed utility. For this utility, we’re going to make…

Leave a Reply

Your email address will not be published. Required fields are marked *