5 ms·
I believe the abstractions in Langchain are inherently flawed. The core problem resides in the composability of chains. While it offers a handy way to create pr
by resiros 3y ago
I believe the abstractions in Langchain are inherently flawed. The core problem resides in the composability of chains. While it offers a handy way to create prototypes, it becomes restricting when you desire to modify a specific element within the chain. The hierarchical design of chains in Langchain conceals the component you wish to alter and obscures the parts developers might want to adjust, making the process of experimenting and refining the pipeline difficult.
The optimal abstraction for LLM apps, in my view, should resemble a DAG or a state machine. This alternative exposes the distinct stages in the pipeline rather than masking them in a hierarchy. Yes, adopting this new abstraction might lead to more code but it offers superior control. It's hardly surprising that many users start prototyping with Langchain, but then, when ready, they clone the prompts and construct their own systems.
Fixing this fundamental issue would be very difficult. It would necessitate reworking the library from the ground up.
- joshka 3y agoTake a look at https://promptfile.org/ https://promptfile.org/ for an alternative approach to the prototyping -> app flow.
- sandGorgon 3y agoPromptfile is written in markdown, which is unsuited for templates and config management. I have an attempt in the same domain, would love feedback We didnt invent a new markup - we used jsonnet which is used in large scale kubernetes and has a grammar that has been well tested for config mgmt. https://github.com/arakoodev/EdgeChains/blob/main/Examples/redis-chat.jsonnet https://github.com/arakoodev/EdgeChains/blob/main/Examples/r... Prompts live outside the code.
- pharmakom 3y agoA DAG is not expressive enough for some applications. Lang chain is actually a poorly implemented free monad.
- pkc_official 3y ago[dead]