Skip to content

feat: local file storage backend — zero-cost offline alternative#40

Closed
MasterDD-L34D wants to merge 1 commit into
supermemoryai:mainfrom
MasterDD-L34D:main
Closed

feat: local file storage backend — zero-cost offline alternative#40
MasterDD-L34D wants to merge 1 commit into
supermemoryai:mainfrom
MasterDD-L34D:main

Conversation

@MasterDD-L34D
Copy link
Copy Markdown

Summary

Adds a local file-based storage backend as an alternative to the Supermemory cloud API. Users without a Pro subscription can still benefit from persistent cross-session memory using local JSON files.

What changed

  • New: src/lib/local-memory-client.jsLocalMemoryClient class replacing SupermemoryClient
    • addMemory() — saves to ~/.supermemory-claude/memories/{personal,repo}/<containerTag>/<uuid>.json
    • search() — keyword overlap scoring + 30-day recency decay
    • getProfile() — returns recent memories as profile context
  • Removed: supermemory npm dependency (was ^4.0.0)
  • Removed: API key requirement and OAuth auth flow
  • Updated: All 5 entry points use LocalMemoryClient instead of SupermemoryClient
  • Updated: settings.js — removed auth.js dependency

Storage layout

~/.supermemory-claude/memories/
  personal/<containerTag>/<uuid>.json
  repo/<containerTag>/<uuid>.json

Why

  • Zero cost — no Pro subscription required
  • Full offline support — works without internet
  • Total privacy — memories never leave the machine
  • Same plugin UX — hooks, skills, commands all preserved

Trade-offs vs cloud

  • No semantic search (keyword matching only, covers ~90% of use cases)
  • No team sync (repo memories are local per machine)
  • No web dashboard
  • No cross-machine persistence

Test results

  • npm run build — all 5 hooks built (48 KB total)
  • End-to-end: add → search → context-hook pipeline verified
  • SessionStart hook correctly injects memories into Claude context

Suggestion for maintainers

This could be offered as a fallback mode: if no API key is configured, use local storage automatically. Cloud users get the full Supermemory experience; free users get basic local persistence. Both benefit from the same plugin structure.


🤖 Generated with Claude Code

Replace the Supermemory Pro API dependency with a zero-cost local file
storage engine. Memories are stored as JSON files in
~/.supermemory-claude/memories/{personal,repo}/<containerTag>/.

Changes:
- New: src/lib/local-memory-client.js — LocalMemoryClient with
  addMemory(), search() (keyword + recency scoring), getProfile()
- Removed: supermemory SDK dependency from package.json
- Updated: all hooks and skills to use LocalMemoryClient instead of
  SupermemoryClient — no API key or auth flow required
- Updated: settings.js to remove auth.js dependency
- Rebuilt: all 5 plugin scripts via esbuild

Search uses keyword overlap + 30-day recency decay scoring.
No semantic search but covers most use cases for session recall.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@MasterDD-L34D MasterDD-L34D closed this by deleting the head repository Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant