← Back to list

storage-sync
by d-o-hub
A modular Rust-based self-learning episodic memory system for AI agents, featuring hybrid storage with Turso (SQL) and redb (KV), async execution tracking, reward scoring, reflection, and pattern-based skill evolution. Designed for real-world applicability, maintainability, and scalable agent workflows.
⭐ 3🍴 0📅 Jan 23, 2026
SKILL.md
name: storage-sync description: Synchronize memories between Turso (durable) and redb (cache) storage layers. Use when cache appears stale, after failures, or during periodic maintenance.
Storage Sync
Synchronize memories between Turso (durable) and redb (cache) storage layers.
When to Sync
- On startup - After system initialization
- Periodic - Scheduled background sync
- Cache staleness - When redb appears outdated
- Recovery - After storage failures
- Manual trigger - When explicitly requested
Sync Process
-
Check connection health:
turso_client.ping().await?; redb_env.check_integrity()?; -
Fetch latest from Turso:
let episodes = turso_client .query("SELECT * FROM episodes ORDER BY timestamp DESC LIMIT ?") .bind(max_episodes_cache) .await?; -
Update redb cache:
tokio::task::spawn_blocking(move || { let write_txn = redb.begin_write()?; let mut table = write_txn.open_table(EPISODES_TABLE)?; for episode in episodes { table.insert(episode.id.as_bytes(), episode.to_bytes())?; } write_txn.commit()?; }); -
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 |
Score
Total Score
75/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon



