Ragleaf Platform Guide
Ragleaf allows you to build custom smart AI assistants for your business and embed them without coding. In this guide, we will walk you through how to use the dashboard, train your agent, and activate booking or payment features.
Create a free account with your email address to access the workspace. Enter the 6-digit confirmation code sent to your email to verify and activate your dashboard in seconds.
2. Pre-Built Industry Templates
Instead of designing an assistant from scratch, you can deploy a pre-configured template customized for your sector. These templates arrive fully loaded with optimized prompts, forms, and service flows.
Hair Salon template: Appointment scheduler, service pricing, working hours inquiries, and in-chat deposit payments activated.
3. Assistant Persona & System Prompt
Configure your assistant's name, visual avatar, and system instructions (system prompt) in the editor. The system prompt controls how the assistant behaves, what rules it obeys, and how it talks to clients.
4. Knowledge Base & Document Upload
Upload business data like service menus, pricing sheets, or custom PDFs here. Ragleaf automatically fragments documents (chunking), generates embeddings, and indexes them into the vector database.
5. Appointments & Booking Settings
Configure available calendar slots, working hours, service durations, and seat capacities in the bookings panel. The AI assistant references this live database to coordinate, recommend, and book reservations.
6. Secure In-Chat Payment Collection
Collect deposits or full payments directly inside the chat window. Integrate Stripe or Iyzico credentials in the billing panel to authorize and process secure credit card payments.
7. Widget Theme Customization
Match the chatbot widget with your corporate branding in the themes panel. Change primary brand colors, switch between dark and light themes, configure layouts, and customize the greeting message.
8. Dashboard Analytics & Reports
Track real-time conversation volumes, booking conversion rates, top FAQs, billing details, and accumulated Ragleaf loyalty points in the analytics dashboard.
Quick Start
Integrating Ragleaf AI assistant to your website takes only a few minutes. Follow the steps below to start.
1. Add the Script Tag
Insert this snippet right before the closing </body> tag of your HTML pages:
src="https://cdn.ragleaf.com/widget.js"
data-agent-id="ag_your_agent_id"
data-api-key="rk_live_your_key"
></script>
Authentication
All REST API queries require a Bearer token inside the Authorization header. You can generate API credentials in the API Tokens page of your dashboard.
Widget Installation
Ragleaf chat widget runs isolated within the Shadow DOM to protect your page styling. Insert the script into any HTML index file to load the assistant.
Widget Configuration Options
Configure parameters and metadata using HTML data attributes.
| Parameter | Type | Default | Description |
|---|---|---|---|
| data-agent-id | string | required | Unique ID of the agent |
| data-api-key | string | required | Widget API credentials key |
| data-theme | string | light | light or dark |
| data-position | string | bottom-right | bottom-right, bottom-left |
| data-primary-color | string | #22c55e | Primary brand theme color (HEX) |
| data-language | string | auto | Default widget locale (tr, en, de, etc.) |
Theme Customization (CSS)
Override layout variables inside the shadow root using custom CSS custom properties.
ragleaf-widget {
--rg-primary: #22c55e;
--rg-bg: #ffffff;
--rg-text: #1a1a1a;
--rg-border-radius: 16px;
--rg-font: 'Inter', sans-serif;
}
Shadow DOM Isolation
The chat element renders encapsulated inside a Shadow Root, protecting your website layout styles from being modified by the chat components and vice-versa.
Chat Completions API
OpenAI-compliant chat completion endpoint. Connect custom web/mobile apps to Ragleaf database backend with minimal refactoring.
-H "Authorization: Bearer rk_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{ "messages": [ {"role": "user", "content": "Hello, how do I sign up?"} ], "stream": false }'
Document Management API
Programmatically manage the knowledge base vector entries of your chatbot. Upload, query, and delete documents.
Ingest a new file (multipart/form-data).
Agent Management API
Create, customize, and deploy AI assistants.
Webhook Event Types
Receive automated event callbacks to a specified callback endpoint URL.
| Olay | Açıklama |
|---|---|
| conversation.started | When a conversation starts |
| appointment.created | When an appointment is booked |
| payment.completed | When an in-chat checkout finishes |
Webhook Security
function verifyWebhook(payload, signature, secret) {
const hash = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return hash === signature;
}
Platform Integrations
Copy-paste code blocks to integrate directly with WordPress or React:
WordPress (functions.php)
echo '<script src="https://cdn.ragleaf.com/widget.js"
data-agent-id="ag_xxxxx"
data-api-key="rk_live_xxxxx"></script>';
});
React Component
export default function RagleafWidget() {
useEffect(() => {
const script = document.createElement('script');
script.src = 'https://cdn.ragleaf.com/widget.js';
script.setAttribute('data-agent-id', 'ag_xxxxx');
script.setAttribute('data-api-key', 'rk_live_xxxxx');
document.body.appendChild(script);
return () => document.body.removeChild(script);
}, []);
return null;
}
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
| UNAUTHORIZED | 401 | Invalid API token credential |
| AGENT_NOT_FOUND | 404 | The specified Agent ID does not exist |
| LIMIT_EXCEEDED | 429 | Monthly search/query credits depleted |
Rate Limiting
Standard API endpoints limits are configured at a maximum of 120 requests per minute.
Changelog
Released live appointment schedules, table reservations, and secure in-chat credit card payment integration.
Initial release of core RAG indexing, custom knowledge ingestion systems, and embeddable widget.