Live data from Hacker News

Why we no longer use LangChain for building our AI agents

octomind.dev

81–90 of 307 posts

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

#81
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…

We use instruct models extensively as we find smaller models fine tuned to our prompts perform better when general chat models that are much larger. This lets us run inference that can be 1000x cheaper than 3.5, meaning both money saving and much better latencies.

[deleted]

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

#82
post #79

LCEL is such a weird paradigm that I never got the hang of. Why | use | pipes?

I found it weird as well to see that. I didn't know LangChain overrode Python syntax.

But, if you're familiar with Linux/Unix, this should be familiar. You are piping the output of one function as the input of another function.

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

#83
This echoes our experience with LangChain, although we have abandoned it before putting it into production. We found out that for simple use cases it's too complex (as mentioned in the blog), and for complex use cases it's too difficult to adapt. We were not able to identify what is the sweet spot when it is worth it to use it. We felt like we can easily code ourselves most of its functionality very quickly and in a way that fits our requirements.

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

#84
It would have been great if the article provided a more realistic example.

The example they use is indeed more complex than the openai equivalent, but LangChain allows you to use several models from several providers.

Also, it's true that the override of the pipe character is unexpected. But it should make sense, if you're familiar with Linux/Unix. And I find it shows more clearly that you are constructing a pipeline:

    prompt | model | parser

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

#85
every good developer i know that has started using langchain stopped after realizing that they need more control than it provides. if you actually look at what is going on under the hood by looking at the requests you would probably stop using it as well.

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

#87
I am always suspicious with frameworks. There are two reasons of that. First is that because of the inversion of control they are more rigid than libraries. This is quite fundamental - but there are cases where the trade off is totally worth it. The second one is because of how they are created - it often starts with an application which is then gradually made generic. This is good for advertising - you can always show how useful the framework with an application that uses it. But this "making it generic" is a very tricky process that often fails. It is a top down, the authors need to imagine possible uses and then enable them in the framework - while with libraries the users have much more freedom to discover them in a bottom up process. Users always have surprising ideas.

There are now libraries that cover some of the features of Langchain. There is Instructor and mine LLMEasyTools for function calling, there is LiteLLM for API unification.

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

#88
I used langchain in one project and I do regret choosing it over just writing everything over direct API. I feel their pain.

It had advantage of having standardized API, so I could switch local LLM to OpenAI and just compare results in a heartbeat, but when I wanted anything out of ordinary (ie. get logprobs), there was just no way.

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

#89
Sorry noob question - where can I read more about this "agents" paradigm? Is one agent's output directly calling/invoking another agent? Or there's already fixed graph of information flow with each agent (I presume some prompt presets/templates like "you are an expert this only respond in that") sorts of?

Also, how much success people have or had with automating the E2E tests for their various apps by stringing such agents together themselves

EDIT: Typos

Post reply on HN