Live data from Hacker News

Re-implementing LangChain in 100 lines of code

blog.scottlogic.com

1–10 of 85 posts

Re: Re-implementing LangChain in 100 lines of code

#3

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.

It's a great momentum to dominate eco system. Heard about Docker (that was more than http fetch wrapper) ?

Re: Re-implementing LangChain in 100 lines of code

#5
Yeah, the basics of LangChain are fairly simple, and reimplementing a loop like that in Go, including tool usage, was very straightforward when I was writing Cuttlefish[0] (a toy desktop chat app for ChatGPT that can use stuff like your local terminal or Google).

The magic in LangChain, though, is the ecosystem. I.e. they have integrations with tons of indexes, they have many tool implementations, etc. This is the real value of LangChain. The core ReAct loop is quite trivial (as this article demonstrates).

[0]: https://github.com/cube2222/cuttlefish

Re: Re-implementing LangChain in 100 lines of code

#6
Am I the only one who is not convinced by the value proposition of langchain? 99% of it are interface definitions and implementations for external tools, most of which are super straightforward. I can write integrations for what my app needs in less than an hour myself, why bring in a heavily opinionated external framework? It kind of feels like the npm "left-pad" to me. Everyone just uses it because it seems popular, not because they need it.

Re: Re-implementing LangChain in 100 lines of code

#8

Am I the only one who is not convinced by the value proposition of langchain? 99% of it are interface definitions and implementations for external tools, most of which are super straightforward. I can write integrations for what my app needs in less than an hour myself, why bring in a heavily opinionated external framework? It kind of feels like the npm "left-pad" to me. Everyone just uses it because it seems popular…

> I can write integrations for what my app needs in less than an hour myself,

Or just ask ChatGPT to do it...

Joking aside, I think 'npm "left-pad"' describes it perfectly.

Re: Re-implementing LangChain in 100 lines of code

#9

Am I the only one who is not convinced by the value proposition of langchain? 99% of it are interface definitions and implementations for external tools, most of which are super straightforward. I can write integrations for what my app needs in less than an hour myself, why bring in a heavily opinionated external framework? It kind of feels like the npm "left-pad" to me. Everyone just uses it because it seems popular…

Langchain is absolutely perfect though, it's bad enough that you'll be driven to write something better out of pure frustration but gives you enough good ideas and breadcrumbs to actually do it.

It's probably the best on-ramp for "practical uses of llms" because it scratches just the right developer itch.

Re: Re-implementing LangChain in 100 lines of code

#10
I've been working with langchain and llamaindex and did notice that it's a pretty hefty abstraction on top of pretty simple concepts and I also eventually ended up dropping both and simply write the underlying code without the framework on top.
Post reply on HN