Skip to main content

An interactive RLM (Recursive Language Model) agent built on DSPy

Project description

rlmy

An interactive RLM (Recursive Language Model) agent built on DSPy.

rlmy is pronounced "ar-leh-mee" — like the letters R-L-M out loud ("ar-el-em"), but let them slur together. Think "RLM-y."

What is this?

  • An AI coding agent that runs in your terminal
  • Uses DSPy's RLM framework — the LLM writes and executes Python code iteratively
  • Connects to MCP servers (Slack, internal tools, etc.) as additional tools
  • Maintains conversation state across turns (trajectory persistence)
  • Supports cooperative interrupt (Ctrl+C pauses gracefully)

Key Features

  • Iterative REPL: LLM writes code, sees output, writes more code — until it solves the problem
  • MCP Integration: Connect any MCP-compatible tool server
  • Filesystem Tools: Read, write, edit files with safety guards (read-before-write)
  • Shell Access: Run shell commands with deny-list safety and approval system
  • Trajectory Persistence: Resume sessions where you left off
  • Conversation Continuity: Prior context injected into new turns
  • Configurable Models: Use any DSPy-compatible LM (Anthropic, Bedrock, OpenAI, Groq, Ollama)

Prerequisites

  • Valid LLM credentials (Anthropic API key, AWS profile for Bedrock, etc.)
  • Python 3.12+ and Deno are installed automatically by the setup script

Installation

Recommended (installs Deno + uv + rlmy in one command):

curl -LsSf https://raw.githubusercontent.com/diego-lima/rlmy/main/setup_install.sh | bash

Alternative (if you already have Deno and uv):

uv tool install rlmy

Quick Start

rlmy
  • First run asks which AI model to use (model selection wizard)
  • Workspaces are created in ~/.config/rlmy/sandboxes/
  • Ctrl+C pauses gracefully (doesn't lose work)

To skip the wizard (headless/CI):

export RLM_MAIN_MODEL='bedrock/us.anthropic.claude-sonnet-4-6'
export RLM_SUB_MODEL='bedrock/us.anthropic.claude-sonnet-4-6'
rlmy

Try It Out

If your credentials are set, run rlmy and type:

curl https://calmcode.io/static/data/pokemon.json straight into a variable and teach me something about it.

Watch it fetch the data, explore it with code, and teach you something you didn't know. This is the RLM loop in action: it'll iterate until it has a neat insight.

demo-rlmy-pokemon

Configuration

  • Priority: env vars > config file > wizard
  • Config file: ~/.config/rlmy/config.toml
  • Supported model formats: any DSPy model string (e.g., bedrock/us.anthropic.claude-sonnet-4-6, bedrock/us.anthropic.claude-opus-4-6-v1)

MCP Tools (optional)

  • Config location: ~/.config/rlmy/mcp_servers.json
  • The setup script creates an empty template
  • Edit it to connect Slack, internal tools, or any MCP-compatible server
  • Agent starts without MCP if config is empty (no crash)

CLI Options

  • --sandbox-root PATH: Override sandbox directory (default: ~/.config/rlmy/sandboxes/)
  • --cache-path PATH: Override workspace cache file

Architecture

  • Built on DSPy's experimental RLM module
  • InterruptableRLM: cooperative SIGINT + trajectory injection
  • Sandboxed code execution via Deno + Pyodide (WASM)
  • Tools are plain Python functions registered with DSPy

License

MIT

Status

  • Early release — works well for the author, may have rough edges
  • Feedback welcome via GitHub issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rlmy-0.1.2.tar.gz (65.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rlmy-0.1.2-py3-none-any.whl (66.2 kB view details)

Uploaded Python 3

File details

Details for the file rlmy-0.1.2.tar.gz.

File metadata

  • Download URL: rlmy-0.1.2.tar.gz
  • Upload date:
  • Size: 65.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rlmy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 84bfefc5edb85a54de23297cd8bd2842f453441922fcf6fcec9e9e991add2c5a
MD5 237407acb0e07e475b35b725a68f8533
BLAKE2b-256 cda24c9cc1be8e05afaf4b4b2047dee1195128d7b9f99535d70cd0da2e3d97f4

See more details on using hashes here.

File details

Details for the file rlmy-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rlmy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 66.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rlmy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a0ef835f98e50bf5cd910a32973ce71702c02ccab889084f6653a56e47bf93e8
MD5 cdcf8474d72083fa439c88d806fdbcf7
BLAKE2b-256 9784488923569d3d54a6c1d135a295908acf968e84ac6e5066709e577b6f3f59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page