Coding

Relay To Agent

Send messages to configured AI agents and maintain separate multi-turn sessions from the command line.

What it does

Relay prompts to configured AI agents through any OpenAI-compatible Chat Completions endpoint, including OpenRouter, LiteLLM, vLLM, and Ollama. It lists available agents, supports multi-turn exchanges with named sessions, and can reset context before a new message. Responses can be printed normally or returned as raw JSON.

When to use it

  • Continuing a multi-turn agent conversation
  • Switching among configured AI agents
  • Testing local OpenAI-compatible endpoints
  • Starting a fresh session context

The skill document

Relay To Agent

Send messages to AI agents on any OpenAI-compatible endpoint. Works with Connect Chat, OpenRouter, LiteLLM, vLLM, Ollama, and any service implementing the Chat Completions API.

List available agents

node {baseDir}/scripts/relay.mjs --list

Send a message to an agent

node {baseDir}/scripts/relay.mjs --agent linkedin-alchemist "Transform this article into a LinkedIn post"

Multi-turn conversation

# First message
node {baseDir}/scripts/relay.mjs --agent connect-flow-ai "Analyze our latest campaign"

# Follow-up (same session, agent remembers context)
node {baseDir}/scripts/relay.mjs --agent connect-flow-ai "Compare with last month"

Reset session

node {baseDir}/scripts/relay.mjs --agent linkedin-alchemist --reset "Start fresh with this article..."

Options

FlagDescriptionDefault
--agent IDTarget agent identifier(required)
--resetReset conversation before sendingoff
--listList available agents
--session IDCustom session identifierdefault
--jsonRaw JSON outputoff

Configuration

agents.json

Configure agents and endpoint in {baseDir}/agents.json:

{
  "baseUrl": "https://api.example.com/v1",
  "agents": [
    {
      "id": "my-agent",
      "name": "My Agent",
      "description": "What this agent does",
      "model": "model-id-on-the-api"
    }
  ]
}

Environment variables

export RELAY_API_KEY="sk-..."          # API key (required)
export RELAY_BASE_URL="https://..."    # Override base URL from config
export RELAY_CONFIG="/path/to/agents.json"  # Custom config path

Compatible Services

  • Connect Chatapi.connectchat.ai/api
  • OpenRouteropenrouter.ai/api/v1
  • LiteLLMlocalhost:4000/v1
  • vLLMlocalhost:8000/v1
  • Ollamalocalhost:11434/v1
  • Any OpenAI-compatible API

Session Management

Sessions are stored locally at ~/.cache/relay-to-agent/sessions/. Each agent+session combination keeps up to 50 messages. Use --session for parallel conversations with the same agent.

--agent and --session values are restricted to [A-Za-z0-9._-]; path separators and .. are rejected so session files stay inside the cache directory.

Privacy Notice

This skill is a relay: each message you send — plus prior session history — is transmitted to the configured OpenAI-compatible endpoint (baseUrl / RELAY_BASE_URL), which may be a third-party service. Conversation transcripts (up to 50 messages per session) are also persisted in plaintext on disk at ~/.cache/relay-to-agent/sessions/.

  • Do not send secrets, credentials, or regulated/sensitive data unless you trust the endpoint and control the machine.
  • Use --reset to clear a session before sending, or delete files under the cache dir to remove stored history.
  • Point baseUrl/RELAY_BASE_URL only at endpoints you trust.

Questions people ask

How are agents and API endpoints configured?
Define the base URL and each agent’s ID, name, description, and model in `agents.json`. Set `RELAY_API_KEY`; `RELAY_BASE_URL` and `RELAY_CONFIG` can override the endpoint and config path.
Can I keep multiple conversations with the same agent?
Yes. Pass `--session ID` to maintain parallel conversations; each agent-and-session pair retains up to 50 messages locally.
Where is conversation data sent and stored?
Each message and its prior session history is sent to the configured endpoint. Transcripts are also stored in plaintext under `~/.cache/relay-to-agent/sessions/`, so use only trusted endpoints and machines.

Related skills

Install goal-linked tracking, diagnose product behavior, and choose one defensible next growth action.

163 installs2 stars

Design, debug, evaluate, and harden framework-agnostic agents with explicit limits, tools, and escalation rules.

79 installs4 stars

Chat with owned 37Soul hosts, inspect their activity, update allowed profile fields, and direct posts.

139 installs6 stars

Upload an image and receive a public CDN URL with retention based on its size and selected tier.

105 installs7 stars

Query Google Ads accounts and performance data with GAQL through managed OAuth.

261 installs20 stars

Install, switch, validate, export, restore, and publish Soul Spec personas from the CLI.

50 installs