Skip to content

Storage

Notes are markdown files with YAML frontmatter:

---
id: 405614a7-a382-49db-bb37-b3f549bfddd1
title: retryWithBackoff.ts
description: RxJS retry with exponential backoff
tags:
- rxjs
- fetch
- typescript
type: file
repository: github.com/myorg/myapp
created: '2026-03-29T16:00:50.050Z'
updated: '2026-03-29T18:35:24.931Z'
---
```typescript
export const retryWithBackoff = <T>(count: number) => {
// ...
};
```

mor follows the XDG Base Directory Specification:

~/.config/mor/ # XDG_CONFIG_HOME — configuration
config.json
~/.local/share/mor/ # XDG_DATA_HOME — user data
notes/
retry-with-backoff-4056.md
python-naming-a1b2.md
meeting-notes-c3d4.md
~/.local/state/mor/ # XDG_STATE_HOME — runtime state
index.db # SQLite FTS + embeddings index
credentials.json # OAuth tokens (created by `mor login`)
oauth.db # OAuth clients and tokens (server-side)

Set MOR_HOME to put everything in a single flat directory (useful for testing or portable installs).

FieldRequiredDescription
idyesUUID, auto-generated
titleyesDisplay name
descriptionnoShort one-line summary
tagsyesArray of strings (can be empty)
typeyesOne of: user, feedback, project, reference, knowledge, snippet, file
repositorynoSource repository (auto-detected from git)
createdyesISO 8601 timestamp
updatedyesISO 8601 timestamp

Filenames are auto-generated from the title: slugified + 4-char hash suffix. For example, retryWithBackoff.ts becomes retrywithbackoff-ts-4056.md.

The index at index.db contains:

  • memories table — metadata + content for fast queries
  • memories_fts — FTS5 virtual table for full-text search
  • links — cross-references between notes (derived from content and frontmatter)
  • embeddings — vector blobs for semantic search (optional)

The index auto-syncs from the markdown files. If it gets out of sync, run mor reindex.

Notes can reference each other using markdown links with the mor: scheme:

See [Fastify Chaos Plugin](mor:22f6b489) for resilience testing.

For file/snippet notes where content is a code block, use frontmatter links:

links:
- id: 22f6b489
title: Fastify Chaos Plugin

The links table is a derived index — rebuilt from content and frontmatter on every upsert and reindex. Mor never writes to frontmatter; it only reads from it.

The notes folder can be a git repository. Use mor sync to pull remote changes and push local ones:

Terminal window
cd ~/.local/share/mor/notes
git init
git remote add origin git@github.com:you/notes.git
# Then from anywhere:
mor sync

mor sync runs git pull --rebase --autostash then commits and pushes.

Enable autosync in config to sync automatically after every add, update, or remove:

{
"autosync": true
}

See Configuration for all config.json options.