Live data from Hacker News

LangChain Is a Black Box

news.ycombinator.com

1–10 of 31 posts

LangChain Is a Black Box

#1
I've been working with Langchain to develop a POC and when I try to understand the bugs in my code I feel like I am going down this huge rabbit hole of code. Every time I click into a piece of code there are 10 more places that I have to look that MIGHT be the source of the bug.

I get the idea that things should be abstracted away and that's the point of a library but this feels like a little much.

Re: LangChain Is a Black Box

#2
Oh my god, I feel exactly the same way. I am not a programmer, but I'm excited by the potential of LLMs in my work. So, I've dusted off my python skills that I haven't used since I was in an fMRI lab, and experimenting to see what works.

First of all, every library/framework I've found is moving so fast that all the tutorials and printed material (O'Reilly books etc) are already out of date. Many of the changes are out of necessity, as it's a rapidly developing space, but sometimes it just feels like someone got high and decided to add 3 more layers of abstraction. Although for many tasks, AI coding assistants would be a benefit for noobs like me, the code base and documentation are too loose for me to get the expected benefits I would find in a more established code base.

LangChain seems to be where a lot of the action is with regard to modularity, and using different components in each part of the pipeline. That's important for me, because I need either local or HIPAA-compliant tools (Azure OpenAI works, Anthropic won't return my requests for a BAA, and I need a bigger GPU).

But using LangChain is a pretty horrible experience because, at least for my uses and as a noob, it's much too buried in abstractions to make quick iterations. The GUI-based stuff like flowise and langflow are too limited with regard to available components, and mostly they hide the problems so that errors are tough to address.

I'm thrilled that there has been so much work on adding JSON output and agent stuff at the LLM level, as hopefully it can bring some of these astronauts back to earth (or at least in a low orbit).

Re: LangChain Is a Black Box

#3
Yeah, it's a meme by now. Langchain did not grow well with the new changes in AI. Generally avoid it where possible. It still has uses, but treat it as legacy code.

Re: LangChain Is a Black Box

#4
We're moving our entire codebase away from Langchain and related products (langgraph, langsmith). I originally thought the library had potential and just needed some polishing which would come with time, but it's just been getting worse and worse. LCEL is the weirdest half-baked idea; it's a nice gimmick that makes your code impossible to debug in a step through debugger. Random stuff breaks with every other release. I deeply regret using it by now.

Re: LangChain Is a Black Box

#6
post #4

We're moving our entire codebase away from Langchain and related products (langgraph, langsmith). I originally thought the library had potential and just needed some polishing which would come with time, but it's just been getting worse and worse. LCEL is the weirdest half-baked idea; it's a nice gimmick that makes your code impossible to debug in a step through debugger. Random stuff breaks with every other release.…

Are you replacing LangGraph with something else? I've luckily avoided LangChain exactly because it's a black box, but been on the lookout for some kind of DAG visualization of LLM flows. LangGraph pops up first on any related searches.

Re: LangChain Is a Black Box

#7
Langchain has the odd nice component I use, I prefer their recursive text splitter to anything else I've seen or cobbled together, but I don't find the code readable or the abstractions particularly intuitive.

Re: LangChain Is a Black Box

#9
Langchain is a spaghetti rabbit hole. In our consultancy, we've basically switched entirely to Haystack, and keep the abstractions fairly light, really only use it to give the pipelines some structure that applies across projects. Very easy to add custom components with pretty straightforward interfaces. The way you assemble the components isn't everyone's cup of tea (string references), but it does make it very easy to understand at a glance what each pipeline is doing and when. Worth checking out if Langchain isn't doing it for you.

Re: LangChain Is a Black Box

#10
Last I checked Langchain was just basically a pile of helpers? There isn't really a coherent model of anything that's presented to the user, just some light wrappers around stuff. I played around for a bit, it was fine, but I opted to write my own helpers in the end.

Did I miss out on some major developments there? Because I don't see why it's a thing that's being talked about everywhere, when it's barely anything.

Post reply on HN