Valise

Self-host

Run your own case

Valise runs on one Cloudflare account: a Worker with D1, R2, KV, a Durable Object and a Workflow. A fork, a setup script and Workers Builds take it from an empty account to a deployed instance.

  • Node 22 or later.
  • A Cloudflare account with R2 enabled. Cloudflare may ask for billing details to enable R2.
  • A registered workers.dev subdomain on that account.
  • The Workers Paid plan for the daily backup, which runs as a Workflow. On the free plan the backup fails and the workbench says so.

Workers, D1, KV and R2 have their own plan limits and charges, billed by Cloudflare to your account. Lexical search avoids inference charges, not hosting costs.

  1. Fork and prepare. In your fork:
    npm ci
    npx wrangler login
    scripts/first-deploy.sh
    The script asks for your account ID, an app name and a search backend, shows what it will create and waits for you to type setup. It creates four resources for this installation: a D1 database, an R2 bucket for bundles and files, a KV namespace for OAuth state, and an R2 bucket for backups whose snapshots are retained for 30 days by Bucket Lock. It writes wrangler.self-host.jsonc. If it stops partway, rerun it; it finds what it already created by name.
  2. Choose search. Lexical is the default and needs nothing else.
    VALISE_RERANKNeedsWhere query and candidate text go
    lexicalNothingD1 only; no inference request
    clefWorkers AI bindingCloudflare Workers AI, at most 50 lexical candidates
    jevTYPESAFE_API_KEYTypeSafe's API, at most 50 lexical candidates
    If a reranking provider fails, search returns the lexical results.
  3. Set secrets. Create the Worker in the dashboard and add VALISE_ADMIN_PASSWORD, SESSION_SECRET and TOKEN_PEPPER under Settings. The administrator password works without Google or an email provider; owner-only use needs neither.
  4. Initialize the new database.
    npx wrangler d1 migrations apply DB --remote --config wrangler.self-host.jsonc
  5. Deploy from main. Connect the Worker to your fork in Workers Builds. The build runs the checks and builds; the deploy script applies pending migrations, then deploys. Migrations that only add things apply on deploy; one that drops or rewrites stops the build until a person runs it.
    Build:  npm run verify:ci && VALISE_CONFIG=wrangler.self-host.jsonc npm run build
    Deploy: VALISE_CONFIG=wrangler.self-host.jsonc VALISE_ORIGIN=https://<app>.<subdomain>.workers.dev ./scripts/deploy.sh
  6. Check it.
    scripts/smoke.sh https://<app>.<subdomain>.workers.dev
    Then sign in at /login, connect a client to your /mcp URL, save a test memory and fetch it from another client.

Setup asks whether to run background jobs every minute, on by default. They process Library files and fetch bookmarks on Workers AI, billed to your account, with bookmark fetching capped per owner per day by VALISE_SOURCE_DAILY_USD. With them off, capture, search, skills, memories and to-dos still work.

A daily Workflow inside the Worker writes the authoritative D1 rows and R2 originals to the locked backups bucket. scripts/backup.mjs captures and restores the same set from outside Cloudflare:

node scripts/backup.mjs capture /secure/valise-backups --config wrangler.self-host.jsonc --remote --keep 14
node scripts/backup.mjs status /secure/valise-backups --max-age-hours 26

The Library also has its own export, with original bytes, source revisions and relationships.

Self-hosting
The full procedure: resources, secrets, Google sign-in, email, limits and the deploy.
Backup and recovery
Scheduled backups, restore, the search rebuild and the local restore drill.
Library export
Per-account export and import with originals.
ADR-0008
Which migrations a deploy applies on its own.
README
Local development, Google sign-in and connecting clients.