TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

LangChain Is a Black Box

42 点作者 valianter9 个月前
I&#x27;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.<p>I get the idea that things should be abstracted away and that&#x27;s the point of a library but this feels like a little much.

16 条评论

phren0logy9 个月前
Oh my god, I feel exactly the same way. I am not a programmer, but I&#x27;m excited by the potential of LLMs in my work. So, I&#x27;ve dusted off my python skills that I haven&#x27;t used since I was in an fMRI lab, and experimenting to see what works.<p>First of all, every library&#x2F;framework I&#x27;ve found is moving so fast that all the tutorials and printed material (O&#x27;Reilly books etc) are already out of date. Many of the changes are out of necessity, as it&#x27;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.<p>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&#x27;s important for me, because I need either local or HIPAA-compliant tools (Azure OpenAI works, Anthropic won&#x27;t return my requests for a BAA, and I need a bigger GPU).<p>But using LangChain is a pretty horrible experience because, at least for my uses and as a noob, it&#x27;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.<p>I&#x27;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).
评论 #41241374 未加载
评论 #41262276 未加载
Ldorigo9 个月前
We&#x27;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&#x27;s just been getting worse and worse. LCEL is the weirdest half-baked idea; it&#x27;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.
评论 #41194241 未加载
samier-trellis9 个月前
It is indeed a terrible library on multiple levels. Get rid of it. Just use the &quot;native&quot; Python SDK for the LLMs you are using for your POC.
评论 #41198307 未加载
specproc9 个月前
Langchain has the odd nice component I use, I prefer their recursive text splitter to anything else I&#x27;ve seen or cobbled together, but I don&#x27;t find the code readable or the abstractions particularly intuitive.
danielbln9 个月前
Langchain is a spaghetti rabbit hole. In our consultancy, we&#x27;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&#x27;t everyone&#x27;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&#x27;t doing it for you.
评论 #41195432 未加载
vortegne9 个月前
Last I checked Langchain was just basically a pile of helpers? There isn&#x27;t really a coherent model of anything that&#x27;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.<p>Did I miss out on some major developments there? Because I don&#x27;t see why it&#x27;s a thing that&#x27;s being talked about everywhere, when it&#x27;s barely anything.
评论 #41196188 未加载
phren0logy9 个月前
Just in case anyone comes back to see this: I found the following (3 hour!!) YouTube video to be really helpful. It starts slow, but skip ahead and watch in 2x until you get to what you need.<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;yF9kGESAi3M?feature=shared" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;yF9kGESAi3M?feature=shared</a>
efriis9 个月前
Howdy! Erick from LangChain here. Would love to learn a bit more about your bug hunting process and see how we can improve the debugging process for everyone else! Could you email me at erick@langchain.dev?
评论 #41212196 未加载
choilive9 个月前
Langchain is frequently crapped on here on HN. Do some searching and you&#x27;ll see it&#x27;s pretty much a universal sentiment that langchain is terrible and you shouldn&#x27;t use it.
ujjwalk3049 个月前
The reason I use pinecone without langchain and people call me crazy
imtringued9 个月前
I don&#x27;t know if this will help you, but have you tried langroid?<p>Even if you don&#x27;t want to use agents, it is still useful as a convenient library for calling an Open AI compatible endpoint.<p><a href="https:&#x2F;&#x2F;langroid.github.io&#x2F;langroid&#x2F;quick-start&#x2F;llm-interaction&#x2F;" rel="nofollow">https:&#x2F;&#x2F;langroid.github.io&#x2F;langroid&#x2F;quick-start&#x2F;llm-interact...</a>
评论 #41201666 未加载
muzani9 个月前
Yeah, it&#x27;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.
glorpsicle9 个月前
Ugh, I feel exactly the same way. In fact, I&#x27;ve spent the last 2 weeks refactoring our entire LLM pipeline to completely root out LangChain. I&#x27;m just implementing basic RAG from scratch, which 1) has me learning a lot more quickly and 2) feeling much more in control of the entire pipeline.
评论 #41205274 未加载
MH159 个月前
Remember than LangChain raised $10m a few months ago <a href="https:&#x2F;&#x2F;blog.langchain.dev&#x2F;announcing-our-10m-seed-round-led-by-benchmark&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.langchain.dev&#x2F;announcing-our-10m-seed-round-led...</a> (wait, over a year ago!)
e1gen-v9 个月前
I tried using it for a simple POC and was very frustrated with it. Now we just use raw api calls, and a state machine to create our dag. Much simpler and very extensible.
_andrei_9 个月前
Get rid of it, Langchain really doesn&#x27;t do anything you can&#x27;t easily do yourself.