Live data from Hacker News

Why we no longer use LangChain for building our AI agents

octomind.dev

121–130 of 307 posts

Re: Why we no longer use LangChain for building our AI agents

#121
post #106
post #100

I built my first commercial LLM agent back in October/November last year. As a newcomer to the LLM space, every tutorial and youtube video was about using LangChain. But something about the project had that "bad code" smell about it. I was fortunate in that the person I was building the project for was able to introduce me to a few other people more experienced with the entire nascent LLM agent field and both of them…

I've only ever played around with it and not built out an app like you have, but in my experience the second you want to go off script from what the tutorials suggest, it becomes an impossible nightmare of reading source code trying to get a basic thing to work. LangChain is _the_ definition of death by abstraction.

I have read the whole source of LangChain in Rust (there are no docs anyway), and it definitely seems over-engineering. The central premise of the project, of complicated chains of prompts is not useful to many people, and not to me either.

On the other hand it took some years into the web, for some web frameworks to emerge and make sense, like Ruby on Rails. Maybe in 3-4 years time, complicated chains of commands to different A.I. engines will be so difficult to get right that a framework might make sense, and establish a set of conventions.

Agents, another central feature of LangChain, are not proved to be very useful as well, for the moment.

Re: Why we no longer use LangChain for building our AI agents

#122

Langchain reminds me of GraphQL. A technology that a lot of ppl seem to hype about, sounds like something you should use because all the cool kids use it, but at the end of the day just makes things unncessarily complicated.

I don't know a thing about LangChain so this is a real digression, but I often wonder if people who are critiquing GraphQL do so from the position of only having written GraphQL resolvers by hand.

If so, it would make sense. Because that's not a whole lot of fun. But a GraphQL server-side that is based around the GraphQL Schema Language is another matter entirely.

I've written several applications that started out as proofs of concept and have evolved into production platforms based on this pairing:

https://lighthouse-php.com https://lighthouse-php-auth.com

It is staggeringly productive, replaces lots of code generation in model queries and authentication, interacts pretty cleanly with ORM objects, and because it's part of the Laravel request cycle is still amenable to various techniques to e.g. whitelist, rate-limit or complexity-limit queries on production machines.

I have written resolvers (for non-database types) and I don't personally use the automatic mutations; it's better to write those by hand (and no different, really, to writing a POST handler).

The rest is an enormous amount of code-not-written, described in a set of files that look much like documentation and can be commented as such.

One might well not want to use it on heavily-used sites, but for intranet-type knowledgebase/admin interfaces that are an evolving proposition, it's super-valuable, particularly paired with something like Nuxt. Also pretty useful for wiring up federated websites, and it presents an extremely rapid way to develop an interface that can be used for pretty arbitrary static content generation.

Re: Why we no longer use LangChain for building our AI agents

#124
post #68

Langchain was released in October 2022. ChatGPT was released in November 2022. Langchain was before chat models were invented. It let us turn these one-shot APIs into Markov chains. ChatGPT came in and made us realize we didn't want Markov chains; a conversational structure worked just as well. After ChatGPT and GPT 3.5, there were no more non-chat models in the LLM world. Chat models worked great for everything, inc…

Chat GPT is just GPT version 3.5. OpenAI released many other versions of GPT before that. In fact, Open AI became really popular around the time of the GPT 2 which was a fairly good chat model.

Also, the Transformer architecture was not created by OpenAI so LLMs were a thing way before OpenAI existed :)

Re: Why we no longer use LangChain for building our AI agents

#125
I don't like langchain that much either. It's not as bad as LLAmaIndex and Haystack in regards to extreme overengineering and overabstracting but it still is bad. The reason I still use Langchain is that often times I need to be able to swap out LLM service providers, embedding models and so on for clients. Thats really the only part about langchain that really works well.

Btw. you don't have to actually chain langchain entities. You can use all of them directly. That makes the magic framework code issue much more tolerably as Langchain turns from a framework into a library.

Re: Why we no longer use LangChain for building our AI agents

#127
post #67

Earlier quoted context omitted.

I have a consumer app that swaps between the 5 bigs and wholeheartedly agree, except, God help you if you're doing Gemini. I somewhat regret hacking it into the same concepts as everyone else. I should have built stronger separation boundaries with more general abstractions. It works fine, I haven't had any critical bugs / mistakes, but it's really nasty once you get to the actual JSON you'll send. Google's was 100%…

> Google's was 100% designed by a committee of people who had never seen anyone else's API Google made their API before the others had one, since they were the first with making these kind of language models. Its just that it has been an internal API before.

My understanding is that the original Gmail team actually invented modern LLMs in passing back in 2004, and it’s taken outsiders two decades to catch up because doing so requires setting up the Closure Compiler correctly.

Re: Why we no longer use LangChain for building our AI agents

#129
post #67

Earlier quoted context omitted.

> Google's was 100% designed by a committee of people who had never seen anyone else's API Google made their API before the others had one, since they were the first with making these kind of language models. Its just that it has been an internal API before.

No. That'd be a good explanation, but it's theoretical. In practice: A) there was no meaningful internal LLM API pre-ChatGPT. All this AI stuff was under lock and key until Nov 2022, then it was an emergency. B) the bits we're discussing are OpenAI-specific concepts that could only have occurred after OpenAI's. The API includes chat messages organized with roles, an OpenAI concept, and "tools", an OpenAI concept, bot…

>All this AI stuff was under lock and key until Nov 2022, then it was an emergency.

This is absolutely false, as the other person said. As one example: We had already built and were using AI based code completion in production by then.

Here's a public blog post from July, 2022: https://research.google/blog/ml-enhanced-code-completion-imp...

This is just one easy publicly verifiable example, there are others. (We actually were doing it before copilot, etc)

Re: Why we no longer use LangChain for building our AI agents

#130
I am not a fan of LangChain. And I would never use it for any of my projects.

LLM is already a probabilistic component that is tricky to integrate into a solid deterministic system. An abstraction wrapper that bloats the already fuzzy component just increases the complexity for no apparent benefit.

Post reply on HN