langchainrb  by patterns-ai-core

Ruby SDK for building LLM-powered applications

created 2 years ago
1,878 stars

Top 23.6% on sourcepulse

GitHubView on GitHub
Project Summary

Langchain.rb provides a Ruby interface for building LLM-powered applications, targeting Ruby developers who want to integrate advanced AI capabilities like RAG and conversational assistants into their projects. It offers a unified API for various LLM providers and vector databases, simplifying complex AI workflows.

How It Works

The gem abstracts interactions with LLMs, offering consistent methods for text generation, chat completions, and embeddings across providers like OpenAI, Anthropic, and Google Gemini. It also provides a unified interface for numerous vector search databases (Chroma, Pinecone, Qdrant, etc.) crucial for RAG systems. The Assistant class orchestrates LLMs, tools, and conversation history for building chatbots.

Quick Start & Requirements

  • Install via Bundler: bundle add langchainrb
  • Additional gems are required per feature (e.g., weaviate-ruby, chroma-db).
  • API keys for LLM providers and vector databases are necessary.
  • See Examples for usage.

Highlighted Details

  • Unified interface for 10+ LLM providers and 8+ vector databases.
  • Assistant class for building chatbots with tool integration and conversation management.
  • Built-in tools for calculator, database interaction, file system access, and API wrappers (Wikipedia, NewsAPI).
  • Evaluations module for RAG pipeline assessment using RAGAS metrics.
  • Supports structured output parsing with JSON schema and output fixing.

Maintenance & Community

  • Active development with a Discord community available.
  • Contributing guidelines are provided on GitHub.

Licensing & Compatibility

  • MIT License.
  • Permissive license suitable for commercial use and integration into closed-source applications.

Limitations & Caveats

Streaming responses are not supported for all LLMs. The RubyCodeInterpreter tool requires the safe_ruby gem, which is noted as needing a better solution.

Health Check
Last commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
6
Issues (30d)
2
Star History
127 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.