Xpersona
S

SQL Memory

CLAWHUB · Unverified

Semantic memory layer for OpenClaw agents. Use when: (1) persisting agent memories with importance scoring, (2) hierarchical memory rollups (daily→weekly→mon...

62
Rank
84
Safety
1.2k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s178hc1brh9m5mmh3hnb27txnx83j824:sql-memory
  1. Install using `clawhub skill install s178hc1brh9m5mmh3hnb27txnx83j824:sql-memory` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/oblio-falootin/sql-memory before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-oblio-falootin-sql-memory/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

152,301 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: sql-memory
description: "Semantic memory layer for OpenClaw agents. Use when: (1) persisting agent memories with importance scoring, (2) hierarchical memory rollups (daily→weekly→monthly→yearly), (3) queuing tasks for agents, (4) logging activity and audit trails, (5) managing knowledge bases with semantic search. Provides remember/recall/search/queue_task/log_event APIs. Built on sql-connector for reliable parameterized SQL execution."
---

# SQL Memory Skill
> Semantic memory layer for OpenClaw agents

## Overview

Provides agent-friendly memory operations: remember, recall, search, forget, plus task queue management, knowledge indexing, activity logging, and hierarchical memory rollups. All operations go through the SQL Connector skill for reliable, parameterized SQL execution.

See `scripts/sql_memory.py` for full implementation.

## Dependencies

- **sql-connector** — provides the underlying database connection and query execution

## Quick Start

```python
from sql_memory import SQLMemory, get_memory

mem = get_memory('cloud')

# Remember something
mem.remember('facts', 'vex_timezone', 'VeX is in EST/EDT timezone', importance=7)

# Recall it
entry = mem.recall('facts', 'vex_timezone')

# Search across all memories
results = mem.search_memories('timezone')

# Queue a task
mem.queue_task('nlp_agent', 'analyze_document', '{"doc": "..."}', priority=3)

# Log an event
mem.log_event('training_complete', 'nlp_agent', 'Finished training cycle 42')

# Store knowledge
mem.store_knowledge('stamps', 'inverted_jenny', 'Rare 1918 misprint...', 'catalog')
```

## Schema

All tables live in the `memory` schema (SQL Server database):

| Table | Purpose |
|-------|---------|
| `memory.Memories` | Long-term curated memories with importance scoring |
| `memory.TaskQueue` | Task queue for agent work items |
| `memory.ActivityLog` | Event/activity logging for audit trail |
| `memory.KnowledgeIndex` | Domain-specific knowledge store |
| `memory.Sessions` | Session tracking for agents |

## Memory Rollups

Hierarchical consolidation keeps memories fresh and relevant:

```
Daily memories → Weekly rollup (Sundays 3AM)
Weekly rollups → Monthly rollup (1st of month)
Monthly → Quarterly (Jan/Apr/Jul/Oct)
Quarterly → Yearly (Jan 1st)
```

Each rollup:
1. Summarizes source entries
2. Creates a consolidated entry with back-references
3. Reduces importance of source entries
4. Tags sources as `rolled_up`

### Importance Scale

| Level | Meaning | Example |
|-------|---------|---------|
| 1-2 | Ephemeral, archive | Old workspace file |
| 3-4 | Context, nice-to-know | Debug notes |
| 5-6 | Standard operational | Task completion |
| 7-8 | Important milestone | Architecture decision |
| 9 | Critical | System design choice |
| 10 | Permanent | Core identity/values |

## API Reference

### Memory Operations

| Method | Description | Example |
|--------|-------------|---------|
| `remember(cat, key, content, importance, tags)` | Store a memory | `mem.remember('facts', '

sql-memory/SKILL.md

---
name: sql-memory
version: 2.1.0-alpha
status: alpha
description: "Semantic memory layer for OpenClaw agents. Use when: (1) persisting agent memories with importance scoring, (2) hierarchical memory rollups (daily→weekly→monthly→yearly), (3) queuing tasks for agents, (4) logging activity and audit trails, (5) managing knowledge bases with semantic search. Provides remember/recall/search/queue_task/log_event/add_todo APIs. Built on sql-connector. Requires SQL Server schema setup — see README. ALPHA: use at your own risk, API may change."
---

# SQL Memory Skill
> Semantic memory layer for OpenClaw agents

## Overview

Provides agent-friendly memory operations: remember, recall, search, forget, plus task queue management, knowledge indexing, activity logging, and hierarchical memory rollups. All operations go through the SQL Connector skill for reliable, parameterized SQL execution.

See `sql_memory.py` for full implementation.

## Dependencies

- **sql-connector** — provides the underlying database connection and query execution

## Quick Start

```python
from sql_memory import SQLMemory, get_memory

mem = get_memory('cloud')

# Remember something
mem.remember('facts', 'vex_timezone', 'VeX is in EST/EDT timezone', importance=7)

# Recall it
entry = mem.recall('facts', 'vex_timezone')

# Search across all memories
results = mem.search_memories('timezone')

# Queue a task
mem.queue_task('nlp_agent', 'analyze_document', '{"doc": "..."}', priority=3)

# Log an event
mem.log_event('training_complete', 'nlp_agent', 'Finished training cycle 42')

# Store knowledge
mem.store_knowledge('stamps', 'inverted_jenny', 'Rare 1918 misprint...', 'catalog')
```

## Schema

All tables live in the `memory` schema (SQL Server database):

| Table | Purpose |
|-------|---------|
| `memory.Memories` | Long-term curated memories with importance scoring |
| `memory.TaskQueue` | Task queue for agent work items |
| `memory.ActivityLog` | Event/activity logging for audit trail |
| `memory.KnowledgeIndex` | Domain-specific knowledge store |
| `memory.Sessions` | Session tracking for agents |

## Memory Rollups

Hierarchical consolidation keeps memories fresh and relevant:

```
Daily memories → Weekly rollup (Sundays 3AM)
Weekly rollups → Monthly rollup (1st of month)
Monthly → Quarterly (Jan/Apr/Jul/Oct)
Quarterly → Yearly (Jan 1st)
```

Each rollup:
1. Summarizes source entries
2. Creates a consolidated entry with back-references
3. Reduces importance of source entries
4. Tags sources as `rolled_up`

### Importance Scale

| Level | Meaning | Example |
|-------|---------|---------|
| 1-2 | Ephemeral, archive | Old workspace file |
| 3-4 | Context, nice-to-know | Debug notes |
| 5-6 | Standard operational | Task completion |
| 7-8 | Important milestone | Architecture decision |
| 9 | Critical | System design choice |
| 10 | Permanent | Core identity/values |

## API Reference

### Memory Operations

| Method | Description | Example |
|--------|-------------|---------|
| `rem

README.md

# clawbot-sql-memory

> ⚠️ **ALPHA — Use at your own risk.** Functional and in active use, but API may change. We'll lock the API after 30 days of community feedback. Open issues freely — this improves with use.

SQL Server-based persistent memory for OpenClaw agents. Provides semantic memory, task queuing, activity logging, todo management, and hierarchical rollups (daily → weekly → monthly → yearly).

---

## ⚠️ DEPENDENCY PRIORITY

**This skill requires `sql-connector` to be installed first.**

```
sql-connector  ←  Install this FIRST
      ↓
sql-memory     ←  You are here
      ↓
sql-dreamer    ←  Install this LAST (optional — uses memories for dream analysis)
```

```bash
# Always install in this order:
clawhub install sql-connector   # transport layer — required
clawhub install sql-memory      # this skill
clawhub install sql-dreamer     # optional — dream/analysis layer
```

If `sql-connector` is not installed, this skill will fail at import with:
`ImportError: sql_connector.py not found. Install the sql-connector skill first.`

---

## Requirements

- SQL Server 2019+ (or Azure SQL, site4now, etc.)
- [clawbot-sql-connector](https://github.com/High-Falootin/clawbot-sql-connector) — install first
- `pymssql` and `python-dotenv`

## Step 1: Create the Schema

Before installing this skill, create the required tables in your SQL Server database. You can do this one of two ways:

### Option A — Run the setup script (recommended)

```bash
python3 setup_schema.py
```

This will connect using your `.env` credentials and create all tables automatically. Run it once before first use.

### Option B — Manual SQL (paste into SSMS, Azure Data Studio, or sqlcmd)

```sql
-- Run against your target database
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)

_meta.json

{
  "ownerId": "kn73kshndq5w6jhda1m0j558g181t6yy",
  "slug": "sql-memory",
  "version": "2.2.0",
  "publishedAt": 1777398480177
}

GETTING_STARTED.md

# GETTING STARTED: SQL Memory

**For:** OpenClaw agents that need persistent, semantically-meaningful memory  
**Time Required:** 15 minutes setup + 5 minutes validation  
**Prerequisites:** OpenClaw installed, SQL Server (cloud or local), sql-connector installed

---

## ⚠️ Install sql-connector First

SQL Memory **requires** the SQL Connector skill as its transport layer. If you skip this, nothing works.

```bash
clawhub install sql-connector   # ← MUST DO THIS FIRST
clawhub install sql-memory
```

If you haven't set up sql-connector yet, start here:  
**[clawbot-sql-connector GETTING_STARTED.md](https://github.com/VeXHarbinger/clawbot-sql-connector/blob/main/GETTING_STARTED.md)**

---

## Overview: Where SQL Memory Fits

```
┌──────────────────────────────────────────────────────────────────┐
│                                                                  │
│   Your OpenClaw Agents                                           │
│   ↓                                                              │
│   ┌───────────────────────────────────────────────────────────┐  │
│   │  SQL Memory  ← YOU ARE HERE                               │  │
│   │  ├─ remember() / recall() / search_memories()            │  │
│   │  ├─ queue_task() / claim_task() / complete_task()        │  │
│   │  ├─ log_event() / get_recent_activity()                  │  │
│   │  ├─ store_knowledge() / search_knowledge()               │  │
│   │  ├─ add_todo() / complete_todo()                         │  │
│   │  └─ Daily → Weekly → Monthly → Yearly rollups            │  │
│   └───────────────────────────────────────────────────────────┘  │
│   ↓                                                              │
│   ┌───────────────────────────────────────────────────────────┐  │
│   │  SQL Connector  (installed in Step 0 above)               │  │
│   │  └─ Handles credentials, retries, parameterized SQL      │  │
│   └───────────────────────────────────────────────────────────┘  │
│   ↓                                                              │
│   SQL Server (Cloud or Local)                                    │
│   └─ memory.Memories, TaskQueue, ActivityLog, Sessions,          │
│      KnowledgeIndex, Todos                                       │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘
                          ↓ (optional, next tier)
              SQL Dreamer — interprets memories into synthesis
```

**The story:**
- **SQL Connector** moves data reliably (transport layer)
- **SQL Memory** stores meaning and context (semantic layer) ← this skill
- **SQL Dreamer** interprets memories into insight (synthesis layer)

---

## Step 1: Verify sql-connector Is Working

Before installing sql-memory, confirm your foundation is solid:

```bash
python3 -c "from sql_connector import get_connector; print('✅ OK' if get_connector().ping() else '❌ FAILED')"
```

If this fails, fix sql-connector first. C

Sponsored

Ads related to SQL Memory and adjacent AI workflows.