.env.example
120 lines 7.8 KB
Raw
sha256:fbe982a22c05c6fe2e93876f250deecdb43d883f648b4e1810c7546caa9f17db docs: activate KNOWTATION- board identity and preserve livi… Human minor ⚠ breaking 5 days ago
1 # Copy to .env and set your keys. Do not commit .env.
2 # OPENAI_API_KEY=sk-your-key-here
3 #
4 # ── Two LLM lanes (different keys / providers) ─────────────────────────────
5 # 1) EMBEDDINGS = Meaning search + indexer (vectors). NOT Anthropic — use Ollama,
6 # OpenAI, Voyage, or DeepInfra. Set in config/local.yaml embedding: { provider, model } and/or:
7 # EMBEDDING_PROVIDER=ollama|openai|voyage|deepinfra EMBEDDING_MODEL=...
8 # Voyage (cloud, non-OpenAI): EMBEDDING_PROVIDER=voyage + VOYAGE_API_KEY
9 # DeepInfra (single-key with chat above; OpenAI-compatible API):
10 # EMBEDDING_PROVIDER=deepinfra + DEEPINFRA_API_KEY
11 # EMBEDDING_MODEL=BAAI/bge-large-en-v1.5 # default; 1024-dim
12 # Other options: Qwen/Qwen3-Embedding-8B (4096), intfloat/multilingual-e5-large-instruct (1024)
13 # NOTE: Switching embedding provider OR dimension requires a vault re-index.
14 # 2) CHAT = proposal Enrich / review hints / completeChat.
15 # Provider order (lib/llm-complete.mjs):
16 # a) KNOWTATION_CHAT_PROVIDER=deepinfra → DeepInfra (Qwen/Llama/Mistral) with
17 # OpenAI/Anthropic fallback if their keys are also set. Single OpenAI-compatible bill;
18 # same DEEPINFRA_API_KEY also works for OpenClaw orchestration (image gen, embeddings, TTS).
19 # b) KNOWTATION_CHAT_PROVIDER=openrouter → OpenRouter (BYO key, OpenAI-compatible).
20 # Requires OPENROUTER_API_KEY. NO fallback to a managed lane on failure: this is a
21 # "bring your own provider" lane (you pay OpenRouter directly; never metered against
22 # Knowtation packs), so an error surfaces instead of silently re-routing your note
23 # text to a metered provider. Explicit-only: adding OPENROUTER_API_KEY alone never
24 # changes the provider for an existing deploy. See
25 # docs/COMPANION-APP-MODEL-ROUTING-AND-ENRICHMENT-ARCHITECTURE.md §4/§6.
26 # c) KNOWTATION_CHAT_PROVIDER=openai|anthropic → lock to that provider (no fallback).
27 # d) Implicit DeepInfra: DEEPINFRA_API_KEY set AND no OpenAI/Anthropic key → DeepInfra.
28 # e) Default: OpenAI → Anthropic → Ollama (unchanged for existing deploys).
29 # KNOWTATION_CHAT_PREFER_ANTHROPIC=1 flips OpenAI/Anthropic order when both are set.
30 # ANTHROPIC_API_KEY=
31 # ANTHROPIC_CHAT_MODEL=claude-3-5-haiku-20241022
32 # KNOWTATION_CHAT_PREFER_ANTHROPIC=1
33 # DEEPINFRA_API_KEY=
34 # DEEPINFRA_CHAT_MODEL=Qwen/Qwen2.5-72B-Instruct # default; cheaper hint model: meta-llama/Meta-Llama-3.1-8B-Instruct
35 # KNOWTATION_CHAT_PROVIDER=deepinfra # explicit lock; omit for default OpenAI-first behavior
36 # OPENROUTER_API_KEY= # BYO key for KNOWTATION_CHAT_PROVIDER=openrouter
37 # OPENROUTER_CHAT_MODEL=openai/gpt-4o-mini # default; any OpenRouter model slug, e.g. anthropic/claude-3.5-haiku
38 # OPENROUTER_SITE_URL= # optional attribution → HTTP-Referer header
39 # OPENROUTER_APP_TITLE= # optional attribution → X-Title header
40 # VOYAGE_API_KEY= # when embedding.provider is voyage (see docs/setup.md)
41 # Hub (Phase 11): required for npm run hub (self-hosted). See docs/TWO-PATHS-HOSTED-AND-SELF-HOSTED.md#quick-start-self-hosted
42 # HUB_JWT_SECRET=your-long-random-secret
43 # KNOWTATION_VAULT_PATH=/absolute/path/to/vault (or set in config/local.yaml)
44 #
45 # Gateway → canister authentication (required for production).
46 # Set a strong random secret (64+ hex chars), then call admin_set_gateway_auth_secret on the canister.
47 # CANISTER_AUTH_SECRET=
48 #
49 # Full operator export (all users; hub canister must have secret set — see docs/OPERATOR-BACKUP.md)
50 # KNOWTATION_OPERATOR_EXPORT_URL=https://<hub-canister-id>.icp0.io
51 # KNOWTATION_OPERATOR_EXPORT_KEY=long-random-secret-matching-admin_set_operator_export_secret
52 # KNOWTATION_OPERATOR_EXPORT_DIR=./backups
53 #
54 # Optional: before `dfx deploy hub --network ic`, `npm run canister:release-prep` can export vault(s) to ./backups/
55 # (same script as `npm run canister:export-backup` and scheduled HTTP vault export — see docs/DEPLOY-HOSTED.md §6)
56 # KNOWTATION_CANISTER_BACKUP_USER_ID=google:123
57 # KNOWTATION_CANISTER_URL=https://<canister-id>.icp0.io
58 # KNOWTATION_CANISTER_BACKUP_URL= # alias for CANISTER_URL (e.g. CI secret name)
59 # KNOWTATION_CANISTER_BACKUP_VAULT_ID=default
60 # KNOWTATION_CANISTER_BACKUP_VAULT_IDS=default,second # comma-separated; overrides VAULT_ID when set
61 # KNOWTATION_CANISTER_BACKUP_DIR=./backups
62 # KNOWTATION_CANISTER_BACKUP_ENCRYPT_KEY_HEX= # 64 hex chars → AES-256-GCM .json.enc output
63 # KNOWTATION_CANISTER_BACKUP_S3_BUCKET=
64 # KNOWTATION_CANISTER_BACKUP_S3_PREFIX=knowtation-canister-backups/
65 # KNOWTATION_CANISTER_BACKUP_SKIP_S3=1 # local: skip S3 even if bucket set
66 # AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION=us-east-1
67 #
68 # CLI / curl / repo scripts (verify-hosted-hub-api, seed:*, `knowtation propose`) read KNOWTATION_HUB_URL,
69 # KNOWTATION_HUB_TOKEN, KNOWTATION_HUB_VAULT_ID — not *_LOCAL / *_HOSTED. If you use suffixed names in .env,
70 # after `source .env` run exports, e.g. for hosted:
71 # export KNOWTATION_HUB_URL="$KNOWTATION_HUB_URL_HOSTED"
72 # export KNOWTATION_HUB_TOKEN="$KNOWTATION_HUB_TOKEN_HOSTED"
73 # export KNOWTATION_HUB_VAULT_ID="$KNOWTATION_HUB_VAULT_ID_HOSTED"
74 #
75 # Operator human-lane smokes (laptop only — not Netlify/cron): one-time bootstrap:
76 # node scripts/hub-session-refresh.mjs --save-access-token '<hub_token from Local Storage>'
77 # Then `node scripts/hub-session-refresh.mjs` auto-renews (~/.config/knowtation/hub_refresh).
78 # Optional for legacy_session deploy probes only (copy from knowtation-gateway SESSION_SECRET):
79 # KNOWTATION_SESSION_SECRET=
80 # `node scripts/hub-session-refresh.mjs` rotates access JWT automatically (see script header).
81 # KNOWTATION_HUB_REFRESH_TOKEN_FILE=~/.config/knowtation/hub_refresh
82 # KNOWTATION_HUB_TOKEN_FILE=~/.config/knowtation/hub_session
83 #
84 # Optional proposal LLM (exact names; env locks Settings → Backup checkboxes when set to 1/0 or true/false):
85 # KNOWTATION_HUB_PROPOSAL_REVIEW_HINTS=1
86 # KNOWTATION_HUB_PROPOSAL_ENRICH=1
87 #
88 # AIR Improvement D: built-in attestation endpoint (hosted gateway).
89 # When set (32+ chars), the gateway auto-configures KNOWTATION_AIR_ENDPOINT to its own
90 # /api/v1/attest route. All hosted note writes are then attested (HMAC-signed, stored in
91 # Netlify Blobs). Verify any attestation via GET /api/v1/attest/:id.
92 # ATTESTATION_SECRET=your-long-random-secret-min-32-chars
93 #
94 # Hosted memory consolidation (Session 10 / Stream 1 — bridge + gateway).
95 # CONSOLIDATION_LLM_API_KEY: LLM key for hosted consolidation passes; falls back to OPENAI_API_KEY.
96 # CONSOLIDATION_LLM_MODEL: Model to use (default: gpt-4o-mini).
97 # CONSOLIDATION_COST_CAP_USD: Optional daily spend cap per user on the bridge (no cap if unset).
98 # CONSOLIDATION_LLM_API_KEY=
99 # CONSOLIDATION_LLM_MODEL=gpt-4o-mini
100 # CONSOLIDATION_COST_CAP_USD=
101 #
102 # Sign in with Apple — native identity-assertion exchange (POST /api/v1/auth/native-apple-exchange).
103 # Placeholders only — never commit real Bundle IDs, Team IDs, or .p8 material.
104 # APPLE_CLIENT_ID= # Required for Apple path: native Bundle ID or Services ID (JWT aud)
105 # APPLE_TEAM_ID= # Reserved (future auth-code / client-secret JWT) — do not commit
106 # APPLE_KEY_ID= # Reserved (.p8 key id) — do not commit
107 # APPLE_PRIVATE_KEY= # Reserved (.p8 PEM) — gitignored secret store only; never commit
108 #
109 # Docs connectors (KN-DOCS-SYNC) — names only; gates stay false in source until Tier 3.
110 # DOCS_OAUTH_GOOGLE_AUTHORIZED=
111 # DOCS_NOTION_HUB_KEY_AUTHORIZED=
112 # GOOGLE_DRIVE_OAUTH_CLIENT_ID=
113 # GOOGLE_DRIVE_OAUTH_CLIENT_SECRET=
114 # KNOWTATION_DOCS_OAUTH_SECRET=
115 # DOCS_OAUTH_REDIRECT_URI=
116 # SCOOLING_RETURN_URL_ALLOWLIST=
117 # NOTION_API_KEY=
118 #
119 # Learning-path writes (KN-WORK-PATH-LIST). Name only; default off until Tier 3.
120 # PATH_WRITES_ENABLED=
File History 1 commit
sha256:fbe982a22c05c6fe2e93876f250deecdb43d883f648b4e1810c7546caa9f17db docs: activate KNOWTATION- board identity and preserve livi… Human minor 5 days ago