Overview of Raif - a Ruby AI Framework
mainRaif is a Ruby on Rails engine designed to add AI-powered features to Rails applications. It provides a full MVC (Model-View-Controller) stack specifically for working with Large Language Models (LLMs).
Key capabilities include:
- Tasks: Single-shot AI operations for organizing LLM prompts.
- Conversations: Full-stack LLM chat interfaces with multi-turn chat history preservation and streaming support.
- Agents: ReAct-style agents capable of using tools in loops.
- Custom Model Tools: Tools that tasks, conversations, or agents can invoke to interact with external systems.
- Provider-Managed Tools: Support for tools managed by the LLM provider (e.g., web search, code execution, image generation).
- Evals: Tools to evaluate the performance of LLM-powered features.
- Prompt Templates: ERB-based templates that support Rails view helpers and partials.
- Response Handling: Built-in support for structured JSON outputs, schemas, parsing, and HTML sanitization.
- Multimodal Support: Ability to include images and PDFs in prompts.
- Web Admin Interface: A dedicated interface for viewing and managing LLM interactions.