sql-memory

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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "sql-memory" with this command: npx skills add oblio-falootin/sql-memory

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

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):

TablePurpose
memory.MemoriesLong-term curated memories with importance scoring
memory.TaskQueueTask queue for agent work items
memory.ActivityLogEvent/activity logging for audit trail
memory.KnowledgeIndexDomain-specific knowledge store
memory.SessionsSession 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

LevelMeaningExample
1-2Ephemeral, archiveOld workspace file
3-4Context, nice-to-knowDebug notes
5-6Standard operationalTask completion
7-8Important milestoneArchitecture decision
9CriticalSystem design choice
10PermanentCore identity/values

API Reference

Memory Operations

MethodDescriptionExample
remember(cat, key, content, importance, tags)Store a memorymem.remember('facts', 'name', 'Oblio', 7)
recall(cat, key)Retrieve a memorymem.recall('facts', 'name')
search_memories(query, limit)Semantic searchmem.search_memories('timezone', limit=5)
forget(cat, key)Delete a memorymem.forget('facts', 'name')

Task Queue

MethodDescription
queue_task(agent, type, payload, priority)Add a task
claim_task(id)Mark task as processing
complete_task(id, result)Mark task as completed
fail_task(id, error, retries, max)Fail with retry logic

Activity Logging

MethodDescription
log_event(type, agent, detail, extra)Log an activity
get_recent_activity(hours, agent)Query recent events

Configuration

Uses the same environment variables as sql-connector:

SQL_CLOUD_SERVER=sql5112.site4now.net
SQL_CLOUD_DATABASE=db_99ba1f_memory4oblio
SQL_CLOUD_USER=...
SQL_CLOUD_PASSWORD=...

SQL_LOCAL_SERVER=10.0.0.110
SQL_LOCAL_DATABASE=Oblio_Memories
SQL_LOCAL_USER=sa
SQL_LOCAL_PASSWORD=...

Architecture

┌──────────────────┐
│   Agents         │ ← OblioAgent subclasses
├──────────────────┤
│   SQLMemory      │ ← Semantic operations (remember/recall/queue/log)
├──────────────────┤
│   SQLConnector   │ ← Generic SQL execution (retry, parameterized, logging)
├──────────────────┤
│   pymssql (TDS)  │ ← Native SQL Server driver
└──────────────────┘

License

MIT

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Crabwalk

Real-time companion monitor for OpenClaw agents

Registry SourceRecently Updated
2.7K4luccast
Automation

Crabwalk

Real-time companion monitor for OpenClaw agents

Registry SourceRecently Updated
1.9K2luccast
Automation

Homeassistant N8n Agent

Bridge OpenClaw with your n8n instance for Home Assistant automation.

Registry SourceRecently Updated
Automation

Moltext

Compile legacy documentation on internet into agent-native memory context using the Moltext.

Registry SourceRecently Updated