Think. Act. Repeat.
A minimal agentic AI application built on the ReAct (Reasoning + Acting) loop pattern.
BotiasLoop gives your AI agent full shell access and web search capabilities via multiple LLM providers. Designed for dedicated infrastructure following the Rails Doctrine β beautiful code, sensible defaults, sharp knives.
- Ruby 3.4 or higher
- API key from your preferred LLM provider (see supported providers below)
- (Optional) SearXNG instance for web search
gem install botiasloopgit clone https://github.com/0x7466/botiasloop.git
cd botiasloop
bundle install
bundle exec rake install# Install mise if not already installed
curl https://mise.run | sh
# Install Ruby and dependencies
mise install
# Run with mise-managed Ruby
mise exec ruby -- bundle install# 1. Configure your API key
export BOTIASLOOP_API_KEY="your-api-key"
# 2. Start chatting
botiasloop cli
# 3. Ask anything!
You: What's the weather in Tokyo?
Agent: I'll search for the current weather in Tokyo for you.
[Tool] Executing web_search with arguments: {"query"=>"current weather Tokyo Japan"}
The weather in Tokyo is currently...- ReAct Loop β AI reasons, acts using tools, observes results, and repeats
- 12+ LLM Providers β OpenRouter, OpenAI, Anthropic, Gemini, DeepSeek, Mistral, Perplexity, Ollama, and more
- Shell Access β Execute any shell command (full system access)
- Web Search β Search the web via SearXNG integration
- Token Tracking β Monitor input/output tokens per conversation
- CLI Mode β Interactive REPL for local usage
- Telegram Bot β Chat with your agent anywhere
- Multi-Channel β Run CLI + Telegram simultaneously
- One-Shot Mode β Single command execution
- Persistent Storage β JSONL-backed conversation history
- UUID Tracking β Every conversation has a unique ID
- Auto-Labeling β Conversations get human-readable names
- Conversation Switching β Jump between active chats
- Archiving β Keep your workspace clean
| Tool | Description |
|---|---|
π§ shell |
Execute any shell command |
π web_search |
Search the web via SearXNG |
Skills follow the agentskills.io specification:
- Load default skills from
data/skills/ - Load custom skills from
~/skills/ - Progressive disclosure: name/description in system prompt, full content on demand
- Includes
skill-creatorskill for creating new skills
Manage conversations with intuitive commands:
| Command | Description |
|---|---|
/new |
Start a new conversation |
/switch <label|uuid> |
Switch to a different conversation |
/label <name> |
Label the current conversation |
/conversations |
List all conversations |
/reset |
Clear current conversation history |
/compact |
Summarize and archive old messages |
/status |
Show current model, token usage |
/archive |
Archive old conversations |
/system_prompt |
Show current system prompt |
/verbose |
Toggle verbose mode (show tool calls) |
/help |
Show available commands |
BotiasLoop intentionally provides full shell access without restrictions. This is a feature, not a bug. It's designed for dedicated infrastructure where raw power is needed, not personal devices.
The agent can:
- Execute any shell command
- Read, write, and delete any file
- Install software
- Modify system configuration
- Access network resources
Following the Rails Doctrine:
- Optimize for programmer happiness β Beautiful, readable Ruby code
- Convention over Configuration β Sensible defaults, minimal setup required
- The menu is omakase β Curated stack (ruby_llm, StandardRB, RSpec)
- No one paradigm β Practical over pure - use what works
Start interactive REPL:
botiasloop cliExit with: exit, quit, \q, or Ctrl+C
Send a single message:
botiasloop "What's the weather in Tokyo?"Start the gateway to enable Telegram and other channels:
# Run in foreground
botiasloop gateway
# Systemd service management (boot auto-start)
botiasloop gateway enable # Install and enable boot auto-start
botiasloop gateway start # Start the service now
botiasloop gateway status # Check service status
botiasloop gateway stop # Stop the service
botiasloop gateway logs # View service logs
botiasloop gateway disable # Disable boot auto-start and uninstall$ botiasloop cli
botiasloop v0.0.1 - Interactive Mode
Type 'exit', 'quit', or '\q' to exit
You: What files are in this directory?
Agent: I'll check what files are in the current directory for you.
[Tool] Executing shell with arguments: {"command"=>"ls -la"}
Exit: 0
Stdout:
total 128
drwxr-xr-x 10 user staff 320 Feb 22 14:00 .
drwxr-xr-x 5 user staff 160 Feb 22 13:00 ..
-rw-r--r-- 1 user staff 2345 Feb 22 14:00 README.md
...
Here are the files in your current directory...
You: /label my-project
Agent: **Conversation labeled as `my-project`**
You: /verbose
Agent: **Verbose mode enabled** β You will now see reasoning and tool execution details.
You: exit
Goodbye!Create ~/.config/botiasloop/config.yml:
providers:
openrouter:
api_key: "your-openrouter-api-key"
model: "moonshotai/kimi-k2.5"providers:
openai:
api_key: "your-openai-api-key"
model: "gpt-4o"providers:
anthropic:
api_key: "your-anthropic-api-key"
model: "claude-3-5-sonnet-20241022"providers:
ollama:
api_base: "http://localhost:11434/v1"
model: "llama3.2"# Required: Provider configuration
providers:
openrouter:
api_key: "your-api-key"
model: "moonshotai/kimi-k2.5"
# Optional: Web search configuration
tools:
web_search:
searxng_url: "http://localhost:8080"
# Optional: Maximum ReAct iterations (default: 20)
max_iterations: 20
# Optional: Telegram channel
channels:
telegram:
bot_token: "your-telegram-bot-token"
allowed_users: [] # Empty = allow all, or list specific user IDs
# Optional: Logging
logger:
level: "info" # debug, info, warn, error
destination: "stdout" # stdout, stderr, or path to log fileEnvironment variables override config file values:
| Variable | Description |
|---|---|
BOTIASLOOP_API_KEY |
API key for the active provider |
BOTIASLOOP_SEARXNG_URL |
SearXNG URL for web search |
BOTIASLOOP_LOG_LEVEL |
Log level (debug, info, warn, error) |
- Execute any shell command
- Read, write, and delete any file
- Install software
- Modify system configuration
- Access network resources
Use only on dedicated infrastructure, never on personal devices or production systems containing sensitive data.
- Sandboxed execution (Docker/Firejail)
- Command whitelist/blacklist
- Confirmation for destructive operations
- Read-only mode option
- Secret management integration
# Clone repository
git clone https://github.com/0x7466/botiasloop.git
cd botiasloop
# Install dependencies
bundle installTest-first development is required:
# Run all tests
bundle exec rspec
# Run specific test file
bundle exec rspec spec/unit/agent_spec.rb
# Run specific test by line number
bundle exec rspec spec/unit/agent_spec.rb:42
# Check coverage (after running tests)
open coverage/index.htmlCode must pass StandardRB with zero offenses:
# Check for offenses
bundle exec standardrb
# Auto-fix offenses
bundle exec standardrb --fix# Run tests + linting
bundle exec rakebotiasloop/
βββ bin/
β βββ botiasloop # CLI executable
βββ lib/
β βββ botiasloop.rb # Main entry point
β βββ botiasloop/
β βββ agent.rb # Main orchestrator
β βββ loop.rb # ReAct cycle implementation
β βββ config.rb # Configuration management
β βββ conversation.rb # Conversation persistence
β βββ conversation_manager.rb # Multi-conversation management
β βββ auto_label.rb # Auto-labeling conversations
β βββ tool.rb # Base tool class
β βββ tools/
β β βββ registry.rb # Tool registration
β β βββ shell.rb # Shell execution
β β βββ web_search.rb # SearXNG search
β βββ skills/
β β βββ skill.rb # Skill model
β β βββ loader.rb # Skill loading
β β βββ registry.rb # Skill registry
β βββ commands/
β β βββ registry.rb # Command registry
β β βββ context.rb # Execution context
β β βββ *.rb # Individual commands
β βββ channels/
β β βββ base.rb # Channel base class
β β βββ cli.rb # CLI channel
β β βββ telegram.rb # Telegram bot
β βββ channels_manager.rb # Multi-channel orchestration
β βββ systemd_service.rb # Service management
βββ data/
β βββ skills/ # Default skills
βββ spec/ # Test suite
βββ README.md # This file
See ROADMAP.md for detailed planned features:
- Persistent Memory β Vector database for semantic search
- Custom Tools β Load tools from
~/tools/ - Conversation Compaction β Automatic summarization
- Subagents β Specialized agent instances
- Streaming Responses β Real-time token display
- Multi-Modal β Image analysis, audio transcription
- Web Dashboard β Browser-based management UI
- Plugin System β Load plugins from gems
- Fork the repository
- Create a feature branch
- Write tests first (TDD required)
- Implement the feature
- Ensure all tests pass:
bundle exec rspec - Ensure zero linting offenses:
bundle exec standardrb - Commit with descriptive message
- Push to your fork
- Create a Pull Request
- Test-First β All features built using TDD
- Sharp Knives β Keep raw power, minimal restrictions
- Rails Doctrine β Optimize for programmer happiness
- Privacy First β Local-first, user-controlled data
- Unix Philosophy β Do one thing well, compose with other tools
MIT License β see LICENSE file for details.
Built by Tobias Feistmantl with inspiration from nanobot and the Ruby on Rails doctrine.
Powered by:
- ruby_llm β Unified LLM API
- OpenRouter β Unified LLM API gateway
- SearXNG β Privacy-respecting metasearch
β‘ Built with sharp knives. Use responsibly.