Skip to content

Simple example agent demonstrating tool calls, evals, rag, TODO: human in the loop, and structured output

Notifications You must be signed in to change notification settings

swinner2/llm_agent_example

Repository files navigation

LLM Agent Example

A demonstration project showcasing different LLM agent patterns using the ruby_llm gem.

Overview

This project demonstrates various Large Language Model (LLM) agent capabilities:

  • Basic Chat: Interactive conversations with a helpful AI assistant
  • Tool Calls: Enabling the LLM to use external tools for enhanced functionality
  • RAG (Retrieval Augmented Generation): Vector search for movies to answer domain-specific questions

Integrated Tools

  • Dad Joke Generator: Fetches random dad jokes from an external API
  • Image Generation: Creates images based on text prompts
  • Reddit Posts: Retrieves the latest posts from Reddit
  • Movie Search: Vector-based semantic search for movie information (actors, directors, ratings, etc.)

Getting Started

  1. Setup database
bin/rails db:create db:migrate db:seed
  1. Import movie dataset
bin/rails import:movies
  1. Start the server
bin/dev
  1. Visit http://localhost:3000 in your browser

Usage Examples

Chat Interaction

  • Start a new chat and interact with the AI assistant
  • Ask general questions or have casual conversation

Tool Usage

  • Ask for a dad joke: "Tell me a dad joke"
  • Generate an image: "Create an image of a space cat"
  • Get Reddit updates: "What's trending on Reddit?"

Movie Information

  • Query movie details: "Who directed The Godfather?"
  • Find recommendations: "What are some good sci-fi movies from the 90s?"
  • Compare movies: "Which had better reviews, Avatar or Titanic?"

About

Simple example agent demonstrating tool calls, evals, rag, TODO: human in the loop, and structured output

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published