Tools
Ruby classes connect agents to application capabilities through declared inputs and ordinary method calls.
LittleGhost is a Ruby library for building AI features. Its agents answer questions and call your application code. Start with one agent, then bring several together when the task needs a team.
After installing the gem, set OPENROUTER_API_KEY to a key from your OpenRouter account. This example sends your question to an AI model through that service. Getting Started walks through the setup.
$ ruby customer_support_agent.rb
Hi! Tell me what happened, and I'll help you find the next step.
A Graph lays out a task as named steps (node) and routes between them (edge). Here, research and logistics run in parallel after planning; the writer combines both results. The Agent definitions are omitted so you can focus on how they work together.
$ bundle exec ruby app.rb
Meet at the library next Thursday. Start with Why's Poignant Guide to Ruby, and invite neighbors through one shared signup page.
Ruby classes connect agents to application capabilities through declared inputs and ordinary method calls.
Use Ruby-directed workflows and graphs, model-directed subagents and swarms, or compose both.
Choose where child processes run and which files and network connections they can access. The native backend enforces those restrictions with Seatbelt on macOS or Bubblewrap on Linux.
Use OpenRouter, OpenAI-compatible APIs, Anthropic, Gemini, Vertex AI, or Bedrock behind the same interface.
Display answers as they are written and follow tool activity. Read the completed answer as text or data checked against a shape you define.
Save conversations between requests, set deadlines, cancel work, and inspect what happened during each request.