d-o-hub/rust-self-learning-memory

storage-sync

Synchronize memories between Turso (durable) and redb (cache) storage layers. Use when cache appears stale, after failures, or during periodic maintenance.

First seen Feb 21, 2026

Installation

$ npx skills add d-o-hub/rust-self-learning-memory --skill storage-sync

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from d-o-hub/rust-self-learning-memory · top by installs.

npx skills add d-o-hub/rust-self-learning-memory

Browse all from d-o-hub/rust-self-learning-memory

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 12
License LICENSE
Default branch main
Open issues 3
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,267 B
  • docs SUMMARY.md 175 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 43 installs

SKILL.md

Storage Sync

Synchronize memories between Turso (durable) and redb (cache) storage layers.

When to Sync

  1. On startup - After system initialization
  2. Periodic - Scheduled background sync
  3. Cache staleness - When redb appears outdated
  4. Recovery - After storage failures
  5. Manual trigger - When explicitly requested

Sync Process

  1. Check connection health:

``rust tursoclient.ping().await?; redbenv.check_integrity()?; ``

  1. Fetch latest from Turso:

``rust let episodes = tursoclient .query("SELECT * FROM episodes ORDER BY timestamp DESC LIMIT ?") .bind(maxepisodes_cache) .await?; ``

  1. Update redb cache:

``rust tokio::task::spawnblocking(move || { let writetxn = redb.beginwrite()?; let mut table = writetxn.opentable(EPISODESTABLE)?; for episode in episodes { table.insert(episode.id.asbytes(), episode.tobytes())?; } write_txn.commit()?; }); ``

  1. Sync patterns and embeddings if enabled

Configuration

pub struct SyncConfig {
    pub max_episodes_cache: usize,  // Default: 1000
    pub batch_size: usize,          // Default: 100
    pub sync_patterns: bool,        // Default: true
    pub sync_embeddings: bool,      // Default: true
}

Error Handling

Error Handling
Turso unavailable Skip sync, log warning, retry later
redb corruption Attempt repair, rebuild from Turso
Partial sync Track progress, resume from last point

Performance Tips

  • Batch small operations
  • Incremental sync (only changes)
  • Parallel fetch with Tokio
  • Write-ahead preparation

Validation

After sync, verify:

  • Episode count matches
  • Latest episodes present
  • Pattern counts consistent
  • No orphaned embeddings

Troubleshooting

Issue Solution
Slow syncs Reduce cache size, increase batch
redb lock errors Use dedicated write task
Memory pressure Stream large results, smaller batches