Sync a local folder
Turn a folder of Markdown, text and PDF files, including Logseq and Apple Notes exports, into memory with one command that runs on your own machine.
sm folder sync reads a folder on your computer and adds its notes to your local SmartMemory. The reading happens on your machine. Nothing is fetched by our servers and no cloud account is involved.
Before you start
- SmartMemory running locally (
smwith the local daemon). The command refuses to run against a remote workspace. - The folder extra:
pip install "smartmemory[folders]". It adds the folder reader and PDF text support.
Run it
sm folder sync ~/Notes --preset markdown
sm folder sync ~/Notes --preset markdown --watch 300 # repeat every 300 secondsEach run prints how many files were created, replaced, unchanged, archived and failed. It exits with an error if any file failed.
Presets
| Preset | What it reads |
|---|---|
markdown | Any folder: .md, .markdown, .txt and .pdf files |
logseq | A Logseq graph folder: the pages/ and journals/ folders only. The logseq/ config folder and bak/ backups are skipped |
apple_notes | A folder written by an Apple Notes exporter: Markdown, text and PDF files. attachments folders are skipped |
The Logseq and Apple Notes folder layouts are unverified against the vendors' own documentation. The presets follow the layouts those tools are commonly seen to produce. If your export looks different, use the markdown preset. Apple Notes has no folder format of its own, so the folder always comes from a third-party exporter.
What is skipped, always
- Files larger than 5 MiB (the size cap). A skipped file is counted and logged by id, never by path.
- Hidden files and folders, and common clutter such as
.git,node_modulesand temp files. - PDFs when the PDF reader is not installed.
- Symbolic links that point outside the folder, and any path that resolves outside it. A hard link to a file elsewhere on disk cannot be detected and is read like any other file.
Re-runs, edits and deletes
- A file whose text has not changed is not written again, even if you touched it.
- An edited file replaces its earlier memory.
- A file that disappears is removed from memory only after it is missing in two complete scans in a row. A folder that cannot be read at all (an unmounted drive, a lost permission) never removes anything.
- A file that fails is retried on the next run and marked failed for good after three attempts.
Progress is saved in a small state file under your SmartMemory data folder, one per synced folder. Only one sync of a folder runs at a time.