Your organisation memory that automates your work.
ProMem is a multi-user FastAPI app over Supabase Postgres, with Google OAuth via Supabase Auth. Reads your local productivity-tracker SQLite, classifies activities into Super-Contexts, links them to project deliverables, and synthesizes per-project wiki pages. No embeddings, no vector store, no GPU.
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python3 -m uvicorn promem_app:app --port 8888 --reloadThen open http://localhost:8888/wiki — you'll be redirected to
/login for Google sign-in via Supabase.
-
Supabase project — Dashboard → New project → Mumbai (or closest).
-
Schema — paste
migrations/0002_postgres_init.sqlinto Supabase SQL Editor → Run. Confirms 10 tables under public schema. -
Google OAuth — enable Google provider in Supabase Auth, add the Supabase callback URL (
https://<project>.supabase.co/auth/v1/callback) to Google Cloud OAuth client → Authorized redirect URIs. -
Whitelist — add
http://localhost:8888/login(and your prod URL) to Supabase Auth → URL Configuration → Redirect URLs. -
.env— copy these from Supabase Dashboard. Do not put#comments on the same line as a value — the env loader treats# fooafter an unquoted value as part of the value:PROMEM_DB_URL="postgresql://postgres:PASSWORD@db.PROJECT.supabase.co:5432/postgres" SUPABASE_URL="https://PROJECT.supabase.co" SUPABASE_ANON_KEY="eyJhbGciOi..." SUPABASE_JWT_SECRET="your-jwt-secret" OPENAI_API_KEY="sk-..." PROMEM_USER_ID="00000000-0000-0000-0000-000000000000" PROMEM_TRACKER_DB="/Users/you/.productivity-tracker/tracker.db"
PROMEM_USER_ID: Supabase → Authentication → Users → click your user → "User UID" (a UUID).OPENAI_API_KEY: needed only for the nightly classify/synthesize phases.PROMEM_TRACKER_DB: optional — defaults to${PROMEM_DATA_DIR}/tracker.db.
The nightly pipeline is local-first: it reads your local tracker.db
and writes per-user data to Supabase Postgres.
python3 promem_orchestrator.py whoami # confirm user resolution
python3 promem_orchestrator.py check-key # confirm env wiring
python3 promem_orchestrator.py run # full sync → classify → match → synth
python3 promem_orchestrator.py status # last_*_at timestampsAfter a run, refresh /wiki in the browser — your SC cards fill in,
deliverable wikis populate.
- Install flyctl (one-time):
brew install flyctl && fly auth signup(orfly auth login). - Launch the app from this repo:
Accept the existing
fly launch --no-deploy --copy-config
fly.tomlwhen prompted; pick a unique app name (e.g.promem-rohit); skip Postgres + Redis (we use Supabase). - Set production secrets (these are the same values from your local
.env, minus the local-only ones):Don't setfly secrets set \ PROMEM_DB_URL="postgresql://postgres:PASSWORD@db.PROJECT.supabase.co:5432/postgres" \ SUPABASE_URL="https://PROJECT.supabase.co" \ SUPABASE_ANON_KEY="eyJ..." \ SUPABASE_JWT_SECRET="your-jwt-secret"
PROMEM_USER_ID,PROMEM_TRACKER_DB, orOPENAI_API_KEYin Fly — those are for the local pipeline run only. - Whitelist the prod URL in Supabase Dashboard → Authentication → URL Configuration → Redirect URLs:
https://YOUR-APP.fly.dev/login - Deploy:
fly deploy. Wait ~2 min. Openhttps://YOUR-APP.fly.dev/wiki→ redirects to/login→ Google sign-in → wiki.
The pipeline still runs on your local machine (it needs read access to your local
tracker.db); it writes to the same Supabase Postgres so the Fly-deployed UI sees the
same data.
promem_app.py FastAPI app + routes (/wiki, /projects, /productivity, /login, /auth/*)
promem_orchestrator.py CLI driver for the nightly pipeline
promem_pipeline/
├── sync.py Stage 2: tracker.db → work_pages
├── classify.py Stage 3: LLM classifies into (sc_label, ctx_label)
├── filter.py Stage 3.5: archive non-keep SCs
├── matcher.py Stage 4: match work_pages to deliverables (5-layer scoring)
└── synthesis.py Stage 5: LLM synthesizes per-SC and per-deliverable wiki prose
db.py Postgres connection pool + user_id helper
auth.py Supabase JWT verification (ES256 via JWKS, HS256 fallback)
templates/ Jinja2 templates (promem_*.html, all extend promem_base.html)
migrations/0002_*.sql Postgres schema (multi-user with RLS)
| Var | Required for | Purpose |
|---|---|---|
PROMEM_DB_URL |
app + pipeline | Supabase Postgres connection string |
SUPABASE_URL |
app (auth) | Project URL — used for JWKS endpoint + login page |
SUPABASE_ANON_KEY |
app (login page) | Public anon key, embedded in /login HTML |
SUPABASE_JWT_SECRET |
app (HS256 only) | Legacy projects on HS256; ES256 uses JWKS automatically |
PROMEM_USER_ID |
pipeline | UUID of the user whose data the pipeline writes |
PROMEM_TRACKER_DB |
pipeline | Path to local productivity-tracker SQLite |
PROMEM_DATA_DIR |
optional | Used as fallback for tracker.db lookup |
OPENAI_API_KEY |
pipeline | gpt-4o-mini via httpx for classify + synthesize |
PROMEM_SECURE_COOKIES |
optional | true in HTTPS production to enable Secure flag |
Apache 2.0 — see LICENSE.