LangChain Flowise AI
Sanket Terdal
Innovative Problem Solver | Agile Methodologies & Cross-Functional Leadership | Architect | Problem Solver | Blogger & Hands on Developer
LangChain is a tool that helps create smart applications using language models, making them understand context and make decisions.
Flowise AI is a part of LangChain that lets people easily see and build these applications without needing to code, by simply dragging and dropping items. This makes the complex task of creating advanced language model applications simple and straightforward.
With reference to earlier post (https://www.dhirubhai.net/posts/sanketterdal_langchain-retrieval-augmented-generation-activity-7119728460943491073-Eia8?utm_source=share&utm_medium=member_desktop), lets try to implement below workflow using Flowise.
LangChain - Flowise Demo
Its just takes 15 minutes.
Pre-Requisites
Step By Step Workflow
PDF Loader
Use document loaders to load data from a source
Recursively split by character
Recursive Splitting is a way to break down text into smaller parts using certain characters like spaces or new lines. It uses a list of characters to do this, going through them one by one, and keeps breaking down the text until the pieces are small enough. By default, it first tries to split with two new lines, then one new line, then a space, and lastly, an empty character.
Pinecone
In Pinecone, "upsert" is a way to add new pieces of information or update old ones. The term "Pinecone Upsert Document" might refer to a specific part in a system where you put in details to add or change information in Pinecone. It's like telling Pinecone, "Here's some new info, please keep it or replace the old info with it." So, using "upsert," you can easily manage your information in Pinecone, whether you're adding new stuff or changing what's already there.
领英推荐
OpenAI Embeddings
The OpenAI Embeddings class uses the OpenAI API to generate embeddings for a given text
Vector store-backed retriever
A vector store retriever is a tool that helps find documents using a special storage place called a vector store. It's like a helper that makes the vector store easy to use for finding documents. It uses certain searching methods, like looking for similar items, to find the texts in the vector store.
Conversational Retrieval QA
When you use tools like LangChain to get answers from a system, sometimes you might ask follow-up questions based on previous chats.
To fix this, before looking for an answer, the system can combine the earlier chat and the new question into one big question.
In technical terms, this involves adding a step to combine the chat history and new question, then doing the usual steps to find and give back an answer. And for this, you need a tool called a retriever that helps in finding relevant info to answer your question, which can be set up using something called a vector store created from embeddings.
ChatOpenAI
Wrapper around OpenAI large language models that use the Chat endpoint.
Complete Workflow
Conclusion
LangChain and Flowise are tools that help make smart apps which can understand and talk back to us in a helpful way. They make it easier for more people to create these apps, even if they don't know how to code. A special feature is that they can understand follow-up questions by looking at what was asked before, making conversations with the app feel more natural. This is done using a helper tool that searches for the right information to answer your questions. As we explore more in this area, LangChain and Flowise show a promising way to make apps smarter and easier to talk to.
References
Co-founder, COO Pigro - Power up your workspace with Pigro website: pigro.ai
11 个月Building a solution that works for every application is hard. We recently released a solution to split documents into optimal chunks of text. We split PDF and Office files based on the original document structure and content semantics.