Skip to content

Deploy

The hosted Felix is one Worker, apps/api, configured by apps/api/wrangler.jsonc. What a deployment can do follows from what it is given: each feature turns on when its binding and settings are present, and stays off, saying so, when they are not. This page is the map; the pages under Operate cover each part.

Page Covers
Sign-in and sessions Google and GitHub sign-in, roles, connections, the GitHub repository list, ending sessions and the audit log.
Scheduling and runs Runs that outlive their stream, schedules, signed triggers and the run.finished webhook.
Integrations GitHub, connected accounts, MCP servers and document search.
Models and embeddings The model provider, extra models, context windows and the run settings.
Workspaces and the skill library Each conversation’s files, and where skills live.
The thread sandbox A Linux machine per conversation.

apps/api/wrangler.jsonc has three environments. The default and workers-ai-sandbox declare the same bindings apart from AI and SANDBOX. workers-ai is the production environment: it also declares routes, the web app’s static assets, production variables and the Hyperdrive bindings.

Environment Local Bundle check Adds
default pnpm dev:worker pnpm build:worker No model binding and no sandbox. Conversations work with any FELIX_PROVIDER other than Workers AI, given its credentials; without them, /health reports model: false.
workers-ai pnpm dev:worker:ai pnpm build:worker:ai The Workers AI binding AI, the SANDBOX Durable Object and its container with FELIX_SANDBOX=on, and the THREAD_INDEX, STORES and CONNECTIONS Hyperdrive bindings with FELIX_STORES=postgres. AI is remote, so a local run sends inference to your Cloudflare account. Building it builds the web app and the sandbox image, so Docker must be running.
workers-ai-sandbox pnpm dev:worker:sandbox pnpm build:worker:sandbox For local development: the default environment plus AI, and the SANDBOX Durable Object and its container with FELIX_SANDBOX=on. Building it builds the sandbox image, so Docker must be running.

The build:worker* scripts are dry runs: they bundle the Worker and deploy nothing. To deploy, run Wrangler yourself with the environment you chose, after creating the resources below and setting the secrets:

pnpm exec wrangler deploy --config apps/api/wrangler.jsonc --env workers-ai

The workers-ai environment also serves the web app, from apps/web/dist, on the same origin: requests under /api/ are answered as the API (/api/v1/threads is /v1/threads), /v1/*, /health, /ready and /previews/* reach it directly, and every other path is the app. Build the app before deploying; pnpm deploy:worker:ai builds it and deploys, and pnpm deploy:docs does the same for this site.

Every environment declares these, apart from AI and SANDBOX (see above), OUTPUTS and AI_SEARCH, which none declares, and THREAD_INDEX, STORES and CONNECTIONS, which only workers-ai declares. Leaving one out turns off what it carries; nothing else changes. Most of them need FELIX_API_TOKEN and THREADS as well, since they belong to hosted threads.

Binding Kind Switches on /health
THREADS Durable Object (ThreadDatabase) Hosted threads and approvals, and, unless FELIX_STORES is postgres, the stores agents, evals, people, memories, connections and the GitHub list live in. Without it, only stateless runs. threads
RUNS Durable Object (ThreadRuns) Runs that keep going when their client disconnects, rejoining and stopping, schedules and triggers, and eval runs. runs
TELEMETRY Durable Object (TelemetryDatabase) The deployment’s trace store, read with /v1/traces and /v1/metrics; with OTEL_EXPORTER_OTLP_METRICS_ENDPOINT set, it also sends runs’ metrics to that OpenTelemetry backend. See Observability. telemetry
FELIX_WORKFLOWS Workflows (FelixWorkflow) Workflows and their durable runs. See Workflows. workflows
FELIX_BACKUPS Workflows (FelixBackup) Backups, their verifications and restores, on the 17 3 * * * schedule once FELIX_BACKUP is on. See Backups.
AI Workers AI The Workers AI provider. model
IMAGES R2 bucket felix-images Image uploads, and images tools return.
SKILLS R2 bucket felix-skills The hosted skill library. skills
WORKSPACES R2 bucket felix-workspaces Each conversation’s workspace and the file tools. workspace
OUTPUTS R2 bucket, such as felix-outputs Tool outputs longer than 2000 lines or 50 KB, kept whole: the conversation keeps the first lines (the last, for a command), the model reads on with read_output, and the web app’s Show full output reads the rest. Unbound, a long output is cut to the same window and the rest is dropped, with a note saying so. Not declared in the shipped wrangler.jsonc: create the bucket and add it to turn this on.
SANDBOX Durable Object (ThreadSandbox) and container A Linux sandbox per conversation and the shell tools. sandbox
BROWSER Browser Run The fetch_url tool. Once a conversation has read private data (a repository, the workspace, documents, memory, or any tool other than the web, plans and to-dos), it opens only an address the person wrote in their message.
LOADER Worker Loader The run_script tool, and skill scripts.
RATE_LIMITER Rate limiting The API rate limit. See Auth.
AI_SEARCH AI Search namespace The deployment’s documents and search_documents. Not declared in the shipped file; add it to use documents. See Integrations. documents
IMAGE_TRANSFORM Images Optional: fits images within 2000×2000 pixels and 4.5 MB before they are stored: uploads, and images tools read or generate. Also gives runs transform_image, which resizes, crops, rotates, flips, takes out the background of, or converts a stored image into a new one in the person’s Files. Declared in the shipped file; Cloudflare Images bills each unique transformation. Remove it to store images as they come.
THREAD_INDEX Hyperdrive, in front of a Postgres database The thread index, when FELIX_THREAD_INDEX is write or read. Declared in the production environment only. See Thread index.
STORES Hyperdrive, in front of a Postgres database With FELIX_STORES=postgres, where people, memories, connections, skills and the other stores that are not threads are kept. Declared in the production environment only. See Stores in Postgres.
CONNECTIONS Hyperdrive, to the same database as a role that reaches only felix_connections Optional, with FELIX_STORES=postgres: the sealed OAuth grants are reached through it, and STORES (then a role without that table) never reads them. Unbound, STORES reaches them too.

The Durable Object classes are created by the file’s migrations (v1 to v4), in every environment. Create the R2 buckets once before the first deploy:

pnpm exec wrangler r2 bucket create felix-images
pnpm exec wrangler r2 bucket create felix-skills
pnpm exec wrangler r2 bucket create felix-workspaces

Settings are read from the Worker’s environment, as secrets or as plain variables. Keep these as secrets:

Secret For
FELIX_API_TOKEN The operator token clients and automation send. Nearly every hosted feature needs it.
FELIX_ANTHROPIC_API_KEY The Anthropic provider.
FELIX_MCP_SERVERS Hosted MCP servers, and any secret a server’s headers name as ${NAME}. See MCP.
FELIX_SIGNING_SECRET Signed triggers and completion webhooks.
FELIX_AUTH_KEY, FELIX_GOOGLE_CLIENT_SECRET, FELIX_GITHUB_CLIENT_SECRET Sign-in and connections.
GITHUB_TOKEN Optional: a higher GitHub rate limit for skill imports.
FELIX_BACKUP_KEY, FELIX_BACKUP_PREVIOUS_KEYS The key backups are encrypted with, and earlier keys that still read older backups. See Backups.
FELIX_BACKUP_ACCESS_KEY_ID, FELIX_BACKUP_SECRET_ACCESS_KEY The backup destination’s S3 credentials.

Set each one for the environment you deploy:

pnpm exec wrangler secret put FELIX_API_TOKEN --config apps/api/wrangler.jsonc --env workers-ai

The other settings (the model, the sign-in allowlists, the sandbox limits and so on) are listed on the page for their feature. A setting that does not parse turns its feature off rather than running with a value nobody chose: a run request answers 503 model_not_configured, the sandbox stays off and says why in the Worker’s log, and a malformed sign-in setting fails the request it is read on.

Setting Does
FELIX_ALLOW_BYPASS on lets an admin put a thread in bypass mode, which skips the deployment’s approval rules (never the built-in one on GitHub writes). Off by default.
FELIX_MODELS More models a request may choose, with their facts. A model’s pricing (US dollars per million tokens, such as "pricing": {"input": 0.6, "output": 2.2}) makes each run on it record an estimated cost. See Models.
FELIX_DELEGATE on gives runs the delegate tool. See Agents.
FELIX_CODEMODE What run_script scripts may call (needs LOADER): off (the default) nothing, so scripts only compute; on the run’s server tools, each call checked as if the model made it; only the same, with those tools offered to the model only through scripts. Another value leaves conversations unconfigured. See Agents.
FELIX_TRACING on also sends each run’s spans to Workers tracing. Off by default.
FELIX_RESUME_RUNS on continues a run a restart cut off, from what its thread saved. Off by default, which leaves the thread interrupted. Needs RUNS. See Scheduling and runs.
FELIX_SKILL_PUBLISH_MIN_QUALITY, FELIX_SKILL_PUBLISH_REQUIRE_EVAL, FELIX_SKILL_PUBLISH_MIN_EVAL_UPLIFT The skill library’s publish floor: the lowest quality score a publish takes (0 to 100), whether a version needs a succeeded evaluation (on or off), and the lowest uplift that evaluation may show (-100 to 100). Unset, there is no gate. Admins can raise the floor for the library, never lower it. A value that does not parse refuses every publish until it is fixed. See the publish policy.
FELIX_RUN_SOCKET on gives each hosted thread a run socket, a WebSocket that sends prompts, steers, stops and approval decisions and carries the run’s events. Off by default. Needs RUNS. See Scheduling and runs.
FELIX_THREAD_FEED Each hosted thread’s change feed, a WebSocket that tells the web app and other clients when the thread changes, so an open conversation updates on its own. On wherever RUNS is bound; off turns it off. See Scheduling and runs.
FELIX_WEBHOOK_URL Where scheduled and triggered runs report that they finished. See Scheduling and runs.
FELIX_THREAD_STORAGE shared (the default) or per-thread: where hosted threads are kept. See Thread storage. Any other value fails every request until it is fixed.
FELIX_THREAD_INDEX off (the default), write or read: keep a Postgres index of threads for lists, search and account export. Needs the THREAD_INDEX Hyperdrive binding. See Thread index. Any other value turns it off.
FELIX_STORES durable (the default) or postgres: where the stores that are not threads are kept. Needs the STORES Hyperdrive binding for postgres. See Stores in Postgres. Any other value, or postgres without what it needs, fails every request until it is fixed.
FELIX_DATABASE_JURISDICTION eu, us or fedramp: where the Postgres database behind THREAD_INDEX and STORES keeps its data. Needed for either when FELIX_JURISDICTION is set, and must match it. See Thread index and Stores in Postgres.
FELIX_JURISDICTION eu, us or fedramp: where stored data is kept. Unset by default. See Data location. Any other value fails every request until it is fixed.
FELIX_BACKUP off (the default), manual or on. See Backups.
FELIX_BACKUP_ENDPOINT, FELIX_BACKUP_BUCKET, FELIX_BACKUP_REGION, FELIX_BACKUP_PREFIX, FELIX_BACKUP_KEEP Where backups go, and how many to keep. See Backups.

Hosted threads are kept in the THREADS Durable Object namespace. FELIX_THREAD_STORAGE decides how:

  • shared (the default): every thread is in one instance, named operator.
  • per-thread: each thread is in its own instance, with its log, runs, steers, compaction records, workspace file rows and ratings. The operator instance keeps a summary row per thread, which thread lists, the waiting-on-a-question list and search read, and decides when a workspace blob or an uploaded image is no longer used by any thread.

Set it as a plain variable, for example in the environment’s vars in apps/api/wrangler.jsonc:

"vars": { "FELIX_THREAD_STORAGE": "per-thread" }

No Durable Object migration is needed: both modes use the same class.

Moving existing threads. With per-thread set, a thread still kept in operator moves to its own instance the first time anything reads or changes it. The move copies the thread page by page; while it runs, the old copy refuses changes with 503 thread_moving, which a client can retry, and a request that reaches the thread’s own instance waits for the move to finish. A move that stops part way resumes where it stopped on the next access. To move threads without waiting for traffic, call the sweep with the operator token until more is false:

curl -X POST "$FELIX_API/v1/admin/thread-storage/migrate" \
-H "Authorization: Bearer $FELIX_API_TOKEN" \
-H "content-type: application/json" -d '{"limit": 50}'
# {"migrated":50,"failed":[],"more":true}

A thread in failed is moved by a later sweep or its next access.

Turning it back to shared. Threads that moved stay in their own instances and are still read, changed, listed, searched, forked and deleted there; threads created while the setting is shared are kept in operator.

What stays shared. Approvals and the skill library stay in operator, and telemetry, people, agent, evaluation and workflow records stay where they are, whatever the setting. Under per-thread, list, search and the asking list read operator’s summary rows, which each thread’s instance updates after every change that shows in them: a title, status, question, agent or mode at once, and a running thread’s message count and last-updated time within about two seconds of its latest message. A summary update that fails is retried automatically, so a list can briefly show an older title or status. Message-text search reads up to six thread instances at a time, within the same 16 MiB read budget per search request.

Lists, search and account export can read a Postgres index of threads instead of reading every thread in the deployment. Each thread’s own storage stays authoritative: the instance holding a thread records each change and sends it to the index about a second later, retrying while the database cannot be reached. A list or search through the index is one query scoped to the caller.

FELIX_THREAD_INDEX switches it:

Value What happens
off (default) No index. Nothing is recorded or read.
write Thread changes are sent to the index; lists, search and export still read the threads.
read As write, and lists, search and account export read the index.

Deleting an account always reads every thread, so it never misses one the index has not caught up with. The index is off, with a message in the logs, when THREAD_INDEX is not bound.

Data location. With FELIX_JURISDICTION set, the index stays off until FELIX_DATABASE_JURISDICTION names the same jurisdiction. Felix cannot see where a Postgres database keeps its data, so this is your statement that the database you bound is in that jurisdiction; choose its region accordingly.

Backups and restores. The index is a copy of what the threads hold, so backups do not include it. Threads a restore brings back are sent to the index as they are written. A restore point returns one instance to an earlier moment; with the index on, that instance then sends the index what it holds again, removing threads it no longer has (reindexed: true in the answer). Restore a whole deployment into an empty index database, so it holds no threads from before.

Setting it up. Create a Postgres database, a role that can read and write its tables, and a Hyperdrive configuration for that role with caching off, so a list sees a change made moments before:

pnpm exec wrangler hyperdrive create felix-index \
--connection-string="postgres://ROLE:PASSWORD@HOST:5432/postgres" \
--caching-disabled --sslmode verify-full --ca-certificate-id <CA_ID> \
--origin-connection-limit 10

Keep --origin-connection-limit below what the database has free: its max_connections, less the connections reserved for superusers and those its provider’s own processes hold. Hyperdrive keeps that many open, so a limit at or above it leaves no connection for anyone else, such as a migration.

Create the table with a role that may (migrateThreadIndex in @felix/storage/postgres-thread-index, run again after each release as schema migrations says), bind the configuration as THREAD_INDEX, and set FELIX_THREAD_INDEX=write. The index starts empty and holds a thread from its first change after that. To send it the threads kept from before, re-index once (repeat with next while the answer has one, under per-thread storage), then switch to read:

curl -X POST "$FELIX_API/v1/admin/thread-index/reindex" \
-H "Authorization: Bearer $FELIX_API_TOKEN"

Under read, a thread the index does not hold yet is not listed, searched or exported, though it still opens by its address.

Everything a deployment keeps that is not a thread can live in Postgres instead of Durable Objects: the people registry and audit log, the agent’s settings, skills, evals, the GitHub list, workflows and their runs, and each person’s memories, suggestions, preferences, connections, push subscriptions and token use. Threads, their workspaces and approvals stay in Durable Objects, beside the runs that write them.

FELIX_STORES Where those stores are kept
durable (default) One THREADS Durable Object each, as threads are.
postgres The Postgres database STORES reaches. People and the audit log, token use, push subscriptions, connections, memories, starter suggestions, account preferences, the agent’s settings, the GitHub list, workflows, evals and the skill library are tables of their own (felix_people, felix_audit, felix_usage, felix_push_*, felix_connections, felix_memories, felix_suggestions*, felix_preferences, felix_agent_settings, felix_github_*, felix_workflow*, felix_eval_*, felix_skill*).

Switching moves nothing: each place keeps what was written to it, and a deployment reads only the one it is set to.

Setting it up.

  1. Create the tables with a role that may: each store’s migrate… function in its @felix/storage/postgres-* module (migratePeople, migrateUsage, migrateConnections, migratePush, migrateMemory, migrateAgents, migrateGithub, migrateWorkflows, migrateEvals, migrateSkills). Each is safe to run again, and a new release that adds a store adds its function here. Run them again after each release, before deploying it, as schema migrations says.
  2. Make a role for the Worker and grant it each table to read and write. Grant tables explicitly rather than through a read-everything role such as pg_read_all_data, so the next step can keep one table from it.
  3. Bind a Hyperdrive configuration for that role, with caching off, as STORES, and set FELIX_STORES=postgres. STORES can be the same configuration as THREAD_INDEX.

Keeping sealed grants apart. To keep connections’ tokens from the role every other store uses, leave felix_connections out of that role’s grants, and bind CONNECTIONS to a second configuration whose role is granted only that table (grantConnections in @felix/storage/postgres-connections). Unbound, STORES reaches connections too.

Connections to the database. Each Hyperdrive configuration keeps up to its --origin-connection-limit open. Keep the sum across THREAD_INDEX, STORES (once, if it shares the index’s configuration) and CONNECTIONS below what the database has free, as for the thread index.

When a store is not in tables. Under postgres, no store is kept as a Durable Object: the names backups and account erase still list answer as empty, a restore into one is refused (409 stores_in_tables), and anything else fails (500 store_not_in_tables) rather than keep data where nothing backs it up.

Backups and recovery. Backups copy each group of tables as one instance in a snapshot (table:people, table:usage, table:push, table:connections, table:settings, table:workflows, table:skills, table:evals, table:memory) and restore them into empty tables. A snapshot taken under durable keeps the stores in their Durable Objects instead; restoring it into a deployment set to postgres is refused for them, since nothing would read them there. Restore points (POST /v1/admin/restore-points) answer 501 restore_points_unavailable for these stores: recovering the database to an earlier moment is its provider’s, so check what backups and point-in-time recovery your plan includes.

Availability. While the database is unreachable, sign-in, lists, connections and memory fail, though threads and their runs, kept in Durable Objects, are untouched. A single-node database is fine for a small deployment with backups on; where people depend on the deployment, choose a plan with a standby that takes over (high availability). Felix needs no change for either.

Under FELIX_JURISDICTION, FELIX_DATABASE_JURISDICTION must name the same jurisdiction.

Each migrate… function (the stores’, and migrateThreadIndex) applies its module’s schema changes in order, each once, and records each in felix_schema_migrations: the module, the step’s number and name, and when it was applied. Running one again applies only the steps not recorded yet, each in its own transaction, and several run at once apply each step once. A database made before that table existed records its first step without changing anything, then takes the later ones.

The Worker never changes the schema. When you upgrade, run the functions again with the role that may before deploying the release, since its queries can need what a new step adds, and grant the stores’ role any table a step creates. On Node the server runs them itself on start.

Migrations go forward only: no step is undone. Going back to an earlier schema is restoring a backup into a database made by that release.

FELIX_JURISDICTION keeps the deployment’s storage in one jurisdiction: eu (the European Union), us (the United States) or fedramp (FedRAMP-Moderate data centers). It applies to everything kept in Durable Objects: threads, approvals, agents, workflows and their run records, people and the audit log, memories, connections, push subscriptions, run state, telemetry and sandbox state. A Postgres database (the thread index and stores in Postgres) is yours to place: create it in a region inside the jurisdiction and declare it with FELIX_DATABASE_JURISDICTION.

Set the rest in apps/api/wrangler.jsonc, where the environment declares them:

  • R2 buckets (IMAGES, SKILLS, WORKSPACES): create each bucket in the jurisdiction (wrangler r2 bucket create felix-images --jurisdiction eu), and add "jurisdiction": "eu" to its entry in r2_buckets.
  • Workflows (FELIX_WORKFLOWS, FELIX_BACKUPS): add "jurisdiction": "eu" to each entry in workflows.
  • The sandbox (SANDBOX): add "constraints": { "jurisdiction": "eu" } to its entry in containers.
  • Backups: choose a destination in the same region.

The setting controls where data is kept, not where requests are answered or where models run. A model provider, AI Search and Browser Run process what a run sends them wherever they run; choose them and their regions to match. Durable Object ids may appear in Cloudflare’s logs outside the jurisdiction.

A new deployment keeps its data in the jurisdiction from the first request.

An existing deployment keeps its data where it is: data kept before the setting is outside the jurisdiction and is not moved. Until the jurisdiction’s storage is in use, every request except /health, the backup routes and /v1/admin/jurisdiction answers 409 jurisdiction_data_elsewhere. To move the data:

  1. With the setting still unset, back up: POST /v1/admin/backups (see Backups), and wait for the run to complete.
  2. Set FELIX_JURISDICTION and deploy.
  3. Restore the backup: POST /v1/admin/backups/<snapshot>/restore. When it completes, the deployment answers again, from the jurisdiction.

To start over in the jurisdiction without the existing data instead:

curl -X POST "$FELIX_API/v1/admin/jurisdiction" \
-H "Authorization: Bearer $FELIX_API_TOKEN" \
-H "content-type: application/json" -d '{"confirm": "start empty"}'

GET /v1/admin/jurisdiction says whether the jurisdiction’s storage is in use. Nothing is deleted either way: unsetting FELIX_JURISDICTION shows the data kept outside it again.

A deployment can back up everything it keeps to an S3-compatible object store. Backups are off until you turn them on.

What a backup holds. Threads and their workspaces, approvals, agents, workflows and their runs, skills, evals, people and the audit log, each person’s memories, connections, push subscriptions and token use (as groups of tables under FELIX_STORES=postgres), and the files in the IMAGES, SKILLS and WORKSPACES buckets. Telemetry, the state of runs in progress, the OUTPUTS bucket (whole copies of long tool outputs, whose start the conversation keeps) and the thread index, a copy of the threads, are not backed up.

Encryption. Every file is encrypted in the Worker with AES-256-GCM before it is sent, so the destination only ever holds ciphertext. File names reveal nothing either: they are derived from the key, not from thread ids or file names. Without the key, a backup cannot be read or restored, so keep a copy of the key somewhere other than the deployment.

Setting it up.

  1. Make a bucket for backups at the destination, and credentials that can read, write, list and delete in it. Any S3-compatible store works, for example:

    Store FELIX_BACKUP_ENDPOINT FELIX_BACKUP_REGION
    Cloudflare R2 https://<account id>.r2.cloudflarestorage.com auto (the default)
    Amazon S3 https://s3.<region>.amazonaws.com the bucket’s region
    Google Cloud Storage (HMAC keys) https://storage.googleapis.com auto
  2. Make a key: 32 random bytes in base64.

    openssl rand -base64 32
  3. Set the secrets (FELIX_BACKUP_KEY, FELIX_BACKUP_ACCESS_KEY_ID, FELIX_BACKUP_SECRET_ACCESS_KEY) and the settings, for example:

    "vars": {
    "FELIX_BACKUP": "on",
    "FELIX_BACKUP_ENDPOINT": "https://s3.eu-west-1.amazonaws.com",
    "FELIX_BACKUP_REGION": "eu-west-1",
    "FELIX_BACKUP_BUCKET": "acme-felix-backups"
    }
Setting Does
FELIX_BACKUP off (the default): no backups. manual: you start backups, checks and restores with the routes below. on: the same, plus a backup every day at 03:17 UTC.
FELIX_BACKUP_ENDPOINT The store’s https address, without the bucket.
FELIX_BACKUP_BUCKET The bucket backups go in.
FELIX_BACKUP_REGION The bucket’s region; auto by default.
FELIX_BACKUP_PREFIX Where in the bucket this deployment’s backups go; felix by default. Give each deployment its own.
FELIX_BACKUP_KEEP How many backups to keep, 1–365; 14 by default. Older ones are deleted after each backup.

With FELIX_BACKUP set to manual or on, a missing or malformed setting stops backups and the backup routes say which setting is wrong (503 backup_misconfigured).

Running and checking backups. These routes take the operator token:

# Back up now; answers {"run": "backup-…"}
curl -X POST "$FELIX_API/v1/admin/backups" -H "Authorization: Bearer $FELIX_API_TOKEN"
# How it went: status, and when complete, what it holds
curl "$FELIX_API/v1/admin/backups/runs/backup-…" -H "Authorization: Bearer $FELIX_API_TOKEN"
# The backups there are, newest first
curl "$FELIX_API/v1/admin/backups" -H "Authorization: Bearer $FELIX_API_TOKEN"
# Read every file of one back and check it
curl -X POST "$FELIX_API/v1/admin/backups/20261117t031700z-1a2b3c/verify" \
-H "Authorization: Bearer $FELIX_API_TOKEN"

A backup copies a bucket’s file only when it changed since an earlier backup, so later backups are smaller. A backup is read a part at a time while the deployment keeps running, so it is not one exact moment: something that changed while it ran may be there in part. Run it when the deployment is quiet, or use restore points (below) for an exact moment of one instance. A backup that stops part way resumes where it stopped. Until it finishes, it is not listed, and it cannot be restored.

Restoring. A backup is restored into a deployment that holds no data yet: a new deployment with the same FELIX_THREAD_STORAGE, the same backup settings, and the backup’s key as FELIX_BACKUP_KEY or in FELIX_BACKUP_PREVIOUS_KEYS. Set FELIX_BACKUP to manual there until the restore is done, then name the backup twice:

curl -X POST "$FELIX_API/v1/admin/backups/20261117t031700z-1a2b3c/restore" \
-H "Authorization: Bearer $FELIX_API_TOKEN" \
-H "content-type: application/json" -d '{"confirm": "20261117t031700z-1a2b3c"}'

If any storage the backup would fill already holds data, the restore stops before writing anything. A file already in a bucket is left as it is.

Changing the key. Put the new key in FELIX_BACKUP_KEY, and the old one in FELIX_BACKUP_PREVIOUS_KEYS (comma-separated for several), so older backups can still be checked and restored. The next backup copies every bucket file again under the new key. Remove an old key once no kept backup uses it.

Undoing a mistake in place. Separately from backups, each storage instance can return to how it was at any moment in the last 30 days. Name the instance (operator, workflows, agent, people, skills, evals, github, memory:<person>, connections:<person>, push:<person>, usage:<person> or thread:<id>) and the time:

curl -X POST "$FELIX_API/v1/admin/restore-points" \
-H "Authorization: Bearer $FELIX_API_TOKEN" \
-H "content-type: application/json" \
-d '{"instance": "agent", "at": "2026-11-16T09:00:00Z"}'
# {"instance":"agent","bookmark":"…","undo":"…"}

The instance restarts as it was then. To undo the restore, send {"instance", "bookmark"} with the undo it answered. This works whatever FELIX_BACKUP is, but not in local development.

GET /health needs no token and is never rate limited. It always answers status: "ok" and model, true when a model is configured. Every other field is present, as true, only where its feature is on. Older names remain accepted: /health still sends chat, with the same value as model, for clients released before model, and the run routes still answer POST /v1/chat/stream as POST /v1/runs/stream. An unconfigured model is now refused with model_not_configured, which was chat_not_configured.

Field On when
threads THREADS and FELIX_API_TOKEN.
runs Threads and RUNS.
runSocket Runs and FELIX_RUN_SOCKET=on.
feed Runs, with FELIX_THREAD_FEED unset or on.
telemetry TELEMETRY and the token.
auth Sign-in is configured and threads are on.
memory Sign-in and threads.
connections Sign-in and threads, and sign-in offers a connection: GitHub wherever GitHub sign-in is on, Google with FELIX_GOOGLE_CONNECT_SCOPES.
github GitHub connections are offered, with threads.
agents Threads and model.
evals Threads; running them also needs runs.
workflows Threads and FELIX_WORKFLOWS.
skills Threads and SKILLS.
workspace Threads and WORKSPACES.
sandbox Threads, SANDBOX, and sandbox settings that parse.
documents AI_SEARCH and the token.
files Threads and IMAGES.
plans Threads and model.
push Sign-in and threads, with FELIX_PUSH_VAPID_PUBLIC_KEY, FELIX_PUSH_VAPID_PRIVATE_KEY and FELIX_PUSH_SUBJECT set and valid.
transcription Threads, AI, and a FELIX_TRANSCRIPTION_MODEL it can run.

It reports configuration, not whether a provider or store is reachable right now. The web app and the terminal read it to decide which pages and tools to show.

GET /ready is for an uptime monitor: it needs no token and tries storage, waiting at most three seconds. It answers 200 with { "status": "ready", "checks": { "storage": "ok" } }, or 503 with status: "unavailable" and storage: "failed". Each Worker instance tries at most once every ten seconds and repeats its last answer in between. It does not call a model.

The hosted zone’s own settings, such as TLS, HSTS, DNS records, firewall and redirect rules, are kept as code in .agents/skills/felix-api/scripts/zone-desired.ts. pnpm zone check compares the live zone with it and lists each difference without changing anything. pnpm zone apply --yes changes only what differs, and prints what needs doing by hand, such as a DS record to add at the registrar.

Both need CLOUDFLARE_API_TOKEN, a token with read access to the zone’s settings, DNS, WAF, Page Shield and Workers scripts (and edit access to apply). FELIX_ZONE names another zone.

Area Setting
TLS HTTPS only; TLS 1.2 at least; HSTS for a year, subdomains included.
DNS DNSSEC; CAA allowing only the certificate authorities Cloudflare uses.
Caching Browsers follow each response’s own Cache-Control; Smart Tiered Cache.
Firewall Blocks methods the API does not use, /v1/admin/* without a bearer token, and scanner paths.
Rate limit Sign-in (/v1/auth/*, /api/v1/auth/*): 20 requests per 10 seconds per client address.
Redirects www to the apex.
Scripts Page Shield watches the scripts the pages load.

The Workers’ logs and traces are set in their Wrangler configuration and go live with a deploy; pnpm zone check reports a Worker that has not been deployed with them yet.

The API and the web app run as two processes.

  1. Copy apps/api/.dev.vars.example to apps/api/.dev.vars and fill it in. For an environment, Wrangler reads .dev.vars.<environment> instead when it exists, such as .dev.vars.workers-ai. The file holds secrets and settings alike; keep it out of version control.
  2. Start the API in the environment you want: pnpm dev:worker, pnpm dev:worker:ai or pnpm dev:worker:sandbox. It listens on http://127.0.0.1:8787. Durable Objects and R2 run locally; the AI binding is remote.
  3. Start the web app with pnpm dev:web. Its development server forwards /api/* to FELIX_API_ORIGIN (http://127.0.0.1:8787 by default) with /api removed. With FELIX_API_TOKEN in the web app’s environment (for example apps/web/.env.local), it adds the token to requests that carry none, so the browser never holds it; it refuses writes from other sites with 403 cross_site_request.

pnpm dev:docs serves this site. See Getting started for a first run.

pnpm serve runs the same API as a Node process, with its storage in SQLite or Postgres instead of Durable Objects. It reads the settings the Worker reads, from the environment, plus these:

Setting Meaning
FELIX_STORAGE Required. sqlite:<path> for a SQLite file (sqlite::memory: keeps nothing), or a postgres:// or postgresql:// connection URL. The tables are created, and any schema migrations a release adds applied, on start.
PORT, HOST Where it listens: 8787 on 127.0.0.1 by default.
FELIX_WEB_ROOT The web app’s built files (apps/web/dist). The process then serves the app on the same origin: /api/*, /v1/*, /health and /ready reach the API, and other paths are the app, unknown ones answered by index.html.
FELIX_CLOUDFLARE_ACCOUNT_ID, FELIX_CLOUDFLARE_API_TOKEN Workers AI over Cloudflare’s REST API, since there is no AI binding outside a Worker. Any other FELIX_PROVIDER works as it does on the Worker.
FELIX_STORES postgres keeps people, memories, connections, skills and the other stores that are not threads in tables of their own in the FELIX_STORAGE database, which must then be Postgres, as stores in Postgres does on a Worker; the tables are created on start. durable (the default) keeps them beside the threads.
FELIX_THREAD_INDEX_URL With FELIX_THREAD_INDEX set to write or read, the postgres:// database the thread index is kept in. Without it, the index is kept in the FELIX_STORAGE database, which must then be Postgres; the process does not start otherwise. Its table is created on start.

Runs execute inside the request that starts them. Features that need a Cloudflare binding stay off: Workflows, the sandbox, run objects (FELIX_RUN_SOCKET, FELIX_RESUME_RUNS), workspaces, the skill library and images (R2), document search (AI Search), and Durable Object restore points. FELIX_JURISDICTION is refused: on Node, data is kept wherever the database is. SQLite is opened in WAL mode with full sync, so a write that returned is on disk.

compose.yaml at the repository’s root runs Felix and a Postgres database for it: the image (Dockerfile) builds the web app and serves it and the API from one process on port 8787, with every store in Postgres tables (FELIX_STORES=postgres) and lists and search from the thread index (FELIX_THREAD_INDEX=read).

  1. Copy .env.example to .env and fill it in: FELIX_POSTGRES_PASSWORD and FELIX_API_TOKEN (each openssl rand -base64 32), and a model, such as Workers AI with FELIX_CLOUDFLARE_ACCOUNT_ID and FELIX_CLOUDFLARE_API_TOKEN. Any other setting in this guide can go there too.

  2. Start it:

    docker compose up --build -d
  3. Open http://localhost:8787 (FELIX_PORT changes the port).

The database is kept in the postgres volume and is not reachable from outside the stack; Felix listens on this machine only. To serve others, put a proxy that terminates TLS in front of it and list its origin in FELIX_AUTH_ORIGINS. Back the volume up, or the database with pg_dump: the backups above need a Worker.