Member-only story
Why you don’t need LangChain for building a RAG bot?
Dive into the versatility of Generative AI: Expand your toolkit beyond just LangChain!
Table of Content
· Introduction
· System diagram
· Introduction to Pinecone
· Code folder structure
· Requirement file
· Environment variables
· Reading PDF
· Compute embeddings
· Embedding chunks
· Answer generation
· Saving vectors
· Read PDFs, extract chunks, embed, and store
· Question Answering using RAG
· Conclusion
Introduction
A lot of you might be giving me a mouthful just by reading the title of this blog. But to each their own, and probably you might be just riding the hype train. Initially, I was quite fascinated by the work being done on LangChain and using it. And so I thought I would give it a try, but when I was installing it, I saw it downloading loads and loads of other libraries and most of which were not useful for what I was trying to build.
The following is a list of all the packages it installs, approximately 110 to 120 packages.

But do we seriously need all these packages, no we don’t! Let me clarify my apprehension further. Installing a multitude of libraries is not just about the sheer number; it brings with it a set of challenges:
- Performance implication: Overloading the system with numerous libraries can bog down performance and unnecessarily occupy storage.
- Compatibility issues: The more libraries we have, the higher the chances of version clashes, making one library incompatible with another.
- Maintenance overhead: Each library requires its updates, adding to the routine maintenance tasks.
- Increased complexity: For those…