Skip to content

Commit afe9e85

Browse files
authored
docs: add use cases tutorials for AI workflows (#392)
Add new tutorial section covering common AI patterns: - Automatic embeddings with database triggers - Structured output using Zod schemas - RAG pipeline with query transformation and reranking - Chatbot with parallel history and knowledge retrieval All tutorials demonstrate proper pgflow DSL patterns with factual, working examples using AI SDK and standard libraries.
1 parent 03a3b6a commit afe9e85

File tree

9 files changed

+1994
-526
lines changed

9 files changed

+1994
-526
lines changed

pkgs/website/astro.config.mjs

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,27 @@ const DEPLOYMENT_ENV = process.env.DEPLOYMENT_ENV; // 'production' or 'preview'
2424
const isProduction = DEPLOYMENT_ENV === 'production';
2525

2626
// Validate DEPLOYMENT_ENV if set
27-
if (DEPLOYMENT_ENV && DEPLOYMENT_ENV !== 'production' && DEPLOYMENT_ENV !== 'preview') {
28-
throw new Error(`DEPLOYMENT_ENV must be either "production" or "preview", got: "${DEPLOYMENT_ENV}"`);
27+
if (
28+
DEPLOYMENT_ENV &&
29+
DEPLOYMENT_ENV !== 'production' &&
30+
DEPLOYMENT_ENV !== 'preview'
31+
) {
32+
throw new Error(
33+
`DEPLOYMENT_ENV must be either "production" or "preview", got: "${DEPLOYMENT_ENV}"`
34+
);
2935
}
3036

3137
// Require Plausible proxy URL only for production
3238
if (isProduction && !process.env.PLAUSIBLE_PROXY_URL) {
33-
throw new Error('PLAUSIBLE_PROXY_URL environment variable is required for production deployments');
39+
throw new Error(
40+
'PLAUSIBLE_PROXY_URL environment variable is required for production deployments'
41+
);
3442
}
3543

3644
const PLAUSIBLE_PROXY = {
37-
url: process.env.PLAUSIBLE_PROXY_URL || 'https://wispy-pond-c6f8.jumski.workers.dev',
45+
url:
46+
process.env.PLAUSIBLE_PROXY_URL ||
47+
'https://wispy-pond-c6f8.jumski.workers.dev',
3848
eventPath: '/data/event',
3949
scriptPath:
4050
'/assets/script.hash.outbound-links.pageview-props.tagged-events.js',
@@ -381,7 +391,10 @@ export default defineConfig({
381391
label: 'Context object',
382392
link: '/concepts/context-object/',
383393
},
384-
{ label: 'Naming conventions', link: '/concepts/naming-conventions/' },
394+
{
395+
label: 'Naming conventions',
396+
link: '/concepts/naming-conventions/',
397+
},
385398
],
386399
},
387400
],
@@ -434,6 +447,12 @@ export default defineConfig({
434447
link: '/tutorials/',
435448
id: 'tutorials',
436449
items: [
450+
{
451+
label: 'RAG Pipeline',
452+
autogenerate: {
453+
directory: 'tutorials/rag/',
454+
},
455+
},
437456
{
438457
label: 'AI Web Scraper',
439458
autogenerate: {
@@ -452,7 +471,10 @@ export default defineConfig({
452471
{ label: 'DBOS', link: '/comparisons/dbos/' },
453472
{ label: 'Inngest', link: '/comparisons/inngest/' },
454473
{ label: 'Trigger.dev', link: '/comparisons/trigger/' },
455-
{ label: 'Vercel Workflows', link: '/comparisons/vercel-workflows/' },
474+
{
475+
label: 'Vercel Workflows',
476+
link: '/comparisons/vercel-workflows/',
477+
},
456478
],
457479
},
458480
],

pkgs/website/src/content/docs/tutorials/index.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ import { LinkCard, CardGrid } from '@astrojs/starlight/components';
1111
Learn pgflow through hands-on examples. These tutorials guide you through building real workflows while teaching core concepts. Each tutorial is goal-oriented, focusing on practical experience rather than pure explanation.
1212

1313
<CardGrid>
14+
<LinkCard
15+
title="RAG Pipeline"
16+
description="Create parallel chunking RAG Pipeline with pgflow and Postgres"
17+
href="/tutorials/rag/"
18+
/>
1419
<LinkCard
1520
title="Build an AI-Powered Web Scraper"
1621
description="Create a workflow that scrapes webpages, analyzes content with OpenAI, and stores results in Postgres"

0 commit comments

Comments
 (0)