You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,10 @@
8
8
9
9
Cortex combines LangGraph orchestration, GraphRAG retrieval, durable background jobs, and end-to-end observability in a FastAPI and React application.
10
10
11
-
<imgwidth="1722"height="898"alt="Cortex research workspace showing a generated report and source-grounded chat"src="https://github.com/user-attachments/assets/1f01409f-bc58-43ef-bc09-5ec2649acf00" />
Copy file name to clipboardExpand all lines: docs/architecture.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,12 +66,14 @@ Routing policy:
66
66
67
67
- Greetings and other social turns normally resolve directly.
68
68
- Weak or empty RAG context does not automatically trigger web search.
69
+
- Missing pre-retrieved RAG context does not mean resources are absent; explicit requests about uploaded documents route to `answer_from_rag`, then retrieval runs.
70
+
- Custom-agent routing receives the agent name, description, and linked/attached resource counts so short domain questions can still select `answer_from_rag` and retain citations.
69
71
- Web search is selected for external, fresh, or otherwise web-dependent information.
70
72
- A URL in the message or history is available context, not an automatic fetch instruction.
71
73
- Direct URL fetching happens only when inspecting the resource is necessary.
72
74
- Agent chat, workspace chat, and streaming/non-streaming endpoints use the same policy.
73
75
74
-
Workspace and agent document collections are deny-by-default: Cortex retrieves them only when the router explicitly selects `answer_from_rag`. Session attachments remain available as explicitly scoped resources. A routing failure after one structured-output repair returns `router_error` and does not retrieve documents.
76
+
The workspace-wide document collection is deny-by-default: Cortex retrieves it only when the router explicitly selects `answer_from_rag`. A custom agent's linked resources and session attachments are explicitly scoped resources, so they remain available on every turn. A routing failure after one structured-output repair returns `router_error` and does not retrieve documents.
Copy file name to clipboardExpand all lines: docs/billing.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Cortex uses Stripe Hosted Checkout, signed webhooks, and the customer portal for
4
4
5
5
## Configuration
6
6
7
-
Required variables:
7
+
Required local-development variables:
8
8
9
9
-`STRIPE_SECRET_KEY`
10
10
-`STRIPE_WEBHOOK_SECRET`
@@ -13,6 +13,11 @@ Required variables:
13
13
-`STRIPE_CANCEL_URL`
14
14
-`STRIPE_PORTAL_RETURN_URL`
15
15
16
+
In production, Cloud Run uses one `BILLING_CONFIG_JSON` Secret Manager value containing
17
+
`stripe_secret_key`, `stripe_webhook_secret`, and `stripe_pro_price_id`; the three redirect
18
+
URLs remain ordinary environment variables. This keeps the Stripe credentials within one
19
+
active secret version.
20
+
16
21
Store production secret values in Google Secret Manager. See [Production configuration](env-vars-production.md).
17
22
18
23
## Webhook setup
@@ -46,4 +51,3 @@ flowchart LR
46
51
```
47
52
48
53
Webhook events are the authoritative source for subscription state. The backend verifies the Stripe signature before updating `user_subscriptions`; research and chat quota guards then read the synchronized subscription and usage state.
Copy file name to clipboardExpand all lines: docs/env-vars-production.md
+12-18Lines changed: 12 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,14 @@ All secrets should be stored in **Google Secret Manager** and referenced via `va
8
8
9
9
| Env Var | Secret Manager | Notes |
10
10
|---|---|---|
11
-
|`OPENAI_API_KEY`| yes | Required when `LLM_PROVIDER=openai`|
11
+
|`PROVIDER_CONFIG_JSON`| yes |Secret JSON with provider, Redis, Langfuse, LangSmith, and Sentry settings: `openai_api_key`, `tavily_api_key`, `redis_url`, `langfuse_public_key`, `langfuse_secret_key`, `langfuse_base_url`, `langsmith_api_key`, `langsmith_project`, `langsmith_endpoint`, `langsmith_redaction_mode`, `langsmith_sampling_rate`, `langsmith_tracing`, and `sentry_dsn`. Required when `LLM_PROVIDER=openai`.|
12
12
|`OPENROUTER_API_KEY`| yes | Required when `LLM_PROVIDER=openrouter`|
13
13
|`LLM_PROVIDER`| no |`openai` or `openrouter`|
14
14
|`OPENAI_MODEL`| no | e.g. `gpt-4o-mini`|
15
+
|`ROUTER_TIMEOUT_SECONDS`| no | Maximum duration of each router LLM request; production uses `10.0`|
15
16
|`EMBEDDING_PROVIDER`| no |`openai`|
16
17
|`EMBEDDING_MODEL`| no |`text-embedding-3-small`|
17
18
|`EMBEDDING_DIMENSIONS`| no |`1536`|
18
-
|`TAVILY_API_KEY`| yes ||
19
19
|`ALPHA_VANTAGE_API_KEY`| yes | Required when `ASSET_PRICE_PROVIDER=alphavantage_mcp`|
20
20
|`ASSET_PRICE_PROVIDER`| no |`alphavantage_mcp`|
21
21
|`ALPHA_VANTAGE_MCP_URL`| no | Optional full remote MCP URL override |
@@ -31,12 +31,9 @@ All secrets should be stored in **Google Secret Manager** and referenced via `va
31
31
|`READINESS_REQUIRE_SUPABASE`| no | Set to `true` in production; `/ready` returns `503` if Supabase is missing or unavailable |
32
32
|`READINESS_REQUIRE_NEO4J`| no | Set to `true` in production; `/ready` returns `503` if Neo4j is missing or unavailable |
33
33
|`READINESS_TIMEOUT_SECONDS`| no | Per-dependency probe timeout; defaults to `2.0` seconds |
34
-
|`INNGEST_EVENT_KEY`| yes | From Inngest dashboard → Keys |
35
-
|`INNGEST_SIGNING_KEY`| yes | From Inngest dashboard → Keys. **Must not be empty in prod.**|
36
-
|`REDIS_URL`| yes | Upstash `rediss://` URL |
37
-
|`STRIPE_SECRET_KEY`| yes ||
38
-
|`STRIPE_WEBHOOK_SECRET`| yes | Update Stripe webhook URL to `https://<cloud-run-url>/api/billing/webhook` after first deploy |
39
-
|`STRIPE_PRO_PRICE_ID`| no ||
34
+
|`INNGEST_CONFIG_JSON`| yes | Secret JSON with `inngest_event_key` and `inngest_signing_key` from the Inngest dashboard. |
35
+
|`REDIS_CACHE_TTL_DB_LIST_SECONDS`| no | Cache TTL for DB-heavy list/read-all responses; production uses `30`. `REDIS_URL` is supplied through `PROVIDER_CONFIG_JSON`. |
36
+
|`BILLING_CONFIG_JSON`| yes | Secret JSON with `stripe_secret_key`, `stripe_webhook_secret`, and `stripe_pro_price_id`. This bundles Stripe credentials into one Secret Manager version. |
40
37
|`STRIPE_SUCCESS_URL`| no |`https://<frontend>/billing/success`|
41
38
|`STRIPE_CANCEL_URL`| no |`https://<frontend>/billing/cancel`|
42
39
|`STRIPE_PORTAL_RETURN_URL`| no |`https://<frontend>`|
@@ -48,11 +45,11 @@ All secrets should be stored in **Google Secret Manager** and referenced via `va
|`SENTRY_ENVIRONMENT`| no | Sentry issue environment; production deploys set this to `production`|
57
54
|`RATE_LIMIT_DEFAULT`| no | Per-IP request limit, e.g. `60/minute` (default) |
58
55
@@ -90,19 +87,16 @@ PROJECT=cortex-496709
90
87
REGION=your-region
91
88
92
89
secrets=(
93
-
openai-api-key
94
-
tavily-api-key
90
+
provider-config
95
91
cohere-api-key
96
92
neo4j-uri
97
93
neo4j-username
98
94
neo4j-password
99
95
supabase-secret-key
100
96
supabase-jwt-secret
101
-
inngest-event-key
102
-
inngest-signing-key
97
+
inngest-config
103
98
redis-url
104
-
stripe-secret-key
105
-
stripe-webhook-secret
99
+
billing-config
106
100
internal-dispatch-secret
107
101
langfuse-public-key
108
102
langfuse-secret-key
@@ -137,7 +131,7 @@ Configure email alerts for terminal failures in every registered function and fo
137
131
138
132
## Alerting post-deploy wiring
139
133
140
-
After creating a Sentry Python/FastAPI project, add its DSN to `.env.prod`as `SENTRY_DSN` or populate the `sentry-dsn`Secret Manager secret manually. Then deploy and configure a Sentry email issue alert for new or regressed production issues with a 30-minute per-issue cooldown.
134
+
After creating a Sentry Python/FastAPI project, add its DSN as the `sentry_dsn` field in the existing `provider-config` JSON secret. This keeps production at six active Secret Manager versions. Then deploy and configure a Sentry email issue alert for new or regressed production issues with a 30-minute per-issue cooldown.
Copy file name to clipboardExpand all lines: docs/observability.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ Which signal fires for which failure class:
85
85
86
86
### Error tracking
87
87
88
-
Setting `SENTRY_DSN` enables Sentry for unhandled and selected handled-exception capture (error-capture only — tracing stays with LangSmith/LangFuse, PII and stack-trace locals are not sent). Production uses the Cloud Run revision as the Sentry release. Configure one Sentry issue alert for a new or regressed issue in `production`, delivered by email with a 30-minute per-issue cooldown. See [Production configuration](env-vars-production.md).
88
+
Setting `SENTRY_DSN`locally, or `sentry_dsn` inside the production `PROVIDER_CONFIG_JSON` secret, enables Sentry for unhandled and selected handled-exception capture (error-capture only — tracing stays with LangSmith/LangFuse, PII and stack-trace locals are not sent). Production uses the Cloud Run revision as the Sentry release. Configure one Sentry issue alert for a new or regressed issue in `production`, delivered by email with a 30-minute per-issue cooldown. See [Production configuration](env-vars-production.md).
89
89
90
90
Handled-exception metadata is allowlisted to operational identifiers such as run, session, job, and outbox event IDs. Prompts, chat messages, documents, tokens, and authorization values are never attached.
0 commit comments