module LittleGhost

Build AI features as ordinary Ruby classes. An Agent owns one model conversation. Larger units called Assemblies coordinate several Agents while keeping the same ask and stream_ask entrypoints.

Start with one model-driven behavior:

class CustomerSupportAgent < LittleGhost::Agent
  description "Handles support requests"
  model "openrouter:openai/gpt-5.6-luna"
  system_prompt "Answer customer questions clearly."
end

run = CustomerSupportAgent.ask("Why is transfer 481 still pending?")
run.completed? # => true
run.response
# One possible response: Transfer 481 is waiting for the receiving bank.

The class holds reusable behavior. Each call creates a Run, which records the result and closes the resources opened for that request. Workflow, Swarm, and Graph are Assembly types for coordinating more than one participant.

Configure LittleGhost before the first call. The first standalone call builds a shared Runtime from that configuration. with_configuration can select an independent configuration for one execution context.