Re-implementing LangChain in 100 lines of code
I work with Langchain on a daily basis now, and so often I find myself asking; do I really need a whole LLM framework for this? At this point, the assistant I am writing, will likely be more stable rewritten in pure Python. The deeper and more complex the application becomes, the more of a risk Langchain seems to become to keeping it maintainable. But even at less complex levels, if I want to do this:<p>1. Have a huge dataset of documents.<p>2. Want to ask questions and have an LLM chat conversation based on these documents.<p>3. Be able to implement tools like math, wiki or Google search on top of the retrieval.<p>4. Implement memory management for longer conversations.<p>Its still a lot more straightforward to maintain it in Python. The only thing where it becomes interesting is having agents execute async, which is not that easy replicate, but at the moment agents are not that helpful. Not trying to diss Langchain too much here, because its such an awesome framework, but I can&#x27;t help seeing past it other than just being a helpful tool to understand LLM&#x27;s and LLM programming for now.