patterns-ai-core / langchainrb

Build LLM-powered applications in Ruby
https://rubydoc.info/gems/langchainrb
MIT License
1.28k stars 178 forks source link

❗❗❗ REQUESTING FEEDBACK ❗❗❗ #57

Closed andreibondarev closed 6 months ago

andreibondarev commented 1 year ago

We would like to collect any and all feedback people might have regarding Langchain.rb: GOOD and BAD! Have you already tried Langchain.rb in your project? Do you have specific requirements or use-cases that you don't think Langchain.rb could help you with? Please provide us with your feedback!

We'd like to ensure that this project is rooted in real needs and use-cases, and solves actual pain-points when developing LLM-driven applications.

Optional questions to think through and answer:

  1. Is it clear what this library is meant to be used for?
  2. Did you have any problems installing and integrating this library into your project?
  3. Did you run into any errors while using this library?
  4. Are you currently using this library in a project/prototype? Unless "in stealth mode" -- please share more info about your project.
  5. How well is this library documented?
  6. What kind of features do you think this project is missing?
  7. ...

Thank you! ❤️

ZhenhangTung commented 1 year ago

Today I found building the app challenging if I only read the documents. I had to follow the example code and read the source code sometimes. I feel part of the reason is I'm new to the LLM world. Another one is that I learned Python's version of Langchain first. Many method names and params are different from Langchain.rb. So there could be learning curves for those Ruby developers who have already used the Python version and want to use Langchain.rb after finding it. That's my thought, don't know how other newcomers feel. Hope this feedback helps 😄

rolentle commented 1 year ago

I wanted to second the point above; the abstractions seem different than Langchain as I don't see chains and memory implemented. From my best guess the LLM is doing double duty as the LLM and the chain?

andreibondarev commented 1 year ago

I wanted to second the point above; the abstractions seem different than Langchain as I don't see chains and memory implemented. From my best guess the LLM is doing double duty as the LLM and the chain?

Yeah... we don't really have the abstractions fully fleshed out. I was hoping that better abstractions will eventually yield themselves and become more obvious.

Do you feel like it's detrimental to the project that we don't have the concepts of chains?

rolentle commented 1 year ago

When thinking of this project I was assuming it being 1 to 1 port of the Python version to the point where I could just read the Python documentation and intuit how the Ruby version could work. Depending on how the Ruby version drifts from the Python version, is it still Langchain?

On Thu, Jun 1, 2023, 11:10 PM Andrei Bondarev @.***> wrote:

I wanted to second the point above; the abstractions seem different than Langchain as I don't see chains and memory implemented. From my best guess the LLM is doing double duty as the LLM and the chain?

Yeah... we don't really have the abstractions fully fleshed out. I was hoping that better abstractions will eventually yield themselves and become more obvious.

Do you feel like it's detrimental to the project that we don't have the concepts of chains?

— Reply to this email directly, view it on GitHub https://github.com/andreibondarev/langchainrb/issues/57#issuecomment-1573075022, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6UK32AGZENA7AY3S4SOTXJFKT7ANCNFSM6AAAAAAYOF2D3M . You are receiving this because you commented.Message ID: @.***>

andreibondarev commented 1 year ago

@rolentle There's no affiliation with the official version.

rolentle commented 1 year ago

That feels weird then. Are the JS and Go versions affiliated? This gets into an awkward branding issue that if they are called the same thing I as a user would expect similar behavior and is being discussed in the Langchain discord. I remember Rails having a similar issue which is why DHH trademarked the term Rails. On Thu, Jun 1, 2023, 11:20 PM Andrei Bondarev @.***> wrote:

@rolentle https://github.com/rolentle There's no affiliation with the official version.

— Reply to this email directly, view it on GitHub https://github.com/andreibondarev/langchainrb/issues/57#issuecomment-1573081890, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6UK54WXU2662NVF25FJ3XJFLXLANCNFSM6AAAAAAYOF2D3M . You are receiving this because you were mentioned.Message ID: @.***>

andreibondarev commented 1 year ago

@rolentle AFAIK JS and Python are the official ones, and the Go version is a community one.

bborn commented 1 year ago

@andreibondarev just chiming in (hope it's helpful). I think if it's called Langchain.rb then people should expect parity (or at least similarity) to the py/js versions. If the abstractions are all going to be different, then it feels like a different library and maybe should have a different name?

I think LC nailed a few things, but also grew very fast and threw in a bunch of stuff that overlapped or got confusing. In my mind the main abstractions should be:

For indexing I'm more drawn to Llama's approach:

Re: Chains - I don't really find it that helpful, since I think of a Chain as just a subclass of an Agent (an agent that runs its tools in a predefined order as opposed to using the LLM to decide which to use next)

LC also has ToolKits, which are like preset Agents designed for a specific thing. I don't like the naming. They're just Agents that are prebuilt for you.

andreibondarev commented 1 year ago

@bborn Thank you for your detailed insights here!

So I think we ought to look at Langchain, LlamaHub, Guidance, and whatever other libraries + latest research and build the Ruby-flavored library (or "framework" if it grows into it) for building LLM-powered applications. It will most likely end up being a different (from the original Langchain) library because the language, the community, the conventions, the patterns, the MINASWAN 😊, and the needs are going to be different.

I think we've all read or heard anecdotal feedback from Langchain users claiming that it's clunky or an overkill, etc. I think it's a worthy pursuit to try and improve upon the original Langchain. We don't have all of the patterns figured out yet but I'm hoping that, rooted in real use-cases and continuous feedback and collaboration, the patterns will eventually yield themselves and become much more apparent.

@bborn I really like your Models, Tools, Memory and Agents breakdown, and I agree, I'm not too big of a fan of the concept of Chains. We already have Loaders (Processors) and Chunkers (WIP) and indexing & querying functionality. However -- we can still slice and dice (vertically or horizontally) existing classes into additional ones as the code base grows.

But yes, we may also need to eventually rebrand away from "langchain". (Having to have said this I think Langchain is an incredible product and they've done an amazing job with it).

bborn commented 1 year ago

@andreibondarev have you looked at https://github.com/PrefectHQ/marvin?

Some very cool ideas there too.

rthbound commented 1 year ago
  1. Is it clear what this library is meant to be used for?
    • Having heard of Langchain.ai I assume it is meant to be used for the same things.
  2. Did you have any problems installing and integrating this library into your project?
    • I don't always work with the latest versions of things, so I can't use this directly on every project I'd like to use it on. That's not on this library though.
  3. Did you run into any errors while using this library?
    • Maybe a few errors or warnings over dependency mismatches between some dependencies (ruby-openai, qdrant-ruby, and this project), but nothing that prevented using the library.
  4. Are you currently using this library in a project/prototype? Unless "in stealth mode" -- please share more info about your project.
    • Having fun with it. Have played with some agents, tools, and vectorsearch features and am finding it pretty useful.
    • Whether the features we release use this or something else (in python community probably), I still want to use this as a playground for our ruby developers to play around with building LLM powered features
  5. How well is this library documented?
    • I've just used the README so far and have had an okay time.
    • I looked there for documentation or examples on splitting documents as they are loaded into qdrant, but I did not find anything.
  6. What kind of features do you think this project is missing?
    • Nothing to add, sorry