Skip to main content

Overview

Wrap your Vercel AI, LangChain, OpenAI, or Anthropic agent in one line — or build a custom agent from scratch. Deploy and start streaming responses to your users.
Building from scratch? Continue below to create a custom agent.

Installation

npm install @reminix/runtime

Custom Agent Example

Create agents using the agent() factory. Use the template option for standard I/O shapes (e.g. prompt, chat, task, rag, thread):
import { agent, serve } from '@reminix/runtime';

// Task-oriented agent (default prompt template)
const echo = agent('echo', {
  description: 'A simple echo agent',
  handler: async ({ prompt }) => `Echo: ${prompt}`
});

// Chat agent (chat template: messages in, string out)
const assistant = agent('assistant', {
  template: 'chat',
  description: 'A conversational assistant',
  handler: async ({ messages }) => {
    const last = (messages as Array<{ content?: string }>).at(-1)?.content ?? '';
    return `You said: ${last}`;
  }
});

// Run locally for testing
serve({ agents: [echo, assistant], port: 8080 });

Agent Structure

An agent consists of:
ComponentDescription
nameUnique identifier for your agent
descriptionHuman-readable description
inputInput schema (JSON Schema)
handlerThe handler function
const myAgent = agent('my-agent', {
  description: 'A helpful assistant',
  input: {
    type: 'object',
    properties: { prompt: { type: 'string' } },
    required: ['prompt']
  },
  handler: async ({ prompt }) => `Processed: ${prompt}`
});

const chatBot = agent('chat-bot', {
  template: 'chat',
  description: 'A chat bot',
  handler: async () => 'Hello!'
});

Running Locally

Test your agent before deploying:
// Start a local server
serve({ agents: [echo, assistant], port: 8080 });
Then test with the SDK:
import Reminix from '@reminix/sdk';

const client = new Reminix({ baseURL: 'http://localhost:8080' });

// Test task agent
const response = await client.agents.invoke('echo', {
  prompt: 'Hello!'
});
console.log(response.content);  // "Echo: Hello!"

// Test chat agent
const chatResponse = await client.agents.invoke('assistant', {
  messages: [{ role: 'user', content: 'Hello!' }]
});
console.log(chatResponse.message.content);  // "You said: Hello!"

Project Structure

Recommended structure for your agent project:
my-agent
index.ts
package.json
package.json
{
  "name": "my-agent",
  "type": "module",
  "dependencies": {
    "@reminix/runtime": "latest"
  }
}
Prefer organizing code in src/? Add build and start scripts — see Project Configuration for details.

Next Steps