Skip to content

O6lvl4/memre

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MemRE icon

MemRE

AI-powered spaced repetition flashcards as a native macOS desktop app.

CI Latest release License: MIT


Features

  • πŸƒ Spaced repetition β€” SM-2 inspired scheduler with continuous retention curve
  • 🧠 Multi-provider AI β€” Ollama (Gemma 4), Anthropic API (Claude Sonnet), Claude Code CLI, deterministic offline stub fallback
  • 🎚️ Per-call provider override β€” pin Sonnet for one card-generation pass without changing your default
  • ♻️ Hot-reload settings β€” switch providers / paste an API key, no restart
  • πŸ“š Knowledge sources β€” paste a study text and have AI extract cards from it (FractoP-comprehensive mode for long content)
  • πŸ”Œ Local-first β€” SQLite at ~/Library/Application Support/Memre/memre.db. API keys never leave the machine
  • πŸͺŸ Native macOS β€” single 15 MB .app bundle, no Electron, no Chromium

Install

Download the latest signed .app from Releases:

# Apple Silicon
curl -L -o MemRE.zip https://github.com/O6lvl4/memre/releases/latest/download/memre-v0.1.3-darwin-arm64.zip
unzip MemRE.zip
mv memre.app /Applications/
xattr -dr com.apple.quarantine /Applications/memre.app   # ad-hoc signed only
open /Applications/memre.app

Then click the gear icon in the header to choose an AI provider.

AI providers

Provider Auth Default model Cost
Ollama none β€” local daemon gemma4:26b (or any tag installed) free, runs on your machine
Anthropic API API key claude-sonnet-4-6 per-token (your account)
Claude Code CLI none β€” uses existing claude session claude-sonnet-4-6 included in your Claude subscription
Local stub n/a offline fallback free, low quality (sentence splitter)

Settings are stored locally in SQLite. The Anthropic key is plain text in the same DB; never sent anywhere except api.anthropic.com. Claude Code provider shells out to your claude binary so authentication is delegated to that.

Architecture

internal/
β”œβ”€β”€ deck/           bounded context: entity + service + repo + sqlite + Wails handler
β”œβ”€β”€ card/
β”œβ”€β”€ knowledge/
β”œβ”€β”€ ai/             Provider port + Ollama / Anthropic / ClaudeCode / Stub + Registry
β”œβ”€β”€ settings/       KV store, hot-reload backend
β”œβ”€β”€ srs/            pure SM-2 / retention math
β”œβ”€β”€ platform/
β”‚   β”œβ”€β”€ sqlite/     shared connection + idempotent migrations
β”‚   β”œβ”€β”€ clock/      Clock interface + System + Fake (for tests)
β”‚   └── idgen/      Generator interface + Crypto + Sequential
└── composition/    composition root β€” only place adapters meet ports

2026 Go DDD style: vertical slice (one bounded context per directory), consumer-side Repository interfaces, Service structs with methods, no separate domain/application/infrastructure/ layer dirs. Tests substitute fakes in-package without any DI framework.

Context map

MemRE bounded contexts

Source: docs/assets/context-map.mmd β€” rendered with premaid (pretty theme).

Bounded context relationships

From β†’ To Relationship Notes
deck ← card data read model via StatsRepository deck never imports card; deck-level stats come from a dedicated read-model port computed against the cards table
card β†’ events published events card.Reviewed lets future gamification / achievement subscribers react without coupling
card / deck β†’ srs shared kernel pure scheduling math used by both, no state
ai β†’ external LLMs anti-corruption layer Provider interface insulates the rest of the app from JSON Schemas, model names, and provider quirks
every slice β†’ platform infrastructure each slice owns its own Sqlite* adapter that depends on the shared Store
composition β†’ all composition root the only place concrete adapters meet ports

Quick start (development)

Requirements: Go 1.25+, Node 20+, Xcode CLT, wails3 CLI.

git clone https://github.com/O6lvl4/memre
cd memre

# install deps + generate Wails TS bindings
cd frontend && npm ci && cd ..
wails3 generate bindings -ts

# run with hot reload
wails3 dev

# or build a production .app bundle
wails3 task darwin:package
open bin/memre.app

Tests

go test -race -count=1 -cover ./internal/...
Package Coverage Notes
srs 90% pure SM-2 + retention math, table-driven
deck 85% entity invariants + service + sqlite roundtrip
knowledge 73% + ON DELETE CASCADE, FK enforcement
card 66% + ApplyReview, IsDue, upsert
ai 52% Ollama/Anthropic via httptest, Registry resolve, Fallback
settings 60% KV roundtrip, upsert
platform/clock 100%
platform/idgen 94%
platform/sqlite 36% migration + WAL/foreign_keys pragmas + idempotency

β‰ˆ110 unit + integration tests, all run on every CI pipeline.

Custom providers / models

# pick a different Ollama model
MEMRE_OLLAMA_MODEL=gemma4:e4b open bin/memre.app

# point at a remote Ollama
MEMRE_OLLAMA_URL=http://192.168.1.50:11434 open bin/memre.app

# or set defaults via the in-app gear icon (persists in SQLite)

Releasing

A git push of an annotated tag vX.Y.Z triggers .github/workflows/release.yml, which builds on macos-latest, ad-hoc signs the .app, zips it, computes SHA-256, and attaches both to a GitHub Release with auto-generated notes.

git tag -a v0.2.0 -m "..."
git push origin v0.2.0

CI

.github/workflows/ci.yml:

  • Linux: go vet + go test -race -cover on the pure layer (no Wails GUI deps)
  • Linux: frontend tsc -b && vite build after generating TS bindings
  • macOS: full graph go vet ./... + .app smoke test + binary artifact upload

Roadmap

  • Streaming AI responses (token-by-token rendering for long generations)
  • macOS Keychain for the Anthropic API key (currently SQLite plaintext)
  • Apple Developer ID signing + notarisation (Gatekeeper friction-free install)
  • Universal binary (arm64 + amd64) and Linux / Windows builds
  • Auto-update (check GitHub Releases on launch)
  • Import / export Anki .apkg and CSV
  • Slog structured logging + per-call AI metrics

License

MIT Β© 2026 MemRE contributors