Skip to main content

RAG API Documentation

The KloudBean RAG (Retrieval-Augmented Generation) API provides AI-powered question-answering capabilities based on your documentation. Use this API to integrate intelligent search and assistance features into your applications.

Base URL

https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-chat

Note: For searching articles, use rag-api endpoint. For AI-generated conversational answers, use rag-chat endpoint.

Authentication

This is a public API and does not require authentication. All endpoints are accessible without API keys.

Endpoints

Get AI-Generated Answer (Chat)

Get conversational AI-generated answers based on your question. This endpoint uses Claude to generate comprehensive answers from relevant articles.

GET ?q=query

curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-chat?q=How+do+I+deploy+Django"

Query Parameters

ParameterTypeRequiredDescription
qstringYesYour question or query

Response

{
"success": true,
"answer": "Deploying a production-grade Django application on Kloudbean is a straightforward process...",
"sources": [
{
"title": "Deploy and Run Django Application using Kloudbean.",
"url": "https://help.kloudbean.com/article/deploy-and-run-django-application-using-kloudbean",
"category": "Installing and Deploying Application",
"relevance": "high"
},
{
"title": "Django Deployment",
"url": "https://help.kloudbean.com/article/deploying-django",
"category": "Application Deployment",
"relevance": "high"
}
],
"metadata": {
"question": "How do I deploy Django",
"keywordsUsed": ["deploy", "django"],
"articlesSearched": 148,
"articlesUsed": 8,
"responseTimeMs": 8320
},
"rateLimit": {
"limit": 30,
"remaining": 29,
"window": "1 minute"
}
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful
answerstringThe AI-generated conversational answer in markdown format
sourcesarrayArray of source articles used to generate the answer
sources[].titlestringTitle of the source article
sources[].urlstringURL to the source article
sources[].categorystringCategory of the source article
sources[].relevancestringRelevance level (e.g., "high", "medium", "low")
metadataobjectAdditional metadata about the query processing
rateLimitobjectRate limit information (limit, remaining, window)

Search Articles

Search articles by keyword across titles, descriptions, and content. Returns raw article data.

GET ?action=search

curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=search&q=laravel&limit=5"

Query Parameters

ParameterTypeRequiredDescription
actionstringYesMust be "search"
q or querystringYesSearch keywords
limitintegerNoMax results to return. Default: 50, Max: 100

Response

{
"success": true,
"count": 5,
"data": [
{
"id": "abc123",
"title": "Laravel Deployment",
"slug": "application-deployment/deploying-laravel",
"url": "https://kb.kloudbean.com/article/deploying-laravel",
"category": "Application Deployment",
"description": "Complete guide to deploying Laravel applications...",
"content": "..."
}
],
"usage": {...}
}

Get All Articles

Retrieve all published articles from the knowledge base.

GET ?action=all

curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=all&limit=50"

Query Parameters

ParameterTypeRequiredDescription
actionstringYesMust be "all"
limitintegerNoMax articles to return. Default: 50, Max: 100
formatstringNoResponse format: "json" or "text"

Get Single Article

Retrieve a specific article by its slug.

GET ?action=article

curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=article&slug=getting-started"

Query Parameters

ParameterTypeRequiredDescription
actionstringYesMust be "article"
slugstringYesArticle URL slug

List Categories

Get all available categories in the knowledge base.

GET ?action=categories

curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=categories"

Error Responses

All errors follow this format:

{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {}
}
}

Error Codes

CodeHTTP StatusDescription
INVALID_REQUEST400Invalid request parameters or missing required fields
NOT_FOUND404Article or resource not found
RATE_LIMIT_EXCEEDED429Too many requests. Please try again later.
INTERNAL_ERROR500Internal server error. Please contact support.

Rate Limits

This is a public API with reasonable rate limits to ensure fair usage for all users. Please use the API responsibly and avoid excessive requests.

Examples

JavaScript/Node.js

// Search articles
const query = 'laravel deployment';
const response = await fetch(
`https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=search&q=${encodeURIComponent(query)}&limit=5`
);

const articles = await response.json();
console.log('Found articles:', articles);

// Get all articles
const allResponse = await fetch(
'https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=all&limit=50'
);
const allArticles = await allResponse.json();

Python

import requests
from urllib.parse import quote

# Get AI-generated answer
base_url = 'https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-chat'
query = 'How do I deploy Django?'
url = f'{base_url}?q={quote(query)}'

response = requests.get(url)
data = response.json()

if data.get('success'):
print('Answer:', data['answer'])
print('Sources:', data['sources'])
print('Rate limit remaining:', data['rateLimit']['remaining'])

# Search articles (raw data)
search_url = 'https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api'
search_response = requests.get(f'{search_url}?action=search&q={quote(query)}&limit=5')
search_data = search_response.json()
print(f'Found {search_data.get("count", 0)} articles')

PHP

<?php
// Get AI-generated answer
$baseUrl = 'https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-chat';
$query = urlencode('How do I deploy Django?');
$url = "$baseUrl?q=$query";

$response = file_get_contents($url);
$data = json_decode($response, true);

if ($data['success']) {
echo "Answer: " . $data['answer'] . "
";
echo "Sources: " . count($data['sources']) . " articles
";
echo "Rate limit remaining: " . $data['rateLimit']['remaining'] . "
";
}

// Search articles (raw data)
$searchUrl = 'https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api';
$searchResponse = file_get_contents("$searchUrl?action=search&q=$query&limit=5");
$searchData = json_decode($searchResponse, true);
echo "Found " . $searchData['count'] . " articles
";
?>

Quick Start

This is a public API - no authentication required! Get started with a simple API call:

# Get AI-generated answer (recommended)
curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-chat?q=How+do+I+deploy+Django"

# Search for articles (raw data)
curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=search&q=kubernetes"

# Get all articles
curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=all"

# Get a specific article
curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=article&slug=getting-started"

# List categories
curl "https://vhbbmovxfuuqzfywysba.supabase.co/functions/v1/rag-api?action=categories"

Need Help?

If you have questions about the RAG API or need assistance with integration, please contact our support team at [email protected].