Docs
Build with Stale

Self-hosting

Stale is one Next.js app and two databases. Run it on your laptop in a minute, or on Vercel in ten.

Run it locally

  1. Start FalkorDBDocker is the easy way.
    docker compose up -d # FalkorDB on :6379, its browser on :3001
  2. ConfigureCopy the example env file. The defaults work locally.
    cp .env.example .env
  3. Start the app
    npm install npm run dev # http://localhost:3000

Accounts are stored in data/stale.db (a SQLite file). Open /signup and you’re in. Optional: npm test runs the suite against a live FalkorDB, and npm run smoke runs a narrated end-to-end walkthrough.

Environment variables

# Memory graph FALKORDB_HOST=your-instance.falkordb.cloud FALKORDB_PORT=6379 FALKORDB_USERNAME= FALKORDB_PASSWORD= # Accounts and sessions (libSQL). Leave unset to use the file data/stale.db TURSO_DATABASE_URL=libsql://your-db-your-org.turso.io TURSO_AUTH_TOKEN= # Encrypts integration tokens at rest. Long, random, stable. STALE_SECRET= # Claim extraction (optional: without it a simpler rules engine is used) OPENAI_API_KEY= OPENAI_MODEL=gpt-4o # Billing (optional). Without these there are no plan limits. RAZORPAY_API_KEY=rzp_test_... RAZORPAY_SECRET= RAZORPAY_WEBHOOK_SECRET=
VariableNeeded?What it does
FALKORDB_*YesWhere the memory graph lives.
TURSO_DATABASE_URL, TURSO_AUTH_TOKENOn VercelWhere accounts live. Unset means a local file, which serverless hosts can’t keep.
STALE_SECRETIn productionEncryption key for stored integration tokens.
OPENAI_API_KEYRecommendedBetter claim extraction. Without it a rules engine runs.
RAZORPAY_API_KEY, RAZORPAY_SECRETFor paid plansTurns plans and limits on. Also accepted as RAZORPAY_KEY_ID / RAZORPAY_KEY_SECRET. Unset means unlimited.
RAZORPAY_WEBHOOK_SECRETFor paid plansOptional backup: verifies order.paid events sent to /api/hooks/razorpay.
STALE_DBNoPath of the local SQLite file (default data/stale.db).
STALE_AUTH=offNever in productionDev and tests only. Trusts a tenant header instead of login.

Deploy on Vercel

  1. Hosted FalkorDBCreate an instance on FalkorDB Cloud (or any server you control) and note its host, port, username and password.
  2. Hosted accounts DBCreate a database on Turso and note its URL and an auth token. Vercel’s filesystem is temporary, so this is what keeps logins alive.
  3. Import the repoIn Vercel choose Add New → Project and pick your fork.
  4. Add the variablesPaste the ones above, then deploy. Variables only apply to builds made after you add them.
  5. Check itOpen /api/v1/health. It should say FalkorDB is connected. Then try /signup.

Railway, Render, Fly or a VPS

Any host that runs a Node server works: build with npm run build, start with npm start, and set the same variables. If the host has a persistent disk you can skip Turso and keep the SQLite file on it by setting STALE_DB to a path on that disk.