Skip to content

Self-hosted MCP server + dashboard giving Claude Code, Cursor & Hermes agents shared long-term memory over a git-backed markdown vault. Agent-native, Obsidian-compatible second brain — markdown RAG, no vector DB.

4.7 KB
Raw Blame
# ── Engram ──────────────────────────────────────────────────────────────────
# LOCAL DEV needs nothing here — Engram has sane defaults and the dashboard is OPEN
# until you set AUTH_SECRET. Copy to .env.local only if you want to override a default.
#
# FOR DEPLOY set the five bootstrap vars below on your host (they gate login + say where
# state lives, so they can't be configured from inside the app). EVERYTHING ELSE is set
# in the dashboard → Settings, with no redeploy — see the commented reference at the bottom.
# Full guide: DEPLOY.md.

# ── Production bootstrap (set these on your host) ─────────────────────────────
AUTH_SECRET=""            # openssl rand -base64 32 (or Railway "Generate"). Empty => dashboard OPEN — local only.
APP_URL=""                # public base URL, e.g. https://your-app.up.railway.app (Google OAuth redirect base). On Railway: https://${{RAILWAY_PUBLIC_DOMAIN}}
ALLOWED_EMAILS=""         # comma-separated Google emails allowed to sign in

# Google OAuth client (Cloud Console → Credentials → Create OAuth client ID → Web application).
# Register these two, substituting your APP_URL (no trailing slash):
#   Authorized redirect URI:       <APP_URL>/api/auth/callback
#   Authorized JavaScript origin:  <APP_URL>
# e.g. with APP_URL=https://engram.up.railway.app →
#   redirect URI:  https://engram.up.railway.app/api/auth/callback
#   JS origin:     https://engram.up.railway.app
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""

# Where app state + vault clones live. On a host with a volume (Railway/Render/Fly) this
# MUST point at the mounted volume, or your data is ephemeral and wiped on redeploy.
# Left active so the deploy form auto-fills it with the right value. (Harmless in this
# file — the app never reads .env.example; only delete this line from a local .env.local
# copy if /data errors on your machine.)
ENGRAM_DATA_DIR="/data"

# ── Optional — configure in the dashboard → Settings (no redeploy) ────────────
# Listed for reference only. Uncomment to hard-set via env instead of the UI; a value
# saved in Settings overrides the env value either way.
#
# NEXT_PUBLIC_APP_NAME="Engram"            # display name (sidebar + browser tab)
# GIT_SYNC_ENABLED="true"                  # auto commit + push the active vault — ON by default; set "false" to opt out
# GIT_AUTHOR_NAME="Engram"
# GIT_AUTHOR_EMAIL="[email protected]"
# GITHUB_CLIENT_ID=""                      # "Connect GitHub" repo flow (URL+token path needs no OAuth app)
# GITHUB_CLIENT_SECRET=""                  # OAuth app "Authorization callback URL": <APP_URL>/api/github/callback
# Curator (Engram-runs-a-model): choose off / chat / full in Settings. These env vars are only a
# default before the operator picks a mode in the UI; HARNESS_ENABLED is the legacy boolean and
# still seeds "full" for existing deploys.
# HARNESS_ENABLED="false"                  # legacy: true => Curator defaults to "full" (brain_capture on)
# ANTHROPIC_API_KEY=""                     # required for any Curator mode; your notes are sent to Anthropic on it
# CAPTURE_MODEL="claude-haiku-4-5"         # brain_capture model; pick in Settings (default). Must be a supported id.
# MCP_TOKEN=""                             # one shared MCP key (full access); or create per-teammate tokens (read/write) on Connect
# ARCHIVE_FOLDERS="archive,archives,_archive,trash"  # folders whose notes are demoted in search + excluded by default
# ENGRAM_STATE_DIR="/data/.engram"         # override where token hashes persist (defaults to ENGRAM_DATA_DIR)
# VAULT_DIR="/data"                        # fallback local vault (workspaces are normally connected in the UI)
# AUTH_DISABLED="false"                    # single-user local mode: no Google auth, MCP open. NEVER true in production.
# ALLOWED_GITHUB_LOGINS=""                 # comma-separated GitHub usernames allowed to sign in (GitHub-only dashboard auth)
# VAULT_IGNORE="app,.git,node_modules,.next,.github,infra"  # directory names never treated as vault content

# ── Escape hatches (env only — no Settings equivalent) ───────────────────────
# Reach for these if the app won't finish booting. Git sync runs off the startup path and
# serialises its subprocesses; if a vault still wedges the boot, disable sync, start clean,
# and reconnect the workspace.
# ENGRAM_DISABLE_GIT_SYNC=""               # "1" to skip vault git sync entirely at boot
# ENGRAM_GIT_BOOT_DELAY_MS=""              # ms to wait before the first sync (default 20000)