Skip to content

Add R2 cloud sync for shared paper storage - #7

Merged
odfalik merged 7 commits into
mainfrom
cloud-storage
May 7, 2026
Merged

odfalik merged 7 commits into
mainfrom
cloud-storage

Conversation

@odfalik

@odfalik odfalik commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • rclone-based sync to Cloudflare R2 for ~/Documents/papers
  • Auto-installs rclone via brew and configures from 1Password credentials
  • Additive sync only (won't delete local or remote files)
  • PDF hash dedup — skips processing if same content already exists

Test plan

  • rclone installs and configures from 1Password
  • sync.pull() downloads papers from R2
  • sync.push() uploads local papers to R2
  • Dedup prevents reprocessing identical PDFs

odfalik added 7 commits April 14, 2026 17:39
Architecture: local embeddings (MPS/CUDA) + cloud vector storage

- New worker/: thin Cloudflare Worker (~85 lines) proxying Vectorize
  - POST /upsert, /query, /delete with Bearer token auth
- New vectorize_client.py: replaces chromadb_client.py
  - Local HuggingFace embeddings (bge-small-en-v1.5)
  - HTTP calls to Worker for vector storage/retrieval
  - query_all_papers() for cross-paper RAG search
- Updated embed.py: embed locally, store in Vectorize
- Updated search.py: RAG search via Vectorize, grep stays local
- Removed chromadb, llama-index-vector-stores-chroma deps
- Restore ChromaDB as the vector store (revert Vectorize experiment)
- Add sync.py: rclone-based R2 sync (pull before search, push after process)
- Keep PDF hash dedup from earlier work
- Architecture: fully local MCP server + R2 as shared file store via rclone
  - No Worker, no Vectorize, no remote MCP
  - Both users mount same R2 bucket via rclone
  - ChromaDB indexes sync alongside papers
LOCAL_DIR was a literal "~/Documents/papers" string passed to rclone via
subprocess (no shell). rclone doesn't expand ~ on its own and treats it
as a literal dirname relative to cwd. When the MCP server ran from
/Users/oded, pull() materialized everything at /Users/oded/~/Documents/papers/
(1.5 GB stray tree). push() had the same flaw in reverse.

Bump version to 0.4.1.
@odfalik
odfalik merged commit 05d490f into main May 7, 2026
2 checks passed
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