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: AGENTS.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,12 @@ bun run fetch:models # Update AI model catalog (requires AI_GATEWAY_AP
35
35
- TSDoc syntax enforcement (`tsdoc/syntax`)
36
36
- JSDoc policy on exported APIs (warn-level for iteration speed)
37
37
38
+
## Import policy
39
+
40
+
- Do **not** switch to package barrel imports by default.
41
+
- Barrel imports are allowed only for packages listed in `next.config.ts``experimental.optimizePackageImports` (currently `radix-ui` and `lucide-react`).
42
+
- For all other packages, use explicit/non-barrel imports.
43
+
38
44
## Drizzle + database
39
45
40
46
-`drizzle.config.ts` loads Next.js `.env*` files and requires `DATABASE_URL` for
@@ -58,8 +64,9 @@ bun run fetch:models # Update AI model catalog (requires AI_GATEWAY_AP
58
64
59
65
## AI Gateway
60
66
61
-
- Prefer `ai` package `gateway(...)` usage for model routing.
62
-
- OpenAI-compatible base URL is `https://ai-gateway.vercel.sh/v1`.
67
+
- Prefer the AI SDK's `gateway(...)` / `createGateway(...)` provider for model routing.
68
+
- AI SDK Gateway provider base URL is `https://ai-gateway.vercel.sh/v3/ai` (default; configurable via `AI_GATEWAY_BASE_URL`).
69
+
- OpenAI-compatible base URL is `https://ai-gateway.vercel.sh/v1` (used for OpenAI SDK compatibility and `GET /models`).
63
70
-`bun run fetch:models` writes a model catalog JSON (default: `docs/ai-gateway-models.json`).
Updated — 2026-02-03: re-scoped to background jobs (ingestion + fanout); interactive runs moved to ADR-0026.
19
20
20
21
## Description
21
22
22
-
Use QStash to execute multi-step runs durably and idempotently.
23
+
Use QStash to execute **background jobs** durably and idempotently, with signed
24
+
delivery, retries, and rate limiting.
25
+
26
+
This ADR no longer governs **interactive runs or chat streaming**. Those are
27
+
handled by Vercel Workflow DevKit per [ADR-0026](./ADR-0026-orchestration-vercel-workflow-devkit-for-interactive-runs.md).
23
28
24
29
See [SPEC-0021](../spec/SPEC-0021-full-stack-finalization-fluid-compute-neon-upstash-ai-elements.md)
25
30
for the cross-cutting “finalization” plan that ties QStash orchestration into
26
-
run persistence, UI, and step execution patterns.
31
+
ingestion, UI, and background step execution patterns.
27
32
28
33
## Context
29
34
30
-
Full spec generation and research can exceed route execution limits. Durable orchestration ensures work completes even if the user closes the browser. QStash provides serverless-friendly HTTP-based queueing, signature verification, and retries.
35
+
Ingestion and other background jobs (extract/chunk/embed/index) can exceed route
36
+
execution limits and should continue even if the user closes the browser. QStash
37
+
provides serverless-friendly HTTP-based queueing, signature verification, and
38
+
retries.
31
39
32
40
## Decision Drivers
33
41
@@ -55,43 +63,46 @@ Full spec generation and research can exceed route execution limits. Durable orc
55
63
56
64
## Decision
57
65
58
-
We will use **Upstash QStash** to orchestrate run steps, verifying signatures and enforcing step idempotency.
66
+
We will use **Upstash QStash** to orchestrate background jobs (primarily the ingestion pipeline), verifying signatures and enforcing idempotency.
59
67
60
68
## Constraints
61
69
62
-
-Step endpoints must verify QStash signatures.
70
+
-Background job endpoints must verify QStash signatures.
63
71
- Verification requires `QSTASH_CURRENT_SIGNING_KEY` and `QSTASH_NEXT_SIGNING_KEY`.
64
-
-Steps must be idempotent per (runId, stepName).
72
+
-Jobs must be idempotent (e.g., by `(fileId, stage)` and/or content hash).
65
73
- Ensure at-least-once delivery does not duplicate artifacts.
Updated — 2026-02-03: aligned with Workflow DevKit durable sessions and resumable streaming (ADR-0026).
20
23
21
24
## Description
22
25
@@ -26,9 +29,17 @@ See [SPEC-0021](../spec/SPEC-0021-full-stack-finalization-fluid-compute-neon-ups
26
29
for the cross-cutting “finalization” plan that ties agent streaming into the
27
30
workspace UI, retrieval, caching, and durable orchestration.
28
31
32
+
See [SPEC-0022](../spec/SPEC-0022-vercel-workflow-durable-runs-and-streaming-contracts.md)
33
+
for the canonical Workflow DevKit integration (durable multi-turn sessions,
34
+
resumable streams, hook endpoints).
35
+
29
36
## Context
30
37
31
-
The system requires multi-step reasoning and tool usage. AI SDK v6 provides ToolLoopAgent for iterative tool calls and createAgentUIStreamResponse for streaming message parts to the UI in Next.js Route Handlers.
38
+
The system requires multi-step reasoning and tool usage. AI SDK v6 provides
39
+
agent loops (ToolLoopAgent semantics) and UI message streaming primitives.
40
+
For production-grade resumable streaming and multi-turn durability, we run the
41
+
agent loop inside Workflow DevKit using `@workflow/ai``DurableAgent` and stream
42
+
via Workflow run streams (see [ADR-0026](./ADR-0026-orchestration-vercel-workflow-devkit-for-interactive-runs.md) for orchestration rationale).
32
43
33
44
## Decision Drivers
34
45
@@ -56,7 +67,10 @@ The system requires multi-step reasoning and tool usage. AI SDK v6 provides Tool
56
67
57
68
## Decision
58
69
59
-
We will implement agents using **ToolLoopAgent** and stream UI output using **createAgentUIStreamResponse** in Route Handlers.
70
+
We will implement agent loops using **AI SDK v6 agents** (ToolLoopAgent-style
71
+
tool loops) and stream UI output using **AI SDK UI message streams**. In
72
+
interactive/durable paths, we will execute these loops inside Workflow DevKit
73
+
via `@workflow/ai``DurableAgent` and expose resumable streams to clients.
60
74
61
75
## Constraints
62
76
@@ -92,7 +106,7 @@ flowchart LR
92
106
### Performance Requirements
93
107
94
108
-**PR-001:** fast streaming start.
95
-
-**PR-004:** durable runs via QStash.
109
+
-**PR-004:** durable runs and resumable streams (Workflow DevKit).
96
110
97
111
### Integration Requirements
98
112
@@ -146,3 +160,4 @@ flowchart LR
146
160
-**0.1 (2026-01-29)**: Initial version.
147
161
-**0.2 (2026-01-30)**: Updated for current repo baseline (Bun, `src/` layout, CI).
148
162
-**0.3 (2026-02-03)**: Linked to SPEC-0021 as the cross-cutting finalization spec.
Copy file name to clipboardExpand all lines: docs/architecture/adr/ADR-0011-ui-ai-elements-streamdown-shadcn-ui-tailwind-v4.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,10 @@ See [SPEC-0021](../spec/SPEC-0021-full-stack-finalization-fluid-compute-neon-ups
28
28
for the cross-cutting “finalization” plan that specifies the workspace
29
29
information architecture and the API contracts required by the UI.
30
30
31
+
See [SPEC-0023](../spec/SPEC-0023-ai-elements-workspace-ui-and-interaction-model.md)
32
+
for the UI information architecture, component-vendoring plan, and interaction
33
+
model (chat/runs/search/uploads).
34
+
31
35
## Context
32
36
33
37
Building chat and streaming UI primitives from scratch is slow and error-prone. AI Elements provides ready-made components designed for AI SDK message parts. Streamdown improves streaming markdown rendering. shadcn/ui provides accessible UI components aligned with Tailwind v4.
@@ -141,4 +145,4 @@ flowchart LR
141
145
142
146
-**0.1 (2026-01-29)**: Initial version.
143
147
-**0.2 (2026-01-30)**: Updated for current repo baseline (Bun, `src/` layout, CI).
144
-
-**0.3 (2026-02-03)**: Linked to SPEC-0021 as the cross-cutting finalization spec.
148
+
-**0.3 (2026-02-03)**: Linked to SPEC-0021 as the cross-cutting finalization spec; added SPEC-0023 reference for UI/interaction model.
0 commit comments