| Maintainer of DSPy.rb here. The key difference is the level of abstraction: RubyLLM gives you a clean API for LLM calls and tool definitions. You're still writing prompts and managing conversations directly. DSPy.rb treats prompts as functions with typed signatures. You define inputs/outputs and the framework handles prompt construction, JSON parsing, and structured extraction. Two articles that might help: 1. "Building Your First ReAct Agent" shows how to build tool-using agents with type-safe tool definitions [0]. 2. "Building Chat Agents with Ephemeral Memory" demonstrates context engineering patterns (what the LLM sees vs. what you store), cost-based routing between models, and memory management [1]. The article's approach (RubyLLM + single tool) works great for simple cases. DSPy.rb shines when you need to decompose into multiple specialized modules with different concerns. Some examples: separate signatures for classification vs. response generation, each optimized independently with separate context windows and memory to maintain. Would love to learn how dspy.rb is working for you! Note that RubyLLM and DSPy.rb aren't mutually exclusive (`gem 'dspy-ruby_llm'`) adapter gives us access to a TON of providers. [0] https://oss.vicente.services/dspy.rb/blog/articles/react-age...
[1] https://oss.vicente.services/dspy.rb/blog/articles/ephemeral... |