How to use langgraph without langchain #1645
Replies: 3 comments 2 replies
-
hey! you're absolutely right that some of the prebuilts assume langchain's type. however, the majority of our focus (95+%?) is NOT on prebuilts. we actually specifically do NOT want to focus on higher level or opinionated abstractiosn. we want it to remain low level and very flexbile. However, for prebuilt nodes we (almost by definition) have to be opinionated about some things. But (1) we don't spend a lot of time or focus there, (2) those are just wrappers on top of lower level LangGraph, so everything is still doable/usable without the prebuilts. So I absolutely think its accurate to say langgraph can be used without langchain happy to provide any more details or thoughts! |
Beta Was this translation helpful? Give feedback.
-
Hi @avalatea ! This is a great question. The short (potentially less satisfying) answer is generally to not use the prebuilt components. There's only a handful (ToolNode, create_react_agent, and the MessageGraph/add_messages), and they're easy to replicate and customize in your own code. The prebuilts are designed to make common design patterns more accessible across a number of LLM providers. The easiest way to make these generalized across these providers is by using a higher-level abstraction. No abstraction is truly cost-free, which is why we designed the actual langgraph framework around a core principle that "Opinionated high-level APIs can’t be the only option" and must be powered by APIs that make as few (and timeless) assumptions as possible. We have a fair number of LangGraph users and teams who don't use LangChain. They typically use the framework directly, without the prebuilt components. Most of LangGraph's value comes from the framework itself, with its built-in persistence, scalability, and other guarantees, rather than in opinionated high-level APIs. Does that make sense? We can definitely work to try to make certain things more agnostic / less LangChain dependent (and indeed want to be principled here), but for integrations / communication formats, we also don't want to re-invent the wheel, since LangChain itself is actively developed with that purpose in mind. |
Beta Was this translation helpful? Give feedback.
-
Hi @avalatea LangGraph is first and foremost about creating your own custom graphs and nodes, none of which require or use langchain. Under |
Beta Was this translation helpful? Give feedback.
-
Hello 👋
One thing that excites me about langgraph is the promise to be able to use it without langchain, which I have always felt gave dubious value. However, once I started using langgraph, I found that a couple prebuilts assumes that the user is using langchain's type wrappers. For example, here and here. This puts me in a weird conundrum: either create my own custom wrapper, which adds more work, or create my own custom nodes. Either way, it feels like langgraph stopped giving a lot of value without using langchain.
Given this, is it still accurate to say that langgraph can be used without langchain? Or is there something that I am missing.
Beta Was this translation helpful? Give feedback.
All reactions