Skip to content

feat(docs): Implement two-stage chat#11493

Merged
anthonyshew merged 2 commits intomainfrom
shew/28382
Jan 17, 2026
Merged

feat(docs): Implement two-stage chat#11493
anthonyshew merged 2 commits intomainfrom
shew/28382

Conversation

@anthonyshew
Copy link
Contributor

@anthonyshew anthonyshew commented Jan 16, 2026

Summary

Refactors the docs site chat API to use a two-stage RAG architecture:

  1. Stage 1 (Retrieval): Uses GPT-4.1-mini to perform fast, cost-effective documentation search
  2. Stage 2 (Generation): Uses Claude Sonnet for high-quality response generation with retrieved context

Key changes

  • Separates RAG retrieval from generation into distinct model calls
  • Simplifies system prompt by removing tool-usage instructions (retrieval happens automatically)
  • Increases doc content limit from 1500 to 5000 chars for better context
  • Fixes overflow issues in code blocks and message containers
  • Cleans up UI by hiding messages without text content
  • Removes loading spinner that appeared after sources were shown

Testing

Test the chat functionality on the docs site to verify responses are generated correctly with source citations.

CLOSES TURBO-5087

@anthonyshew anthonyshew requested a review from a team as a code owner January 16, 2026 23:40
@anthonyshew anthonyshew requested a review from tknickman January 16, 2026 23:40
@turbo-orchestrator turbo-orchestrator bot added the area: site Issues and improvements related to Turborepo's documentation website label Jan 16, 2026
@vercel
Copy link
Contributor

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
examples-basic-web Ready Ready Preview, Comment Jan 17, 2026 0:54am
examples-designsystem-docs Ready Ready Preview, Comment Jan 17, 2026 0:54am
examples-gatsby-web Ready Ready Preview, Comment Jan 17, 2026 0:54am
examples-kitchensink-blog Ready Ready Preview, Comment Jan 17, 2026 0:54am
examples-nonmonorepo Ready Ready Preview, Comment Jan 17, 2026 0:54am
examples-svelte-web Ready Ready Preview, Comment Jan 17, 2026 0:54am
examples-tailwind-web Ready Ready Preview, Comment Jan 17, 2026 0:54am
examples-vite-web Ready Ready Preview, Comment Jan 17, 2026 0:54am
turbo-site Ready Ready Preview, Comment Jan 17, 2026 0:54am

@anthonyshew anthonyshew changed the title feat(docs): Implement two-stage RAG for chat with Claude generation feat(docs): Implement two-stage chat Jan 16, 2026
@anthonyshew anthonyshew merged commit 37b07f2 into main Jan 17, 2026
36 checks passed
@anthonyshew anthonyshew deleted the shew/28382 branch January 17, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: site Issues and improvements related to Turborepo's documentation website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant