Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Jan 17, 2026

Add a new tutorial showing how to build a production-ready chatbot that:

  • Uses pgflow to orchestrate multi-step context gathering
  • Performs parallel retrieval from 3 sources (semantic search, web search, memory)
  • Implements merge and reranking of results
  • Streams responses using AI SDK's useChat hook
  • Shows real-time progress updates via pgflow client

The tutorial demonstrates:

  • Multi-step flow with parallel execution
  • Browser client integration with real-time progress
  • Edge function for SSE chat streaming
  • Separation of context gathering from response streaming
  • Complete database schema, task implementations, and flow definition

Tutorial added to sidebar navigation in astro.config.mjs

Add a new tutorial showing how to build a production-ready chatbot that:
- Uses pgflow to orchestrate multi-step context gathering
- Performs parallel retrieval from 3 sources (semantic search, web search, memory)
- Implements merge and reranking of results
- Streams responses using AI SDK's useChat hook
- Shows real-time progress updates via pgflow client

The tutorial demonstrates:
- Multi-step flow with parallel execution
- Browser client integration with real-time progress
- Edge function for SSE chat streaming
- Separation of context gathering from response streaming
- Complete database schema, task implementations, and flow definition

Tutorial added to sidebar navigation in astro.config.mjs
@changeset-bot
Copy link

changeset-bot bot commented Jan 17, 2026

⚠️ No Changeset found

Latest commit: 6b734f7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Jan 17, 2026

View your CI Pipeline Execution ↗ for commit 6b734f7

Command Status Duration Result
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded <1s View ↗
nx affected -t build --configuration=production... ✅ Succeeded <1s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-17 12:37:57 UTC

Comment on lines +788 to +789
transform(chunk, controller) {
const text = new TextDecoder().decode(chunk);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creates a new TextDecoder for each chunk, which will corrupt multi-byte UTF-8 characters that span across chunks. The decoder should be created once outside the transform function and reused with the stream: true option.

const decoder = new TextDecoder();
const transformStream = new TransformStream({
  transform(chunk, controller) {
    const text = decoder.decode(chunk, { stream: true });
    fullResponse += text;
    controller.enqueue(chunk);
  },
  flush: async () => {
    // Finalize any remaining bytes
    fullResponse += decoder.decode();
    await supabase
      .from('messages')
      .insert({
        conversation_id: conversationId,
        role: 'assistant',
        content: fullResponse,
      });
  },
});

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Fix broken links in Next Steps section:
- /build/flows/ → /concepts/understanding-flows/
- /concepts/tasks/ → /build/create-reusable-tasks/
@github-actions
Copy link
Contributor

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-596.pgflow.pages.dev

📝 Details:

  • Branch: claude/chatbot-pflow-tutorial-6iorr
  • Commit: ec69ac8d0771c443b1063ec021fa99b6e7b71ae9
  • View Logs

_Last updated: _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants