[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76WMZCD0N86FWV2TTK9M95C":3,"skill-same:01M76WMZCD0N86FWV2TTK9M95C":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M76WMZCD0N86FWV2TTK9M95C","lite-sqlite",null,"Fast lightweight local SQLite database for OpenClaw agents with minimal RAM and storage usage. Use when creating or managing SQLite databases for storing agent data efficiently. Ideal for local data persistence quick agent data storage low-memory databases small-scale applications and agent memo and caching storage.","javimosch\u002Fopen-claw-skills","javimosch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12900508?v=4","01M6D3F2AS6PV75ET9PZ1QGP8J","Javier Leandro Arancibia","01M75B8NCTAJG9WH5YNZH7C3D8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fomprasad122007-rgb\u002Flite-sqlite\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: lite-sqlite\ndescription: Fast lightweight local SQLite database for OpenClaw agents with minimal RAM and storage usage. Use when creating or managing SQLite databases for storing agent data efficiently. Ideal for local data persistence quick agent data storage low-memory databases small-scale applications and agent memo and caching storage.\n---\n\n# Lite SQLite - Lightweight Local Database\n\nUltra-lightweight SQLite database management optimized for OpenClaw agents with minimal RAM (~2-5MB) and storage overhead.\n\n## Why SQLite?\n\n✅ **Zero setup** - No server, no configuration, file-based\n✅ **Minimal RAM** - 2-5MB typical usage\n✅ **Fast** - Millions of queries\u002Fsecond\n✅ **Portable** - Single .db file\n✅ **Reliable** - ACID compliant, crash-proof\n✅ **Cross-platform** - Works everywhere Python works\n\n## Core Features\n\n- In-memory mode for temporary data (even faster!)\n- WAL mode for concurrent access\n- Connection pooling\n- Automatic schema migration\n- Built-in backup\u002Frestore\n- Query optimization hints\n\n## Quick Start\n\n### Basic Database Operations\n\n```python\nfrom sqlite_connector import SQLiteDB\n\n# Create database (auto-wal mode enabled)\ndb = SQLiteDB(\"agent_data.db\")\n\n# Create table\ndb.create_table(\"memos\", {\n    \"id\": \"INTEGER PRIMARY KEY AUTOINCREMENT\",\n    \"title\": \"TEXT NOT NULL\",\n    \"content\": \"TEXT\",\n    \"created_at\": \"TEXT DEFAULT CURRENT_TIMESTAMP\",\n    \"tags\": \"TEXT\"\n})\n\n# Insert data\ndb.insert(\"memos\", [title=\"First memo\", content=\"Hello world\", tags=\"test\"])\n\n# Query data\nresults = db.query(\"SELECT * FROM memos WHERE tags = ?\", (\"test\",))\n\n# Update data\ndb.update(\"memos\", \"id = ?\", [content=\"Updated content\"], (1,))\n\n# Delete data\ndb.delete(\"memos\", \"id = ?\", (1,))\n\n# Close connection\ndb.close()\n```\n\n### In-Memory Database (Fastest)\n\n```python\n# Fastest mode - RAM only, no disk I\u002FO\ndb = SQLiteDB(\":memory:\")\n\n# Perfect for temporary operations\ndb.create_table(\"temp\", {...})\n\n# Data persists only during session\n# Use for caching, computations, temporary storage\n```\n\n---\n\n## Performance Optimization\n\n### Essential Settings\n\n```python\nimport sqlite3\n\n# WAL mode (Write-Ahead Logging) - 3-4x faster\nconn = sqlite3.connect(\"agent_data.db\")\nconn.execute(\"PRAGMA journal_mode=WAL\")\n\n# Sync OFF (faster writes, crash-safe with proper shutdown)\nconn.execute(\"PRAGMA synchronous=NORMAL\")\n\n# Memory optimization\nconn.execute(\"PRAGMA cache_size=-64000\")  # 64MB cache\nconn.execute(\"PRAGMA page_size=4096\")\n\n# Temp store in RAM\nconn.execute(\"PRAGMA temp_store=MEMORY\")\n```\n\n### Query Optimization\n\n```python\n# Use indexes for frequent queries\ndb.create_index(\"memos\", \"tags\")\ndb.create_index(\"memos\", \"created_at\")\n\n# Use prepared statements (automatic in our wrapper)\ndb.query(\"SELECT * FROM memos WHERE id = ?\", (id,))\n\n# Batch inserts for large datasets\ndb.batch_insert(\"memos\", rows_data)\n```\n\n---\n\n## Predefined Schemas\n\n### Agent Memo Schema (Memory Store)\n\n```python\ndb.create_table(\"agent_memos\", {\n    \"id\": \"INTEGER PRIMARY KEY AUTOINCREMENT\",\n    \"agent_id\": \"TEXT NOT NULL\",           # Which agent created it\n    \"key\": \"TEXT NOT NULL\",               # Lookup key\n    \"value\": \"TEXT\",                      # Stored value\n    \"priority\": \"INTEGER DEFAULT 0\",       # For retrieval ordering\n    \"created_at\": \"TEXT DEFAULT CURRENT_TIMESTAMP\",\n    \"expires_at\": \"TEXT\"                  # Optional TTL\n})\n\n# Create indexes\ndb.create_index(\"agent_memos\", \"agent_id\")\ndb.create_index(\"agent_memos\", \"key\")\ndb.create_index(\"agent_memos\", \"expires_at\")\n```\n\n### Session Log Schema\n\n```python\ndb.create_table(\"session_logs\", {\n    \"id\": \"INTEGER PRIMARY KEY AUTOINCREMENT\",\n    \"session_id\": \"TEXT NOT NULL\",\n    \"agent\": \"TEXT NOT NULL\",\n    \"message\": \"TEXT\",\n    \"metadata\": \"TEXT\",                   # JSON\n    \"created_at\": \"TEXT DEFAULT CURRENT_TIMESTAMP\"\n})\n\ndb.create_index(\"session_logs\", \"session_id\")\ndb.create_index(\"session_logs\", \"created_at\")\n```\n\n### Cache Schema (TTL-based)\n\n```python\ndb.create_table(\"cache\", {\n    \"id\": \"INTEGER PRIMARY KEY AUTOINCREMENT\",\n    \"key\": \"TEXT UNIQUE NOT NULL\",\n    \"value\": \"BLOB\",                      # Supports binary data\n    \"created_at\": \"TEXT DEFAULT CURRENT_TIMESTAMP\",\n    \"expires_at\": \"TEXT NOT NULL\"\n})\n\n# Auto-cleanup expired entries\ndb.query(\"DELETE FROM cache WHERE expires_at \u003C ?\", (datetime.now().isoformat(),))\n\ndb.create_index(\"cache\", \"key\")\ndb.create_index(\"cache\", \"expires_at\")\n```\n\n---\n\n## Advanced Features\n\n### Connection Pooling\n\n```python\nfrom sqlite_connector import ConnectionPool\n\n# Pool of connections for concurrent access\npool = ConnectionPool(\"agent_data.db\", max_connections=5)\n\n# Get connection\nconn = pool.get_connection()\n# Use conn...\npool.release_connection(conn)\n```\n\n### Automatic Backup\n\n```python\n# Backup database\ndb.backup(\"agent_data_backup.db\")\n\n# Automatic daily backup\ndb.auto_backup(\"backups\u002F\", \"daily\")\n```\n\n### Schema Migration\n\n```python\n# Add column if not exists\ndb.add_column(\"memos\", \"updated_at\", \"TEXT DEFAULT CURRENT_TIMESTAMP\")\n\n# Migrate data\ndb.migrate(\"memos\", {\n    \"old_column\": \"new_column\"\n})\n```\n\n---\n\n## Performance Benchmarks\n\n### Typical Performance\n\n| Operation | Rows | Time (In-Memory) | Time (Disk) |\n|-----------|------|------------------|-------------|\n| Insert | 10,000 | 0.05s | 0.3s |\n| Select (indexed) | 10,000 | 0.001s | 0.01s |\n| Select (full scan) | 10,000 | 0.05s | 0.5s |\n| Update | 1,000 | 0.01s | 0.1s |\n| Delete | 1,000 | 0.01s | 0.1s |\n\n### Memory Usage\n\n- Base Memory: 2-5MB\n- With 100K rows: ~10-15MB\n- With 1M rows: ~50-100MB\n- In-memory mode: Same as data size + overhead\n\n---\n\n## Best Practices for OpenClaw Agents\n\n### 1. Choose the Right Mode\n\n```python\n# Use :memory: for temporary operations\ntemp_db = SQLiteDB(\":memory:\")\n\n# Use file DB for persistent storage\npersist_db = SQLiteDB(\"agent_storage.db\")\n```\n\n### 2. Use Proper Indexes\n\n```python\n# Always index columns used in WHERE clauses\ndb.create_index(\"table\", \"column_name\")\n\n# Index multiple columns for composite queries\ndb.create_index(\"table\", \"col1, col2\")\n```\n\n### 3. Batch Operations\n\n```python\n# Instead of individual inserts:\nfor row in rows:\n    db.insert(\"table\", row)  # Slow!\n\n# Use batch insert:\ndb.batch_insert(\"table\", rows)  # Fast!\n```\n\n### 4. Use TTL for Expiring Data\n\n```python\n# Auto-cleanup old data\ndb.cleanup_expired(\"cache\", \"expires_at\")\ndb.cleanup_old(\"logs\", \"created_at\", days=7)\n```\n\n### 5. Compact Database Periodically\n\n```python\n# Reclaim space after many deletes\ndb.vacuum()  # Should be run during downtime\n```\n\n---\n\n## DuckDB Alternative (Analytics)\n\nFor analytical queries (aggregations, joins on large datasets), consider DuckDB:\n\n```python\nimport duckdb\n\nconn = duckdb.connect(\":memory:\")\n\n# Faster than SQLite for complex analytics\nconn.execute(\"\"\"\n    SELECT COUNT(*) as rows,\n           AVG(value) as avg_value\n    FROM large_table\n\"\"\").fetchall()\n```\n\n**When to use DuckDB:**\n- Analytics on large datasets (>100M rows)\n- Complex aggregations and joins\n- Columnar data operations\n- Statistical analysis\n\n**When to use SQLite:**\n- Transactional operations\n- Small to medium datasets (\u003C100M rows)\n- Point queries and updates\n- General-purpose storage\n\n---\n\n## Common Patterns\n\n### 1. Memo Storage\n\n```python\ndef save_memo(db, agent_id, key, value, ttl_hours=24):\n    expires_at = (datetime.now() + timedelta(hours=ttl_hours)).isoformat()\n    db.insert(\"agent_memos\", {\n        \"agent_id\": agent_id,\n        \"key\": key,\n        \"value\": json.dumps(value),\n        \"expires_at\": expires_at\n    })\n```\n\n### 2. Session Persistence\n\n```python\ndef save_session(db, session_id, agent, message, metadata=None):\n    db.insert(\"session_logs\", {\n        \"session_id\": session_id,\n        \"agent\": agent,\n        \"message\": message,\n        \"metadata\": json.dumps(metadata) if metadata else None\n    })\n```\n\n### 3. Caching Layer\n\n```python\ndef cache_get(db, key):\n    if expired_key := db.query_one(\n        \"SELECT value FROM cache WHERE key = ? AND expires_at > ?\",\n        (key, datetime.now().isoformat())\n    ):\n        return json.loads(expired_key)\n    return None\n\ndef cache_set(db, key, value, ttl_seconds=3600):\n    expires_at = (datetime.now() + timedelta(seconds=ttl_seconds)).isoformat()\n    db.insert_or_replace(\"cache\", {\n        \"key\": key,\n        \"value\": json.dumps(value),\n        \"expires_at\": expires_at\n    })\n```\n\n---\n\n## Error Handling\n\n```python\ntry:\n    db.insert(\"metrics\", {...})\nexcept sqlite3.IntegrityError:\n    # Duplicate key violation\n    pass\nexcept sqlite3.OperationalError:\n    # Table doesn't exist or database locked\n    pass\n```\n\n---\n\n## Size Optimization Tips\n\n### Reduce Storage\n\n1. **Use appropriate data types:**\n   - INTEGER instead of TEXT for numbers\n   - REAL instead of TEXT for floats\n   - Use CHECK constraints for validation\n\n2. **Normalize data:**\n   - Store JSON as TEXT\n   - Use TEXT for variable-length strings\n   - Avoid storing redundant data\n\n3. **Vacuum regularly:**\n   ```python\n   db.vacuum()  # Reclaims space after deletes\n   ```\n\n4. **Use WAL instead of journal:**\n   ```python\n   conn.execute(\"PRAGMA journal_mode=WAL\")\n   ```\n\n---\n\n## Migration from Other Stores\n\n### From JSON Files\n\n```python\n# Load JSON into SQLite\nimport json\n\nwith open(\"data.json\") as f:\n    data = json.load(f)\n\ndb.create_table(\"json_data\", {key: \"TEXT\" for key in data[0].keys()})\ndb.batch_insert(\"json_data\", data)\n```\n\n### From CSV Files\n\n```python\nimport pandas as pd\n\ndf = pd.read_csv(\"data.csv\")\ndf.to_sql(\"csv_data\", conn, if_exists=\"replace\", index=False)\n```\n\n---\n\n## Troubleshooting\n\n### Database Locked Error\n\n```python\n# Use WAL mode for concurrent access\nconn.execute(\"PRAGMA journal_mode=WAL\")\n\n# Or use connection pool\npool = ConnectionPool(\"db.db\", timeout=5.0)\n```\n\n### Slow Queries\n\n```python\n# Check query plan\nplan = conn.execute(\"EXPLAIN QUERY PLAN SELECT * FROM ...\").fetchall()\n\n# Add indexes\ndb.create_index(\"table\", \"column\")\n\n# Use ANALYZE\nconn.execute(\"ANALYZE\")\n```\n\n### Large Database Size\n\n```python\n# Check size info\nsize_info = conn.execute(\"PRAGMA page_count, page_size\").fetchone()\nprint(f\"Size: {(page_count * page_size) \u002F (1024*1024):.2f} MB\")\n\n# Vacuum to reclaim space\ndb.vacuum()\n```\n\n---\n\n## CLI Tool\n\nThe bundled `sqlite_cli.py` provides command-line access:\n\n```bash\n# Create database\npython scripts\u002Fsqlite_cli.py create agent_data.db\n\n# Add table\npython scripts\u002Fsqlite_cli.py create-table agent_memos -c id:INTEGER:P -c title:TEXT -c content:TEXT\n\n# Insert data\npython scripts\u002Fsqlite_cli.py insert agent_memos '{\"title\": \"Test\", \"content\": \"Hello\"}'\n\n# Query data\npython scripts\u002Fsqlite_cli.py query \"SELECT * FROM agent_memos\"\n\n# Optimize\npython scripts\u002Fsqlite_cli.py optimize agent_data.db\n```\n\n---\n\n## Resources\n\n- **SQLite Documentation:** https:\u002F\u002Fwww.sqlite.org\u002Fdocs.html\n- **Python sqlite3:** https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Fsqlite3.html\n- **DuckDB:** https:\u002F\u002Fduckdb.org\u002Fdocs\u002F\n- **Performance:** https:\u002F\u002Fwww.sqlite.org\u002Foptoverview.html\n","# Lite SQLite - Lightweight Local Database\n\nUltra-lightweight SQLite database management optimized for OpenClaw agents with minimal RAM (~2-5MB) and storage overhead.\n\n## Why SQLite?\n\n✅ **Zero setup** - No server, no configuration, file-based\n✅ **Minimal RAM** - 2-5MB typical usage\n✅ **Fast** - Millions of queries\u002Fsecond\n✅ **Portable** - Single .db file\n✅ **Reliable** - ACID compliant, crash-proof\n✅ **Cross-platform** - Works everywhere Python works\n\n## Core Features\n\n- In-memory mode for temporary data (even faster!)\n- WAL mode for concurrent access\n- Connection pooling\n- Automatic schema migration\n- Built-in backup\u002Frestore\n- Query optimization hints\n\n## Quick Start\n\n### Basic Database Operations\n\n```python\nfrom sqlite_connector import SQLiteDB\n\n# Create database (auto-wal mode enabled)\ndb = SQLiteDB(\"agent_data.db\")\n\n# Create table\ndb.create_table(\"memos\", {\n    \"id\": \"INTEGER PRIMARY KEY AUTOINCREMENT\",\n    \"title\": \"TEXT NOT NULL\",\n    \"content\": \"TEXT\",\n    \"created_at\": \"TEXT DEFAULT CURRENT_TIMESTAMP\",\n    \"tags\": \"TEXT\"\n})\n\n# Insert data\ndb.insert(\"memos\", [title=\"First memo\", content=\"Hello world\", tags=\"test\"])\n\n# Query data\nresults = db.query(\"SELECT * FROM memos WHERE tags = ?\", (\"test\",))\n\n# Update data\ndb.update(\"memos\", \"id = ?\", [content=\"Updated content\"], (1,))\n\n# Delete data\ndb.delete(\"memos\", \"id = ?\", (1,))\n\n# Close connection\ndb.close()\n```\n\n### In-Memory Database (Fastest)\n\n```python\n# Fastest mode - RAM only, no disk I\u002FO\ndb = SQLiteDB(\":memory:\")\n\n# Perfect for temporary operations\ndb.create_table(\"temp\", {...})\n\n# Data persists only during session\n# Use for caching, computations, temporary storage\n```\n\n---\n\n## Performance Optimization\n\n### Essential Settings\n\n```python\nimport sqlite3\n\n# WAL mode (Write-Ahead Logging) - 3-4x faster\nconn = sqlite3.connect(\"agent_data.db\")\nconn.execute(\"PRAGMA journal_mode=WAL\")\n\n# Sync OFF (faster writes, crash-safe with proper shutdown)\nconn.execute(\"PRAGMA synchronous=NORMAL\")\n\n# Memory optimization\nconn.execute(\"PRAGMA cache_size=-64000\")  # 64MB cache\nconn.execute(\"PRAGMA page_size=4096\")\n\n# Temp store in RAM\nconn.execute(\"PRAGMA temp_store=MEMORY\")\n```\n\n### Query Optimization\n\n```python\n# Use indexes for frequent queries\ndb.create_index(\"memos\", \"tags\")\ndb.create_index(\"memos\", \"created_at\")\n\n# Use prepared statements (automatic in our wrapper)\ndb.query(\"SELECT * FROM memos WHERE id = ?\", (id,))\n\n# Batch inserts for large datasets\ndb.batch_insert(\"memos\", rows_data)\n```\n\n---\n\n## Predefined Schemas\n\n### Agent Memo Schema (Memory Store)\n\n```python\ndb.create_table(\"agent_memos\", {\n    \"id\": \"INTEGER PRIMARY KEY AUTOINCREMENT\",\n    \"agent_id\": \"TEXT NOT NULL\",           # Which agent created it\n    \"key\": \"TEXT NOT NULL\",               # Lookup key\n    \"value\": \"TEXT\",                      # Stored value\n    \"priority\": \"INTEGER DEFAULT 0\",       # For retrieval ordering\n    \"created_at\": \"TEXT DEFAULT CURRENT_TIMESTAMP\",\n    \"expires_at\": \"TEXT\"                  # Optional TTL\n})\n\n# Create indexes\ndb.create_index(\"agent_memos\", \"agent_id\")\ndb.create_index(\"agent_memos\", \"key\")\ndb.create_index(\"agent_memos\", \"expires_at\")\n```\n\n### Session Log Schema\n\n```python\ndb.create_table(\"session_logs\", {\n    \"id\": \"INTEGER PRIMARY KEY AUTOINCREMENT\",\n    \"session_id\": \"TEXT NOT NULL\",\n    \"agent\": \"TEXT NOT NULL\",\n    \"message\": \"TEXT\",\n    \"metadata\": \"TEXT\",                   # JSON\n    \"created_at\": \"TEXT DEFAULT CURRENT_TIMESTAMP\"\n})\n\ndb.create_index(\"session_logs\", \"session_id\")\ndb.create_index(\"session_logs\", \"created_at\")\n```\n\n### Cache Schema (TTL-based)\n\n```python\ndb.create_table(\"cache\", {\n    \"id\": \"INTEGER PRIMARY KEY AUTOINCREMENT\",\n    \"key\": \"TEXT UNIQUE NOT NULL\",\n    \"value\": \"BLOB\",                      # Supports binary data\n    \"created_at\": \"TEXT DEFAULT CURRENT_TIMESTAMP\",\n    \"expires_at\": \"TEXT NOT NULL\"\n})\n\n# Auto-cleanup expired entries\ndb.query(\"DELETE FROM cache WHERE expires_at \u003C ?\", (datetime.now().isoformat(),))\n\ndb.create_index(\"cache\", \"key\")\ndb.create_index(\"cache\", \"expires_at\")\n```\n\n---\n\n## Advanced Features\n\n### Connection Pooling\n\n```python\nfrom sqlite_connector import ConnectionPool\n\n# Pool of connections for concurrent access\npool = ConnectionPool(\"agent_data.db\", max_connections=5)\n\n# Get connection\nconn = pool.get_connection()\n# Use conn...\npool.release_connection(conn)\n```\n\n### Automatic Backup\n\n```python\n# Backup database\ndb.backup(\"agent_data_backup.db\")\n\n# Automatic daily backup\ndb.auto_backup(\"backups\u002F\", \"daily\")\n```\n\n### Schema Migration\n\n```python\n# Add column if not exists\ndb.add_column(\"memos\", \"updated_at\", \"TEXT DEFAULT CURRENT_TIMESTAMP\")\n\n# Migrate data\ndb.migrate(\"memos\", {\n    \"old_column\": \"new_column\"\n})\n```\n\n---\n\n## Performance Benchmarks\n\n### Typical Performance\n\n| Operation | Rows | Time (In-Memory) | Time (Disk) |\n|-----------|------|------------------|-------------|\n| Insert | 10,000 | 0.05s | 0.3s |\n| Select (indexed) | 10,000 | 0.001s | 0.01s |\n| Select (full scan) | 10,000 | 0.05s | 0.5s |\n| Update | 1,000 | 0.01s | 0.1s |\n| Delete | 1,000 | 0.01s | 0.1s |\n\n### Memory Usage\n\n- Base Memory: 2-5MB\n- With 100K rows: ~10-15MB\n- With 1M rows: ~50-100MB\n- In-memory mode: Same as data size + overhead\n\n---\n\n## Best Practices for OpenClaw Agents\n\n### 1. Choose the Right Mode\n\n```python\n# Use :memory: for temporary operations\ntemp_db = SQLiteDB(\":memory:\")\n\n# Use file DB for persistent storage\npersist_db = SQLiteDB(\"agent_storage.db\")\n```\n\n### 2. Use Proper Indexes\n\n```python\n# Always index columns used in WHERE clauses\ndb.create_index(\"table\", \"column_name\")\n\n# Index multiple columns for composite queries\ndb.create_index(\"table\", \"col1, col2\")\n```\n\n### 3. Batch Operations\n\n```python\n# Instead of individual inserts:\nfor row in rows:\n    db.insert(\"table\", row)  # Slow!\n\n# Use batch insert:\ndb.batch_insert(\"table\", rows)  # Fast!\n```\n\n### 4. Use TTL for Expiring Data\n\n```python\n# Auto-cleanup old data\ndb.cleanup_expired(\"cache\", \"expires_at\")\ndb.cleanup_old(\"logs\", \"created_at\", days=7)\n```\n\n### 5. Compact Database Periodically\n\n```python\n# Reclaim space after many deletes\ndb.vacuum()  # Should be run during downtime\n```\n\n---\n\n## DuckDB Alternative (Analytics)\n\nFor analytical queries (aggregations, joins on large datasets), consider DuckDB:\n\n```python\nimport duckdb\n\nconn = duckdb.connect(\":memory:\")\n\n# Faster than SQLite for complex analytics\nconn.execute(\"\"\"\n    SELECT COUNT(*) as rows,\n           AVG(value) as avg_value\n    FROM large_table\n\"\"\").fetchall()\n```\n\n**When to use DuckDB:**\n- Analytics on large datasets (>100M rows)\n- Complex aggregations and joins\n- Columnar data operations\n- Statistical analysis\n\n**When to use SQLite:**\n- Transactional operations\n- Small to medium datasets (\u003C100M rows)\n- Point queries and updates\n- General-purpose storage\n\n---\n\n## Common Patterns\n\n### 1. Memo Storage\n\n```python\ndef save_memo(db, agent_id, key, value, ttl_hours=24):\n    expires_at = (datetime.now() + timedelta(hours=ttl_hours)).isoformat()\n    db.insert(\"agent_memos\", {\n        \"agent_id\": agent_id,\n        \"key\": key,\n        \"value\": json.dumps(value),\n        \"expires_at\": expires_at\n    })\n```\n\n### 2. Session Persistence\n\n```python\ndef save_session(db, session_id, agent, message, metadata=None):\n    db.insert(\"session_logs\", {\n        \"session_id\": session_id,\n        \"agent\": agent,\n        \"message\": message,\n        \"metadata\": json.dumps(metadata) if metadata else None\n    })\n```\n\n### 3. Caching Layer\n\n```python\ndef cache_get(db, key):\n    if expired_key := db.query_one(\n        \"SELECT value FROM cache WHERE key = ? AND expires_at > ?\",\n        (key, datetime.now().isoformat())\n    ):\n        return json.loads(expired_key)\n    return None\n\ndef cache_set(db, key, value, ttl_seconds=3600):\n    expires_at = (datetime.now() + timedelta(seconds=ttl_seconds)).isoformat()\n    db.insert_or_replace(\"cache\", {\n        \"key\": key,\n        \"value\": json.dumps(value),\n        \"expires_at\": expires_at\n    })\n```\n\n---\n\n## Error Handling\n\n```python\ntry:\n    db.insert(\"metrics\", {...})\nexcept sqlite3.IntegrityError:\n    # Duplicate key violation\n    pass\nexcept sqlite3.OperationalError:\n    # Table doesn't exist or database locked\n    pass\n```\n\n---\n\n## Size Optimization Tips\n\n### Reduce Storage\n\n1. **Use appropriate data types:**\n   - INTEGER instead of TEXT for numbers\n   - REAL instead of TEXT for floats\n   - Use CHECK constraints for validation\n\n2. **Normalize data:**\n   - Store JSON as TEXT\n   - Use TEXT for variable-length strings\n   - Avoid storing redundant data\n\n3. **Vacuum regularly:**\n   ```python\n   db.vacuum()  # Reclaims space after deletes\n   ```\n\n4. **Use WAL instead of journal:**\n   ```python\n   conn.execute(\"PRAGMA journal_mode=WAL\")\n   ```\n\n---\n\n## Migration from Other Stores\n\n### From JSON Files\n\n```python\n# Load JSON into SQLite\nimport json\n\nwith open(\"data.json\") as f:\n    data = json.load(f)\n\ndb.create_table(\"json_data\", {key: \"TEXT\" for key in data[0].keys()})\ndb.batch_insert(\"json_data\", data)\n```\n\n### From CSV Files\n\n```python\nimport pandas as pd\n\ndf = pd.read_csv(\"data.csv\")\ndf.to_sql(\"csv_data\", conn, if_exists=\"replace\", index=False)\n```\n\n---\n\n## Troubleshooting\n\n### Database Locked Error\n\n```python\n# Use WAL mode for concurrent access\nconn.execute(\"PRAGMA journal_mode=WAL\")\n\n# Or use connection pool\npool = ConnectionPool(\"db.db\", timeout=5.0)\n```\n\n### Slow Queries\n\n```python\n# Check query plan\nplan = conn.execute(\"EXPLAIN QUERY PLAN SELECT * FROM ...\").fetchall()\n\n# Add indexes\ndb.create_index(\"table\", \"column\")\n\n# Use ANALYZE\nconn.execute(\"ANALYZE\")\n```\n\n### Large Database Size\n\n```python\n# Check size info\nsize_info = conn.execute(\"PRAGMA page_count, page_size\").fetchone()\nprint(f\"Size: {(page_count * page_size) \u002F (1024*1024):.2f} MB\")\n\n# Vacuum to reclaim space\ndb.vacuum()\n```\n\n---\n\n## CLI Tool\n\nThe bundled `sqlite_cli.py` provides command-line access:\n\n```bash\n# Create database\npython scripts\u002Fsqlite_cli.py create agent_data.db\n\n# Add table\npython scripts\u002Fsqlite_cli.py create-table agent_memos -c id:INTEGER:P -c title:TEXT -c content:TEXT\n\n# Insert data\npython scripts\u002Fsqlite_cli.py insert agent_memos '{\"title\": \"Test\", \"content\": \"Hello\"}'\n\n# Query data\npython scripts\u002Fsqlite_cli.py query \"SELECT * FROM agent_memos\"\n\n# Optimize\npython scripts\u002Fsqlite_cli.py optimize agent_data.db\n```\n\n---\n\n## Resources\n\n- **SQLite Documentation:** https:\u002F\u002Fwww.sqlite.org\u002Fdocs.html\n- **Python sqlite3:** https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Fsqlite3.html\n- **DuckDB:** https:\u002F\u002Fduckdb.org\u002Fdocs\u002F\n- **Performance:** https:\u002F\u002Fwww.sqlite.org\u002Foptoverview.html\n",{"name":5,"description":7},"main","f9d3fe7cf9ac8f1ea63a0d96e98e1f510a3814db","skills\u002Fomprasad122007-rgb\u002Flite-sqlite",1,"https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills","https:\u002F\u002Fgithub.com\u002Fjavimosch","intrane.fr","Building robust, open-source infrastructure for the commons. AI-leveraged, self-hosted, built to last.","2026-06-07 03:34:58",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add javimosch\u002Fopen-claw-skills --skill lite-sqlite",{"tool":39,"command":40},"bunx","bunx skills add javimosch\u002Fopen-claw-skills --skill lite-sqlite",{"tool":42,"command":43},"pnpm","pnpm dlx skills add javimosch\u002Fopen-claw-skills --skill lite-sqlite","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fomprasad122007-rgb\u002Flite-sqlite\u002FSKILL.md",true,[],[48,56,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":55},"01M778GGXG2VQ0YF31W2MKGMQZ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":55},"01M778G7BH8SBJ9FJ6C3G7CB1K","ceaser","Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir\u002FUltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":55},"01M778FYCJQZWFKKX5FYMK3S47","ceaser-send","Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir\u002FUltraHonk zero-knowledge proofs.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser-send\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":55},"01M778FQQNSEYA3HJKZBPQ4M9Z","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":55},"01M778FGVZX7QA2TF9BFMM37FY","moldium","Post and manage content on the Moldium blog platform. Triggered by \"post to Moldium\", \"write a blog post\", \"publish an article\", etc.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyom45\u002Fmoldium\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":55},"01M778F88D8PQ9MQ0KNW2TJ8ZH","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http:\u002F\u002Fweakaccept.top:8000\u002F.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[]]