For: Users who want to use all three skills in a standalone OpenClaw installation
Time Required: 15 minutes setup + 5 minutes configuration
Prerequisites: OpenClaw installed, SQL Server (cloud or local), basic CLI knowledge
┌─────────────────────────────────────────────────────────────────┐
│ │
│ Your OpenClaw agents │
│ ↓ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ SQL Memory (clawbot-sql-memory) │ │
│ │ ├─ Stores: facts, decisions, incidents, lessons learned │ │
│ │ ├─ Table: memory.Memories │ │
│ │ └─ Uses: SQL Connector to read/write │ │
│ └──────────────────────────────────────────────────────────┘ │
│ ↓ (daily at 3:00 AM) │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ SQL Dreamer (openclaw-sql-dreamer) │ │
│ │ ├─ Reads: high-importance memories from SQL Memory │ │
│ │ ├─ Runs: OpenClaw's native dreaming pipeline │ │
│ │ ├─ Stores: dream results back to SQL │ │
│ │ └─ Uses: SQL Connector for all I/O │ │
│ └──────────────────────────────────────────────────────────┘ │
│ ↓ (optional: publish to Confluence) │
│ Confluence (Dream reports) │
│ │
└─────────────────────────────────────────────────────────────────┘
Foundation: SQL Connector (clawbot-sql-connector)
├─ Handles: All database communication
├─ Supports: Cloud (Azure, site4now) or local SQL Server
└─ Used by: SQL Memory and SQL Dreamer
Key insight: SQL Connector is the foundation. SQL Memory uses it. SQL Dreamer depends on both.
The foundation — handles all database connections for the other two skills.
# Install via ClawHub
clawhub install sql-connector
# Or manually
pip install clawbot-sql-connector pymssql python-dotenvIn your OpenClaw workspace root, create a .env file:
cd ~/.openclaw/workspace
# Or wherever your OpenClaw workspace is
cp .env.example .envEdit .env and add SQL Server credentials:
If using Cloud SQL Server (Azure, site4now, etc.):
SQL_CLOUD_SERVER=your-server.database.windows.net
SQL_CLOUD_DATABASE=your_database_name
SQL_CLOUD_USER=your_username
SQL_CLOUD_PASSWORD=your_password
SQL_DEFAULT_BACKEND=cloudIf using Local SQL Server (on-prem):
SQL_LOCAL_SERVER=10.0.0.110
SQL_LOCAL_DATABASE=your_database_name
SQL_LOCAL_USER=your_username
SQL_LOCAL_PASSWORD=your_password
SQL_DEFAULT_BACKEND=localpython3 << 'PYTHON'
from sql_connector import get_connector
db = get_connector()
if db.ping():
print("✅ Connected to SQL Server")
else:
print("❌ Connection failed")
PYTHONPersistent memory for your agents. Stores everything they learn.
clawhub install sql-memorySQL Memory needs tables in your SQL Server. Create them once:
Option A (Automatic — Recommended):
# Find where sql-memory installed
pip show clawbot-sql-memory | grep Location
# Output example: Location: /home/username/.venv/lib/python3.10/site-packages/clawbot_sql_memory
# Go there and run setup
cd /path/from/above/clawbot_sql_memory
python3 setup_schema.pyOption B (Manual — If Option A fails):
Open your SQL Server (SSMS, Azure Data Studio, or sqlcmd) and run:
CREATE SCHEMA memory;
GO
CREATE TABLE memory.Memories (
id UNIQUEIDENTIFIER PRIMARY KEY DEFAULT newid(),
category NVARCHAR(100) NOT NULL,
key NVARCHAR(255) NOT NULL,
content NVARCHAR(MAX) NOT NULL,
importance INT DEFAULT 3,
tags NVARCHAR(500) DEFAULT '',
status NVARCHAR(50) DEFAULT 'active',
created_at DATETIME2 DEFAULT GETUTCDATE(),
updated_at DATETIME2 DEFAULT GETUTCDATE()
);
CREATE TABLE memory.TaskQueue (
id UNIQUEIDENTIFIER PRIMARY KEY DEFAULT newid(),
agent NVARCHAR(100) NOT NULL,
task_type NVARCHAR(100) NOT NULL,
payload NVARCHAR(MAX) DEFAULT '',
priority INT DEFAULT 5,
status NVARCHAR(50) DEFAULT 'pending',
retries INT DEFAULT 0,
model_hint NVARCHAR(100) DEFAULT '',
created_at DATETIME2 DEFAULT GETUTCDATE(),
updated_at DATETIME2 DEFAULT GETUTCDATE(),
claimed_at DATETIME2 NULL,
completed_at DATETIME2 NULL,
error NVARCHAR(MAX) DEFAULT ''
);
CREATE TABLE memory.ActivityLog (
id UNIQUEIDENTIFIER PRIMARY KEY DEFAULT newid(),
event_type NVARCHAR(100) NOT NULL,
agent NVARCHAR(100) DEFAULT '',
description NVARCHAR(MAX) DEFAULT '',
metadata NVARCHAR(MAX) DEFAULT '',
created_at DATETIME2 DEFAULT GETUTCDATE()
);python3 << 'PYTHON'
from sql_memory import SQLMemory
mem = SQLMemory('cloud') # or 'local' if using local server
mem.remember(
category='facts',
key='test_memory',
content='This is a test memory',
importance=5
)
result = mem.recall(category='facts', key='test_memory')
if result:
print("✅ SQL Memory working")
else:
print("❌ Could not retrieve memory")
PYTHONAutomated dreaming powered by SQL-backed memories.
clawhub install sql-dreamerSQL Dreamer needs its own tables. Create them once:
# Find where sql-dreamer installed
pip show openclaw-sql-dreamer | grep Location
# Output example: Location: /home/username/.venv/lib/python3.10/site-packages/openclaw_sql_dreamer
cd /path/from/above/openclaw_sql_dreamer
python3 sql/migrate.pyCreate configuration file:
cd ~/.openclaw/workspace
mkdir -p config
cp /path/to/sql_dreamer/config/example.yml config/sql_dreamer.ymlEdit config/sql_dreamer.yml:
sql:
# Use same credentials as .env file
backend: "cloud" # or "local"
# sql_connector will read from .env automatically
corpus:
importance_threshold: 7 # Only remember items score ≥ 7 (1-10 scale)
lookback_days: 2 # Look back 2 days for memories
dreaming:
workspace_dir: "/home/username/.openclaw/workspace" # YOUR WORKSPACE PATH
phases:
light:
enabled: true
rem:
enabled: true
deep:
enabled: true
archive_after_days: 7 # Delete dream files after 7 days
confluence:
enabled: false # Set to true to publish dreams to Confluence
# (See section below for Confluence setup)# Find your OpenClaw workspace
which openclaw
# Output: /usr/local/bin/openclaw (or similar)
openclaw status
# Output will show: repo=/home/username/.openclaw/workspace
# Use that path in the config abovepython3 << 'PYTHON'
from sql_connector import get_connector
db = get_connector()
tables = db.query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='dreams'")
if tables:
print("✅ Dream tables created")
for row in tables:
print(f" - {row['TABLE_NAME']}")
else:
print("❌ Dream tables not found")
PYTHONAdd these lines to your crontab to run dreams automatically:
crontab -ePaste these lines (adjust times to your preference):
# Pre-dream: Curate memories from SQL (3:00 AM)
0 3 * * * /usr/bin/python3 ~/.openclaw/workspace/scripts/pre_dream_sql_feed.py >> ~/.openclaw/logs/pre_dream.log 2>&1
# Post-dream: Archive dream outputs (4:00 AM, 1 hour after native dreamer)
0 4 * * * /usr/bin/python3 ~/.openclaw/workspace/scripts/post_dream_archiver.py >> ~/.openclaw/logs/post_dream.log 2>&1
# (Optional) Confluence publisher: Publish dreams to Confluence (4:30 AM)
# 30 4 * * * /usr/bin/python3 ~/.openclaw/workspace/scripts/confluence_dream_publisher.py >> ~/.openclaw/logs/confluence.log 2>&1which python3
# Output: /usr/bin/python3 (use this in crontab)After installing via ClawHub, scripts are installed to:
pip show openclaw-sql-dreamer | grep Location
# Location: /home/username/.venv/lib/python3.10/site-packages/openclaw_sql_dreamer
# Scripts are in: /path/from/above/scripts/python3 << 'PYTHON'
from sql_connector import get_connector
db = get_connector()
print("✅ SQL Connector OK" if db.ping() else "❌ SQL Connector FAILED")
PYTHONpython3 << 'PYTHON'
from sql_memory import SQLMemory
mem = SQLMemory('cloud')
mem.remember(category='test', key='verify', content='Works!', importance=7)
result = mem.recall(category='test', key='verify')
print("✅ SQL Memory OK" if result else "❌ SQL Memory FAILED")
PYTHONpython3 << 'PYTHON'
from sql_connector import get_connector
db = get_connector()
tables = db.query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA IN ('memory', 'dreams')")
print(f"✅ Found {len(tables)} tables:" if tables else "❌ No tables found")
for row in tables:
print(f" - {row['TABLE_NAME']}")
PYTHONAfter setup, here's what to expect:
Day 1:
- You have empty SQL Memory (no memories yet)
- First dream cycle runs but finds nothing to dream about
- Dream output files are created but mostly empty
- ✅ This is normal
Days 2-7:
- Your agents store memories in SQL Memory
- Each night, dreams include those memories
- Dream quality improves as memory grows
- ✅ This is expected
After 1 week:
- Dreams should show patterns (themes, lasting truths)
- First synthetic memories promoted to long-term storage
- System is working as designed
- ✅ This is success
Check:
- SQL Server is running and accessible
.envcredentials are correct- Firewall allows connection on port 1433 (SQL Server default)
- Network can reach the server
# Test connection manually
python3 -c "from sql_connector import get_connector; get_connector().ping()" && echo "OK" || echo "FAILED"Check:
- Did you run
setup_schema.pyfor SQL Memory? - Did you run
python3 sql/migrate.pyfor SQL Dreamer? - Do the tables exist in your SQL Server?
# List all tables
python3 << 'PYTHON'
from sql_connector import get_connector
db = get_connector()
tables = db.query("SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ORDER BY TABLE_SCHEMA, TABLE_NAME")
for row in tables:
print(f"{row['TABLE_SCHEMA']}.{row['TABLE_NAME']}")
PYTHONCheck:
- Find the actual script path:
pip show openclaw-sql-dreamer | grep Location - Update crontab with full path:
/full/path/to/scripts/pre_dream_sql_feed.py
Expected if:
- First run (no memories in SQL Memory yet)
- Memory importance is too high (raise threshold in config)
Check:
- Do you have memories in SQL Memory? Query:
SELECT COUNT(*) FROM memory.Memories - Are their importance scores ≥ 7? Check
importancecolumn - Lower threshold in
sql_dreamer.yml:importance_threshold: 5
Check log files:
tail -50 ~/.openclaw/logs/pre_dream.log
tail -50 ~/.openclaw/logs/post_dream.log-
Read individual skill READMEs for advanced configuration
- clawbot-sql-connector: Advanced retry logic, multi-tenant setup
- clawbot-sql-memory: Semantic search, rollups, activity logging
- openclaw-sql-dreamer: Confluence publishing, custom synthesizers
-
Integrate with your agents — use SQL Memory to store agent findings
from sql_memory import SQLMemory mem = SQLMemory('cloud') mem.remember(category='findings', key='research_123', content='...', importance=8)
-
Set up Confluence publishing (optional) — share dreams with team
- See openclaw-sql-dreamer README → Confluence Integration
- SQL Connector Issues: https://github.com/VeXHarbinger/clawbot-sql-connector/issues
- SQL Memory Issues: https://github.com/VeXHarbinger/clawbot-sql-memory/issues
- SQL Dreamer Issues: https://github.com/High-Falootin/openclaw-sql-dreamer/issues
Last updated: 2026-04-28
Version: 1.0 (stable for production use)