Project

brute

0.0
There's a lot of open issues
Production-grade coding agent with tool execution, middleware pipeline, context compaction, session persistence, and multi-provider LLM support.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 13.0
~> 1.0

Runtime

 Project Readme

brute

A framework-agnostic coding agent for Ruby. Rack-style middleware pipelines for agent turns, a full set of coding tools, and session persistence — bring your own LLM library.

Brute treats an agent turn the way Rack treats an HTTP request: an env hash flowing through a middleware stack toward a terminal app. The middleware handles the agentic machinery — the tool loop, session persistence, the system prompt, iteration guards. The terminal app is a proc you write with whatever LLM library you prefer (ruby_llm, llm.rb, the official openai or anthropic gems, or raw HTTP). Brute depends on none of them.

Usage

See the project documentation:

Quick start

require "brute"
require "ruby_llm"

agent = Brute.agent
  .use(Brute::Middleware::SessionLog, path: "tmp/session.jsonl")
  .use(Brute::Middleware::SystemPrompt)
  .use(Brute::Middleware::Loop::ToolResult)
  .use(Brute::Middleware::MaxIterations)
  .use(Brute::Middleware::ToolPipeline, tools: Brute::Tools::ALL)
  .run do |env|
    response = provider.complete(
      Brute::MessageTransport::RubyLLM.dump_all(env[:messages]),
      tools: rubyllm_tools(env[:tools]), model: model,
    )
    Brute::MessageTransport::RubyLLM.wrap_each(response) { |m| env[:messages] << m }
  end

agent.start("What files are in the current directory?")

Docs

The documentation site is a Just the Docs Jekyll project under docs/. Serve it locally:

docs/bin/serve.sh          # http://localhost:4000/brute/

See Also

  • Examples directory — the same agent on four LLM libraries, plus sub-agents, sessions, and HTTP serving.

License

MIT