I do recommend prototyping; even if you think your idea is feasible, you want to see it in action before committing significant resources. Personally, my prototype showed me that a single run of my idea takes more time and money than I initially expected.
The Problem with LangChain
61–70 of 97 posts
Re: The Problem with LangChain
#62My primary use of langchain has been to turn text into a vector database with chroma and then query the vector database to return source materials to an LLM to use. I’d much prefer to move away from it because like the author I find LC’s adherence to system prompts is really bad. I can handle all of the agent side of things, I just want relevant source materials from the vector DB as strings — anyone have a better mo…
I found Chroma to be really slow. I recently switched to pgvector and I'm really happy with it. This is an example of using pgvector that might be relevant for your use case: SELECT d.id, d.doc, 1 - (embedding (SELECT embedding FROM documentation_embedding WHERE id = 1)) AS similarity FROM documentation_embedding de join documentation d on de.documentation_id = d.id ORDER BY similarity desc;
be cautious with pgvector - the recall can be extremely bad (% retrieved nearest neighbors vs ground truth)
Re: The Problem with LangChain
#63I can't invest in OpenAI atm, any alternative of it so that I can make a "chatting interface" for PDF?
Re: The Problem with LangChain
#64The core data structure, the Chain, is basically just a function. Combining chains is function composition, like literally it's just f(g(x)), but incompatible with _your_ f's and g's without an adapter. Read this page and mentally swap "chain" for "function": https://python.langchain.com/docs/modules/chains/foundationa... They build all these adapters and integrations and make it seem like they're helping you piece t…
Some prefer React, somet NextJS. LangChain has its place.
Re: The Problem with LangChain
#65I use lambda over let over lambda (lolol)[1] like this (Clojure): (def chatgpt (-> (endpoint :chat "gpt-4" auth) (chat/set-opts [:endpoint] {:stream true}) chat/retry chat/catch-unkown-commands ;; chat/history chat/string-input (chat/file-io "file.txt" :stream true) #_(chat/preserve-ctx chatgpt-ctx))) These higher-level functions take as input the next function in the chain, and return a function that is responsible…
Re: The Problem with LangChain
#66Langchain is perfect to give you ideas for how to interact with LLMs, but for me it's been easier to implement everything myself than to use it.
Also: before using any new technology, go to hn.algolia.com and search HN for comments about it first.
Re: The Problem with LangChain
#67Re: The Problem with LangChain
#68I'm in the exact same spot as the author just a few days in instead of months. Frankly I could see langchain is garbage software just by looking at the code. It still helps me get shit done fast to figure out how things are supposed to work. Sort of a cookbook of AI recepies. Once I have an approach narrowed down I'll rewrite everything on top of stuff langchain is supposedly wrapping. For now it's faster than tracki…
You don't need to look at the code: I looked at the release notes and the garbage fire of unrelated nonsense getting added and got to skip even installing it. https://github.com/hwchase17/langchain/releases At this point Langchain is almost required to accept any PR. They raised money, and now their growth metric is Github stars. A simple wrapper around the APIs (I used llamaflow, which is now llm-api https://github.…
Re: The Problem with LangChain
#69The core data structure, the Chain, is basically just a function. Combining chains is function composition, like literally it's just f(g(x)), but incompatible with _your_ f's and g's without an adapter. Read this page and mentally swap "chain" for "function": https://python.langchain.com/docs/modules/chains/foundationa... They build all these adapters and integrations and make it seem like they're helping you piece t…
> ...but in how many cases were they necessary as a middleman? Some prefer React, somet NextJS. LangChain has its place.
Re: The Problem with LangChain
#70The core data structure, the Chain, is basically just a function. Combining chains is function composition, like literally it's just f(g(x)), but incompatible with _your_ f's and g's without an adapter. Read this page and mentally swap "chain" for "function": https://python.langchain.com/docs/modules/chains/foundationa... They build all these adapters and integrations and make it seem like they're helping you piece t…
> ...but in how many cases were they necessary as a middleman? Some prefer React, somet NextJS. LangChain has its place.
By the time you have built custom chains, custom prompts, and custom agents to support all that, you basically are using their interface and not their code. At that point, eh, it's pointless. It's great for demos, I give you that, but every time I tried to coherce it into a product, it fell short.