✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Carlos
  • Updated: March 22, 2026
  • 3 min read

Building a Specialized OpenClaw Agent: A Step‑by‑Step Guide Using the Plugin Rating API and Full‑Stack Template

# Building a Specialized OpenClaw Agent

## Introduction
In this guide we walk you through creating a **customer‑support assistant** powered by the OpenClaw framework. We’ll use the **Plugin Rating API** to rank responses and the **Full‑Stack Template** to wire up the front‑end, back‑end, and deployment pipeline.

## Architecture Overview

+——————-+ +——————-+ +——————-+
| Front‑End UI | | OpenClaw Core | | Plugin Rating API |
+——————-+ +——————-+ +——————-+
^ ^
| |
v v
+——————-+ +——————-+
| Authentication | | Persistence DB |
+——————-+ +——————-+

* **Front‑End UI** – React/Next.js page served from UBOS.
* **OpenClaw Core** – Handles conversation flow, context management, and tool execution.
* **Plugin Rating API** – External service that scores each generated answer; the highest‑scoring answer is returned to the user.
* **Authentication** – JWT‑based guard for secure access.
* **Persistence DB** – Stores conversation history (PostgreSQL).

## Step‑by‑Step Implementation

### 1. Scaffold the Project
bash
npx create-openclaw-agent my-support‑assistant
cd my-support‑assistant

### 2. Add the Rating Plugin
Edit `plugins/ratings.js`:
javascript
import axios from ‘axios’;

export async function rateResponse(response) {
const res = await axios.post(‘https://rating.api.ubos.tech/evaluate’, {
text: response,
context: ‘customer‑support’
});
return res.data.score; // 0‑1
}

### 3. Wire the Plugin into the Agent
javascript
import { rateResponse } from ‘./plugins/ratings’;

export async function generateAnswer(prompt, context) {
const candidates = await openClaw.generateMultiple(prompt, context);
const scored = [];
for (const cand of candidates) {
const score = await rateResponse(cand);
scored.push({ cand, score });
}
// Return the highest‑scoring candidate
scored.sort((a, b) => b.score – a.score);
return scored[0].cand;
}

### 4. Create the Front‑End Component
tsx
import { useState } from ‘react’;
import axios from ‘axios’;

export default function SupportChat() {
const [msg, setMsg] = useState(”);
const [history, setHistory] = useState([]);

const send = async () => {
const res = await axios.post(‘/api/chat’, { message: msg });
setHistory([…history, { user: msg, bot: res.data.reply }]);
setMsg(”);
};

return (

{/* render history */}