Live data from Hacker News

Re-implementing LangChain in 100 lines of code

blog.scottlogic.com

61–70 of 85 posts

Re: Re-implementing LangChain in 100 lines of code

#61
post #55

Earlier quoted context omitted.

Won’t ChatGPT eventually eat your lunch? Once ChatGPT allows uploading documents (embeddings), what good will your app be? The tools you’re talking about like math, wiki, or search are already built as plugins on ChatGPT. I see so many AI apps being built, but I think ChatGPT will be general enough to cover 85-90% of use-cases using the chat UI.

The most important aspect of langchain is NOT using OpenAI for the LM. The most useful aspect of using langchain is to use it with Galpaca (or vicuna/koala/etc) to spin up an assistant for your home. This way, you can push all of your files through it - even petabytes or terabytes of files, at a fraction of the cost - and have it organize things for you. No privacy problems, no extreme costs, just ease of use, low la…

The vast majority of people building LM apps with (or without) LangChain are using OpenAI.

I sincerely hope local LM tech like Galpaca (or vicuna/koala/etc) succeed but I don't understand why we are collectively pretending they are currently anywhere near gpt-3.5-turbo both in terms of speed and quality. Honestly the local models feel more like first generation BERT/GPT-1 models that have been fine-tuned for QA using RLHF.

Re: Re-implementing LangChain in 100 lines of code

#63
post #16

LangChain has been so frequently discussed that I thought it must be this amazing piece of software. I was recently reading about vector databases and how they can be used to provide context to LLMs. I came across a LangChain class called RetrievalQA, which takes in a vector database and a question and produces and answer based on documents stored in the vector db. My curiosity was piqued! How did it work? Well... it…

Don't tell this to the VCs

Re: Re-implementing LangChain in 100 lines of code

#64
post #39
post #34

Earlier quoted context omitted.

If it makes you feel any better, the researchers building these things don't really know what they're doing either. They just throw data and compute at the problem and hope for the best.

I wouldn't say that. If it was that simple, the credits of GPT-4 wouldn't be this long: https://openai.com/contributions/gpt-4

That's why it is that long

Re: Re-implementing LangChain in 100 lines of code

#65
post #14

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: 1. Have a huge…

I've experimented with LangChain for my chatbot as well, but ultimately, I resorted to using custom Python. Here are a few issues I faced with LangChain:

- By developing your own solutions, you can engineer specific components that would be provided by LangChain to better suit your use case. For example, by fine-tuning to your use case you can have better results with converation history, context and summarization better by prompt engineering. If you look at prompts within langchain they are pretty basic.

- LangChain is designed around the idea that an entire chat logic resides within a single "REPL loop." In my use case, I had a single-page web app frontend, a standard web "RESTful" backend, and a separate chat service. Different parts of the information are stored and managed by these components. Using LangChain would have forced me to consolidate all logic into the chat service, which doesn't align with the overall architecture of my system beyond just the chat functionality.

Please note that I'm not a LangChain expert, so my assessment might not be entirely accurate about its capabilities. However, based on my evaluation, LangChain introduced too many constraints in comparison to what it provided.

Re: Re-implementing LangChain in 100 lines of code

#66

Given that the company has $200 million valuation, that is $2 million per line of code! just kidding. Still, I would like to understand $200 million valuation of langchain.ai.

$2 million per line? that is one of the most productive days of coding I have ever had!

I'll start my VC fuding round tomorrow ;-)

Re: Re-implementing LangChain in 100 lines of code

#67
post #14

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: 1. Have a huge…

Won’t ChatGPT eventually eat your lunch? Once ChatGPT allows uploading documents (embeddings), what good will your app be? The tools you’re talking about like math, wiki, or search are already built as plugins on ChatGPT. I see so many AI apps being built, but I think ChatGPT will be general enough to cover 85-90% of use-cases using the chat UI.

We cannot give my company's information to OpenAI/MS. No legal paperwork will change this. This information is so important, it is only on offline computers.

Re: Re-implementing LangChain in 100 lines of code

#68
post #16

LangChain has been so frequently discussed that I thought it must be this amazing piece of software. I was recently reading about vector databases and how they can be used to provide context to LLMs. I came across a LangChain class called RetrievalQA, which takes in a vector database and a question and produces and answer based on documents stored in the vector db. My curiosity was piqued! How did it work? Well... it…

I believe it can reduce tokens. It essentially obfuscates text as well if you want the security theatre of your prompts being hidden. Most importantly it makes more complex chains where multiple questions are asked and uses the response from the llm to decide if you need a further question.

Re: Re-implementing LangChain in 100 lines of code

#69

I got the chance to try Langchain as part of a hiring process. I was already having my eye on it for a personal projects though. The moment I tried it and went through the docs, the entire abstraction feels weird for me. I know a bit here and there about LLM, but Langchain make me feels like Im learning something entirely new. How agent and tools work and how to write one wasnt straightforward from the docs, and the…

LangChain and the ReAct paper that helped codify the implementation are both less than a year old. A hiring assignment suggesting it is…weird.

Its for a company that helps researchers, so I guess that’s why.

Re: Re-implementing LangChain in 100 lines of code

#70

I got the chance to try Langchain as part of a hiring process. I was already having my eye on it for a personal projects though. The moment I tried it and went through the docs, the entire abstraction feels weird for me. I know a bit here and there about LLM, but Langchain make me feels like Im learning something entirely new. How agent and tools work and how to write one wasnt straightforward from the docs, and the…

What type of position was the assessment for?

It was a senior full stack position for a company that build products for researchers.
Post reply on HN