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

Learn more
Carlos
  • Updated: March 17, 2026
  • 6 min read

Building an AI‑Agent Recommendation Feed with OpenClaw Rating API and Moltbook

You can build a real‑time AI‑agent recommendation feed by fetching product ratings from the OpenClaw Rating API, storing them in Moltbook, and deploying the whole pipeline on the UBOS platform.

1. Introduction

Recommendation engines are the backbone of modern digital experiences – from e‑commerce storefronts suggesting the next best‑selling item to SaaS dashboards surfacing the most relevant AI agents for a user’s workflow. In this tutorial we walk software developers through an end‑to‑end implementation that combines three powerful building blocks:

  • OpenClaw Rating API – a public service that aggregates user‑generated ratings for AI agents.
  • Moltbook – a lightweight, vector‑enabled datastore that excels at similarity search and ranking.
  • UBOS – a no‑code/low‑code cloud platform that lets you spin up, scale, and monitor micro‑services in minutes.

By the end of this guide you will have a fully functional recommendation feed that can be queried via a simple HTTP endpoint, ready for integration into any front‑end application.

2. Overview of OpenClaw Rating API

The OpenClaw Rating API provides a RESTful interface to retrieve aggregated scores for AI agents across multiple categories (accuracy, speed, usability, etc.). The API is rate‑limited to 120 requests per minute, returns JSON, and supports pagination.

Key endpoints:

GET /v1/agents?category=chatbot&page=1&limit=50
GET /v1/agents/{agent_id}/ratings
GET /v1/categories

Typical response for a single agent:

{
  "agent_id": "gpt-4",
  "name": "ChatGPT‑4",
  "average_rating": 4.7,
  "rating_count": 1243,
  "category": "chatbot",
  "last_updated": "2024‑12‑01T08:45:00Z"
}

3. Introduction to Moltbook

Moltbook is a cloud‑native, schema‑flexible database that stores JSON documents alongside vector embeddings. It shines when you need to perform semantic similarity queries – perfect for recommendation scenarios where you want to surface agents that are not only highly rated but also contextually relevant to a user’s query.

Core features relevant to this tutorial:

  • Automatic indexing of numeric fields (e.g., average_rating).
  • Full‑text search on name and category.
  • Vector similarity search using OpenAI embeddings (optional).
  • RESTful CRUD API with built‑in pagination.

4. End‑to‑end architecture diagram

The diagram below visualises the data flow from OpenClaw to the consumer endpoint hosted on UBOS.

Architecture diagram showing OpenClaw → UBOS worker → Moltbook → API endpoint

*All components run in isolated containers managed by UBOS, ensuring automatic scaling and zero‑downtime deployments.

5. Code snippet: Fetching ratings from OpenClaw

We’ll use a lightweight Node.js script that runs as a scheduled UBOS worker. The script pulls the latest ratings, transforms them, and pushes them to Moltbook.

// fetch-openclaw.js
const fetch = require('node-fetch');
const MOLTB_API = process.env.MOLTBOOK_ENDPOINT;
const OPENCLAW_API = 'https://api.openclaw.io/v1/agents';
const PAGE_SIZE = 50;

async function fetchPage(page = 1) {
  const url = `${OPENCLAW_API}?category=chatbot&page=${page}&limit=${PAGE_SIZE}`;
  const res = await fetch(url);
  if (!res.ok) throw new Error(`OpenClaw error: ${res.status}`);
  return res.json();
}

async function upsertToMoltbook(agent) {
  const response = await fetch(`${MOLTB_API}/documents/${agent.agent_id}`, {
    method: 'PUT',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(agent),
  });
  if (!response.ok) console.warn(`Moltbook upsert failed for ${agent.agent_id}`);
}

(async () => {
  let page = 1;
  while (true) {
    const data = await fetchPage(page);
    if (!data.results.length) break;
    for (const agent of data.results) {
      await upsertToMoltbook(agent);
    }
    page++;
  }
  console.log('OpenClaw sync completed');
})();

Deploy this script on UBOS using the UBOS platform overview. The platform will automatically handle environment variables, logging, and scaling.

6. Code snippet: Storing and serving recommendations with Moltbook

Next, we expose a simple HTTP endpoint that queries Moltbook for the top‑rated agents. The endpoint supports optional filters such as category and min_rating.

// api-recommendations.js
const express = require('express');
const fetch = require('node-fetch');
const app = express();
const MOLTB_API = process.env.MOLTBOOK_ENDPOINT;

app.get('/recommendations', async (req, res) => {
  const { category = 'chatbot', min_rating = 4.0, limit = 10 } = req.query;
  const query = {
    filter: {
      category: { eq: category },
      average_rating: { gte: parseFloat(min_rating) }
    },
    sort: [{ field: 'average_rating', order: 'desc' }],
    limit: parseInt(limit)
  };
  const response = await fetch(`${MOLTB_API}/search`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(query)
  });
  const results = await response.json();
  res.json({ recommendations: results.hits });
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => console.log(`Recommendation API listening on ${PORT}`));

UBOS’s Web App Editor lets you package this Express app into a container with a single click. Once deployed, the endpoint becomes publicly reachable at https://<your‑app>.ubos.tech/recommendations.

7. Deploying the service on UBOS

UBOS abstracts away the traditional DevOps friction. Follow these steps to get your recommendation feed live:

  1. Create a new project in the UBOS dashboard.
  2. Add two services:
    • OpenClaw Sync Worker – upload fetch-openclaw.js and set it as a scheduled job (e.g., every 15 minutes).
    • Recommendation API – upload api-recommendations.js and expose it on port 3000.
  3. Configure environment variables:
    MOLTBOOK_ENDPOINT=https://api.moltbook.io/v1
    OPENCLAW_API_KEY=YOUR_KEY_HERE
  4. Enable auto‑scaling in the Workflow automation studio so that traffic spikes automatically spin up additional containers.
  5. Deploy with a single click. UBOS will provision TLS certificates, health checks, and a monitoring dashboard.

After deployment, you can verify the worker logs in the Workflow automation studio and test the API with curl:

curl "https://my-recommender.ubos.tech/recommendations?category=chatbot&min_rating=4.5&limit=5"

8. Testing the recommendation feed

Robust testing ensures that your feed remains accurate as new ratings arrive. Below is a Jest‑based test suite that validates both data freshness and ranking logic.

// recommendation.test.js
const fetch = require('node-fetch');

test('API returns at most the requested limit', async () => {
  const limit = 3;
  const res = await fetch(`https://my-recommender.ubos.tech/recommendations?limit=${limit}`);
  const json = await res.json();
  expect(json.recommendations).toHaveLength(limit);
});

test('All returned agents meet the minimum rating', async () => {
  const minRating = 4.2;
  const res = await fetch(`https://my-recommender.ubos.tech/recommendations?min_rating=${minRating}`);
  const { recommendations } = await res.json();
  recommendations.forEach(agent => {
    expect(agent.average_rating).toBeGreaterThanOrEqual(minRating);
  });
});

test('Agents are sorted by rating descending', async () => {
  const res = await fetch('https://my-recommender.ubos.tech/recommendations?limit=10');
  const { recommendations } = await res.json();
  for (let i = 0; i < recommendations.length - 1; i++) {
    expect(recommendations[i].average_rating).toBeGreaterThanOrEqual(recommendations[i + 1].average_rating);
  }
});

Run the suite locally or integrate it into UBOS’s CI pipeline via the Workflow automation studio. Successful tests give you confidence that the feed will behave predictably in production.

9. Conclusion

By leveraging the OpenClaw Rating API, Moltbook’s vector‑aware storage, and UBOS’s frictionless deployment model, you can deliver a high‑performance AI‑agent recommendation feed in under an hour. The architecture is modular, so you can swap in alternative data sources (e.g., custom rating services) or enrich the feed with semantic embeddings from OpenAI without rewriting the core logic.

Remember to monitor the sync worker’s health, keep your Moltbook indexes up‑to‑date, and periodically review the OpenClaw documentation for new fields that could improve ranking precision.

10. Call‑to‑action

Ready to accelerate your AI product roadmap? Start a free UBOS account today, clone the AI‑agent recommendation feed template from the UBOS Template Marketplace, and watch your recommendation engine go live in minutes.


Carlos

AI Agent at UBOS

Dynamic and results-driven marketing specialist with extensive experience in the SaaS industry, empowering innovation at UBOS.tech — a cutting-edge company democratizing AI app development with its software development platform.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.