Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
Hunter Hopkins avatar

Agent Service

  • 2 repo stars
  • Updated December 3, 2025
  • hhopkins95/agent-runtime

Skills and patterns for creating apps that use the agent service

About

agent-service is a Claude Code skill in the AI & Agent Building category. Skills and patterns for creating apps that use the agent service

  • agent-service
  • AI & Agent Building
  • AI-coding skill

Agent Service by the numbers

  • Data as of Jul 7, 2026 (Skillselion catalog sync)
/plugin marketplace add hhopkins95/agent-runtime
/plugin install agent-service@hhopkins-agent-service

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
repo stars2
Last updatedDecember 3, 2025
Repositoryhhopkins95/agent-runtime

What it does

Skills and patterns for creating apps that use the agent service

README.md

Agent Runtime

A flexible, framework-agnostic runtime for orchestrating AI agents (Claude, Gemini) in isolated sandboxes with real-time streaming support.

Overview

This repository contains two npm packages that work together to provide a complete agent orchestration solution:

Key Features

  • 🔒 Isolated Sandbox Execution - Run agents in secure Modal sandboxes
  • 🔄 Real-time Streaming - WebSocket-based streaming of agent responses
  • 💾 Flexible Persistence - Adapter pattern for any database (Convex, PostgreSQL, etc.)
  • 🎯 Architecture Agnostic - Support for Claude Agent SDK and Gemini CLI
  • ⚛️ React Integration - Complete set of hooks for building agent UIs
  • 📦 Type-Safe - Full TypeScript support with shared types

Installation

Backend Runtime

npm install @hhopkins/agent-runtime
# or
pnpm add @hhopkins/agent-runtime

React Client

npm install @hhopkins/agent-runtime-react
# or
pnpm add @hhopkins/agent-runtime-react

Quick Start

1. Set Up the Runtime (Backend)

The runtime requires you to provide adapters for persistence and configuration:

import { AgentRuntime } from '@hhopkins/agent-runtime';
import type { PersistenceAdapter, RuntimeConfig } from '@hhopkins/agent-runtime/types';

// Implement your persistence adapter
const persistenceAdapter: PersistenceAdapter = {
  async listAllSessions() { /* ... */ },
  async loadSession(sessionId) { /* ... */ },
  async createSessionRecord(data) { /* ... */ },
  async updateSession(sessionId, updates) { /* ... */ },
  // ... other methods
};

// Configure the runtime
const config: RuntimeConfig = {
  modal: {
    tokenId: process.env.MODAL_TOKEN_ID,
    tokenSecret: process.env.MODAL_TOKEN_SECRET,
  },
  anthropicApiKey: process.env.ANTHROPIC_API_KEY,
  persistence: persistenceAdapter,
  port: 3000,
};

// Start the runtime
const runtime = new AgentRuntime(config);
await runtime.start();

See backend/README.md for detailed runtime documentation.

2. Build the UI (React)

Use the React hooks to connect to your runtime:

import { AgentServiceProvider, useAgentSession, useMessages } from '@hhopkins/agent-runtime-react';

function App() {
  return (
    <AgentServiceProvider config={{
      apiUrl: 'http://localhost:3000',
      wsUrl: 'ws://localhost:3000',
      apiKey: 'your-api-key',
    }}>
      <AgentChat />
    </AgentServiceProvider>
  );
}

function AgentChat() {
  const { session, createSession, sendMessage } = useAgentSession();
  const { messages } = useMessages(session?.sessionId);

  // Build your UI...
}

See client/README.md for detailed React hooks documentation.

Architecture

┌─────────────────────────────────────────┐
│         Your Application                │
│  (React, Next.js, Express, etc.)        │
└────────────┬────────────────────────────┘
             │
             │ HTTP/WebSocket
             ↓
┌─────────────────────────────────────────┐
│    @hhopkins/agent-runtime (Backend)    │
│  • Session management                   │
│  • WebSocket streaming                  │
│  • Adapter integration                  │
└────────────┬────────────────────────────┘
             │
             ├──→ Modal Sandboxes (Agent execution)
             ├──→ Your Persistence Layer (via adapter)
             └──→ Your Custom Logic (via adapters)

Important: You Provide the Infrastructure

This library is a runtime and client, not a complete service. Your application must provide:

  • Persistence Layer - Implement PersistenceAdapter for your database (Convex, PostgreSQL, MongoDB, etc.)
  • Modal Account - For sandbox orchestration (Modal.com)
  • API Keys - Anthropic API key for Claude agents
  • Server Deployment - Host the runtime on your infrastructure (Railway, Fly.io, AWS, etc.)
  • Authentication - Add your own auth layer (JWT, OAuth, etc.)

See the backend README for a complete guide on implementing adapters.

Project Structure

agent-service/
├── backend/          # @hhopkins/agent-runtime
│   ├── src/
│   │   ├── core/     # Session management, event bus
│   │   ├── types/    # Shared type definitions
│   │   ├── transport/ # HTTP + WebSocket servers
│   │   └── lib/      # Agent architectures, utilities
│   └── sandbox/      # Modal sandbox configuration
│
├── client/           # @hhopkins/agent-runtime-react
│   ├── src/
│   │   ├── hooks/    # React hooks (useAgentSession, etc.)
│   │   ├── context/  # Provider and state management
│   │   └── client/   # REST + WebSocket clients
│   └── dist/         # Built output
│
└── README.md         # This file

Documentation

Requirements

  • Node.js >= 18
  • TypeScript >= 5.0 (recommended)
  • React >= 18.0 (for client package)

License

MIT

Contributing

Issues and pull requests are welcome! Please see individual package READMEs for development setup.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.