The Ruby AI Podcast explores the intersection of Ruby programming and artificial intelligence, featuring expert discussions, innovative projects, and practical insights. Join us as we interview industry leaders and developers to uncover how Ruby is shaping the future of AI.
In this episode of the Ruby AI podcast, hosts Landon and Valentino discuss the exciting developments in the Ruby AI community. They explore three key gems: Ruby OpenAI, Raix, and Langchain.rb, highlighting their features, use cases, and the importance of evaluation methodologies like RAGAS in AI systems. The conversation emphasizes the collaborative spirit of the Ruby AI community and the potential for innovation in AI applications using Ruby.
Takeaways
The Ruby AI community is vibrant and growing.
Ruby OpenAI is essential for integrating OpenAI's capabilities.
Raix gem offers an object-oriented approach to AI in Ruby.
Langchain RB normalizes AI provider integrations in Ruby.
RAGAS provides a framework for evaluating AI outputs.
Community engagement is crucial for Ruby AI's growth.
Documentation is key for developers using these gems.
Collaboration among developers enhances innovation.
Well, hello, and welcome to the Ruby AI Podcast. I'm one of your hosts, Landon, and I'm here with Hey, I'm Valentino. And we're here to talk to you today in this first podcast about all the exciting stuff happening with Ruby and AI.
SPEAKER_00
Yeah, this is gonna be really exciting. Uh I'm excited. Yeah. Uh, you know, Landon, he's a avid conference talker about all of the machine learning stuff with Ruby. If you haven't seen any of his talks before, I would definitely recommend going to check them out to learn a lot. And, you know, we're both avid participants of uh, you know, the Ruby AI community. Join the Ruby AI Builders Discord if you are not a part of that. But there's just a lot going on, and we we would like to start exposing a lot of the community that is building stuff and to make it more approachable, to be honest.
SPEAKER_01
Yeah, definitely. Um so let's see, where do we want to go next? Uh we have three gyms we want to talk about. Um and we just want to kind of have this episode sort of lay down the groundwork of just some initial gyms that we've we've been looking at and maybe on in the future have some guests to kind of talk about different gyms that they're working on or different projects. Um and yeah, anything you want to add to that?
SPEAKER_00
Yeah, I'm hoping to get a ton of people on. And we've already gotten some uh you know soft yeses from a lot of folks uh building some of these frameworks. Um I'm hoping Obi will come on to talk about uh some stuff. Alex from the Ruby AI Gem, OpenAI Gem, he'll hopefully come on as well. Uh we're just hoping to really bring a lot of these people building stuff out and talking about how easy it is to get started and you know how how you can help out even if you're interested.
SPEAKER_01
And if you have any suggestions or questions that come up, you can always email me at landon.gray at hey.com or message me on LinkedIn. Uh where's the where's the best place to ping you, Valentino?
SPEAKER_00
Uh yeah, I'm on X, the codename V, or you can hit me up via email as well, v at codenamev.com. Either way, you know, send out your suggestions, recommendations. I mean, we're gonna start ripping through stuff and having a blast. There's so much cool stuff out there, and really excited to see where this goes. Awesome.
SPEAKER_01
Well, let's get into it. So the first gym that we have up is Ruby OpenAI. Tell us about it. I think I think many of us, if you're listening to this podcast, know about this gym.
SPEAKER_00
Yeah, I mean, open AI is certainly the forerunner of all these frontier models. Uh you know, they continue to outpace the industry. And so it is kind of like the de facto API
gem for Ruby. And so I think everybody at this point uses it.
SPEAKER_01
Yeah. I think there's some people who are maybe rolling rolling their own for some of these models too, if if it doesn't exist. But I wonder if there's anyone in the wild who's rolling their own and not using this one, though, on top of the it's pretty up to date. Like I used it recently to do some structured JSON stuff, so it's got all the new features.
SPEAKER_00
Yeah, I'm not sure his uh direct connection, but he has Alex, the author, he has some kind of special connection to OpenAI team where he got early access and and set up all of these this gem and and structure pretty solidly. And I know he has a very he's hesitant to take in too many things too early with the gem, which is very, very Ruby, to be honest. I think the Ruby core team has a similar approach, which is great for the long term. Uh and it's certainly held up, and you know, and any issues that I've experienced with the gem have been you know fixed pretty f quickly. So it's pretty stable.
SPEAKER_01
Yeah, it's great, great gem to get started. Um yeah.
SPEAKER_00
Cool. I mean it if you're just looking at, hey, I want to like generate some text or images or whatever you know the APIs offer, it has all of the things that you'll need. Yep.
SPEAKER_01
You just have to sign up to an open AI account to get your API key, and then you're ready to roll. And documentation's great too. Awesome. Next up is Ray. Did I get that right?
SPEAKER_00
Yeah.
SPEAKER_01
I keep wanting to call it. I don't know what I want to call it. X's throw me off. I feel like the X's shouldn't shouldn't have come into the English language, but they really look the X's silent. It's a silent X.
SPEAKER_00
Yeah, I mean Ray is pretty neat. Uh it kind of brings in the Rails and Ruby like mix-in strategies of AI. So if you want a more like object-oriented approach to uh bringing in AI in an easy way, it's it's really great for that. So they have a whole bunch of like, you know, if you want to do chat completions for an object you have, you could just include the the Ray chat completion and you get a whole bunch of helper methods to build up a transcript and complete it and do a whole bunch of fun stuff like adding functions to it uh to your object as well.
SPEAKER_01
Um nice. Have you been using it in any of your projects? I haven't had a chance to play around with this gem yet, but I I've seen people talking about it.
SPEAKER_00
Yeah, I ha I haven't released uh or made any announcement about it yet, but I'm building this thing called uh Daily Vibe. Uh pulls in the top headlines from the news API and then just like does a sentiment analysis and looks up and generates a playlist from Spotify. Nice. And so I use that uh to you know abstract a lot of the uh calls and uh it works really well. Yeah, I was just I was just messing around.
SPEAKER_01
Um nice. Anything else we want to say about Ray before
Yeah, I mean it's built, it's very solid, solidly built from Obi Fernandez, and uh there's a whole book kind of you know he has his you know AI patterns of application development using AI book that just like uses it throughout the book to show how to do different, you know, AI tasks. And yeah, it's just a great resource to just follow along too. So if you're looking to learn and get more advanced too, you could just like pick up the book and run through his uh framework. And uh yeah, it's it's really great for that.
SPEAKER_01
Definitely. And hopefully Obi comes on um and shares more about it. Um, but I know he was using it in uh his startup that he was working on, Olympia, uh, with his partner. Um and I mean yeah, a lot a lot of a lot of that I think I'm assuming a lot of that uh work that he did kind of got distilled into the book. If you check out the book, it's really great and kind of l uh outlines a lot of the patterns uh that that can be used to build like agentic you know, systems and things like that.
SPEAKER_00
Yeah, totally, and it's like you know, it's in production, it's got customers depending on it, and so it's it's a solid framework choice for sure.
SPEAKER_01
Good stuff. Awesome. So the last one is Langchain RB, and Andre put this one out. Um I've used it quite a bit initially. I I haven't been using Langchain as much lately, but when I was first getting started, there were some things like I forgot what I was doing it. I was building some use case to kind of demo things back in I don't know if it was 2022 or 2023, it's been so long. Um, but it was it was a great way to kind of get started um sort of building out pipelines um just to kind of see how they work and things like that. So um but it's been a minute since I've used it. Have you have you uh you have any thoughts on it? I know I know there's been a lot of updates too, and I guess I should give more context.
SPEAKER_00
So Python has the library, Langchain, and Langchain RB is I don't know if I'd call it quite a port of I mean would you call it like a port of is it it's not like one-to-one, like strictly no, I think it's follow so it's followed like uh it followed it initially, and I think it's kind of taken on its own Ruby version of it. Uh but yeah, I would say it's like trying to normalize providers. So like, you know, there's OpenAI, there's Anthropic, uh AWS Bedrock as an example. And so it gives helpers to abstract
that in a normal normalized way. So you can use many different providers, you can work with embeddings, yeah. A bunch of like kind of just helper methods and utility classes uh around all of these AI features that just makes it really easy to work with in a Ruby way. It's tastefully done. So I'm a little partial to this, Jim, because uh I have contributed to it uh to help like normalize even the uh completion functions and things like that. But I think it's really great. I use it also for doing a lot of the semantic chunking, so parsing a document and extracting the chunks you need to embed to do more advanced uh rag processes. But the Langchain Rails gem too, like also just makes it easy to do things with. So you could be like, hey, I have a product model in Rails, and I'm gonna use Langchain Rails for this particular model, and I can ask questions right about the product, and I'll do a similarity search for a whole bunch of other related features that you can just get for free by using the gem, which is really neat.
SPEAKER_01
Yeah, it's a great way to get started up and running fast. And you mentioned some of like the model integrations that it has. It also has a lot of um, and you may have mentioned this too, but it's it's got integrations with a lot of the uh vector database providers. So I know I think quadrants in there, I think Pinecone, a lot of the the major ones, I haven't checked the whole list, but um that that is definitely a plus to have when you're trying to get up and running pretty fast. So I think he added like uh ragos to it, which is like it's like I don't know how you how you say it, rag or I know someone would like to say Raj, but so all these words kind of take on their own pronunciation. But there's someone who wrote a paper on Ragos or Rajoth. I don't I don't know how you say it, but it's just like an evaluation methodology to kind of evaluate your retrieval augmented or rag systems that you might build with Langchain or any of these other tools. But I'm pretty sure that's like built-in or referenced somewhere in the documentation, so or there's maybe a plan on the roadmap to create it. I I haven't used that functionality of Langchain yet, but that's yeah, I've used it before.
SPEAKER_00
It's really it's really great. I I think it's good. Uh so we may be porting it out of there. Uh I'm not sure. Uh I'm I'm more, you know, I I haven't really found a good evaluation Ruby framework yet. Uh but Ragas is a great starter if you just want to gather up some uh you know some metrics on uh making sure your outputs are consistent and follow criteria. And so if you're not familiar with the Ragas metrics, there's like three or four different metrics that are compounded and added up together to create a score, and you just basically score your outputs based on the inputs and the context you give it, and it gives you like kind of a good baseline metric for how consistent it's producing the output that you expect it to, which is pretty great and like very much needed.
SPEAKER_01
Uh and there's a cool site called docs.rag.io that has like all the information that you could possibly want to know on Ragos.
SPEAKER_00
Yeah, and I I think it comes from the you know, the Langchain authors, you know, team or Langchain's team ultimately. Uh I think they kind of spearheaded this. I know OpenAI even used RAGA's evaluations for some of their GPT-4 work. And Harrison Chase, he he he's infamous for giving several talks at OpenAI on even the human feedback learning aspects, the reinforced learning. And so I think a a lot of that was also part of that work as well. Uh got it.
SPEAKER_01
And I think it's one of the few gems that actually has sort of this evaluation framework built in. So I think that is quite notable. I don't think there's many other Ruby Rails gems that you know have the evaluations, but no, yeah.
SPEAKER_00
I mean, uh, you know, at Doximity we used the the RAGUS evaluators in our very first product iterations to make sure that we were making as we were making changes, we didn't break things. And we continue to use it. So uh it's it's awesome. If you if you just use that out of the library, yeah, you'll go pretty far.
SPEAKER_01
Definitely. And we should drop, I saw like an article that came out of Doximity where they were kind of talking about evaluations for AI systems, and I really, really appreciated that one a lot. Um, I actually reached out to the author um blanking on names, but just to express my gratitude for that article, because I think it's it's really important when trying to build uh systems to know that you know if if we're building a non-AI system, you know, we have our unit tests, our integration tests to make sure that the functionality works. But with these non-deterministic systems, you definitely need some way to ensure that they're working to whatever level that you you need it, need for your organization. So that's the lineup.
SPEAKER_00
Yay! Yeah, I'm pretty I'm pretty excited. Uh I mean we're gonna we're gonna really go crazy into all of the details here and get into some really advanced stuff, but uh before we get there, we're gonna we're gonna ease it on in, you know, like do some very base level stuff, uh, make sure everyone's caught up with like what people are using just to get started, and you know, work through maybe some middle tier methods and then get into more advanced stuff. Uh and there's just so many different projects people are are coming out with and uh a lot of different ways you can use AI. And I think it's worth exploring how Ruby's really helping spearhead a lot of efforts in a in a lot of ways that aren't talked about.