- Updated: March 21, 2026
- 3 min read
Adding User Personalization to the OpenClaw Full‑Stack Template
Adding User Personalization to the OpenClaw Full‑Stack Template
In this tutorial we walk developers through adding a personalization layer—user profiles, preferences, and context‑aware responses—to the one‑click‑deployable OpenClaw template. By the end you will have a running OpenClaw instance that can store user data and tailor responses based on that data.
Why Personalization?
- Improves user engagement
- Enables context‑aware AI responses
- Provides a foundation for future features (recommendations, A/B testing, etc.)
Prerequisites
- UBOS server with OpenClaw already deployed (see Host OpenClaw guide)
- Basic knowledge of Node‑RED and JavaScript
- Access to the OpenClaw admin UI
Step 1 – Add a User Profile Store
OpenClaw ships with a built‑in SQLite DB. We will add a new table user_profiles to store preferences.
CREATE TABLE IF NOT EXISTS user_profiles (
user_id TEXT PRIMARY KEY,
name TEXT,
email TEXT,
preferences JSON,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);Run this SQL via the OpenClaw admin → Database console.
Step 2 – Create API Endpoints
Use Node‑RED to expose two HTTP endpoints:
GET /api/profile/:userId– fetch a profilePOST /api/profile/:userId– update/create a profile
Example Node‑RED function for the GET endpoint:
msg.payload = await db.get('SELECT * FROM user_profiles WHERE user_id = ?', [msg.req.params.userId]);
return msg;Step 3 – Hook Into the Chat Flow
Before sending a user message to the LLM, retrieve the profile and inject preferences into the prompt.
let profile = await getUserProfile(msg.userId);
let preferences = profile ? JSON.parse(profile.preferences) : {};
msg.prompt = `You are a helpful assistant. The user prefers ${preferences.language || 'English'} responses. ${msg.originalPrompt}`;
return msg;Step 4 – Store Updated Preferences
After a conversation, you may let the user update their settings via a simple UI. When the UI sends a POST request, update the DB:
await db.run('INSERT OR REPLACE INTO user_profiles (user_id, name, email, preferences) VALUES (?, ?, ?, ?)', [msg.userId, msg.payload.name, msg.payload.email, JSON.stringify(msg.payload.preferences)]);
msg.payload = {status: 'saved'};
return msg;Step 5 – Deploy
- Commit the new Node‑RED flows (export → import) to the OpenClaw repository.
- Push changes to your GitHub fork.
- From the UBOS dashboard, click Redeploy OpenClaw. The one‑click deployment will pull the updated repo and restart the services.
Conclusion
You now have a personalized OpenClaw instance that remembers user profiles and adapts its responses. This foundation can be extended with recommendation engines, analytics, or multi‑language support.
For the full deployment guide, see the OpenClaw hosting article.