René's URL Explorer Experiment


Title: docs: Ask AI chat grounded in the docs vector store by ouiliame · Pull Request #5172 · simstudioai/sim · GitHub

Open Graph Title: docs: Ask AI chat grounded in the docs vector store by ouiliame · Pull Request #5172 · simstudioai/sim

X Title: docs: Ask AI chat grounded in the docs vector store by ouiliame · Pull Request #5172 · simstudioai/sim

Description: Summary Adds an Ask AI chat to the docs site so readers can ask questions about Sim in natural language and get answers grounded in the documentation. Floating launcher → chat panel (components/ai/ask-ai.tsx) built on the Vercel AI SDK's useChat. Assistant replies render as markdown via streamdown (the same AI-streaming markdown renderer the main app's chat uses), with source chips linking back to cited pages. Streaming API route (app/api/chat/route.ts) using streamText with the OpenAI provider. A searchDocs tool runs a vector search over the existing docs_embeddings store and returns source links, so the model answers from real docs rather than memory. Reuses the OPENAI_API_KEY already in the environment (same key the docs search uses for embeddings). Model defaults to gpt-5.4-mini, overridable via OPENAI_CHAT_MODEL. Abuse hardening This endpoint proxies a paid LLM, so an unauthenticated public route is a target for scripted "free inference". Shipped in this PR (cost caps per request): Max messages, max input size (413), max output tokens, reduced tool-step limit Lenient same-origin check (rejects obvious cross-origin; DOCS_ALLOWED_ORIGINS to extend) Infra-side follow-ups (dashboard/provisioning, not code) — do before public launch: OpenAI hard spend cap + alert (backstops worst case regardless of code) Durable per-IP rate limit (Upstash/Vercel KV — the per-request caps bound cost but not volume) Vercel Firewall / BotID (or Turnstile) to block headless traffic at the edge Notes The LLM-text plumbing (llms.txt, llms-full.txt, .md/.mdx routes, Accept negotiation) already existed — this PR adds only the Ask AI chat. Embeddings stay on OpenAI (text-embedding-3-small); only the chat completion uses the chat model. Branch is off staging; bun run build and type-check pass for the docs app. 🤖 Generated with Claude Code

Open Graph Description: Summary Adds an Ask AI chat to the docs site so readers can ask questions about Sim in natural language and get answers grounded in the documentation. Floating launcher → chat panel (components/ai...

X Description: Summary Adds an Ask AI chat to the docs site so readers can ask questions about Sim in natural language and get answers grounded in the documentation. Floating launcher → chat panel (components/ai...

Opengraph URL: https://github.com/simstudioai/sim/pull/5172

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:1fc4bccf-da87-dc7a-eba6-1fc6e109a357
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB56A:39F0B6:2540B6:34A7FF:6AFB5274
html-safe-noncea4e04fa406598464cfb925057c3cc4e968052500b6a05ce28bae63fd4f49d7fb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTZBOjM5RjBCNjoyNTQwQjY6MzRBN0ZGOjZBRkI1Mjc0IiwidmlzaXRvcl9pZCI6IjM3MDg5NDk5Mjk3MjUyMTk0NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac28e55d9403fb0accf09bd6ed67078e2ab64986c9a20167bd62493b34abe2aa3f
hovercard-subject-tagpull_request:3915218323
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5172/files
twitter:imagehttps://avatars.githubusercontent.com/u/990030?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/990030?s=400&v=4
og:image:altSummary Adds an Ask AI chat to the docs site so readers can ask questions about Sim in natural language and get answers grounded in the documentation. Floating launcher → chat panel (components/ai...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5172/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5172%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5172%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/5172/files
Reloadhttps://github.com/simstudioai/sim/pull/5172/files
Reloadhttps://github.com/simstudioai/sim/pull/5172/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
simstudioai:staginghttps://github.com/simstudioai/sim/tree/staging
ouiliame:feat/docs-ask-aihttps://github.com/ouiliame/sim-docs/tree/feat/docs-ask-ai
Conversation 43 https://github.com/simstudioai/sim/pull/5172
Commits 2 https://github.com/simstudioai/sim/pull/5172/commits
Checks 14 https://github.com/simstudioai/sim/pull/5172/checks
Files changed https://github.com/simstudioai/sim/pull/5172/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
docs: Ask AI chat grounded in the docs vector store https://github.com/simstudioai/sim/pull/5172/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/5172/files
3066d06 docs: Ask AI chat grounded in the docs vector store ouiliame Jun 25, 2026 https://github.com/simstudioai/sim/pull/5172/commits/3066d0664ba164106be82d2841fa6b9b6246dec7
d5610a4 docs: harden Ask AI retrieval + fix stale loading state ouiliame Jun 25, 2026 https://github.com/simstudioai/sim/pull/5172/commits/d5610a46816685f420a4e28fcc36df9d6a9e2a66
Clear filters https://github.com/simstudioai/sim/pull/5172/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
layout.tsx https://github.com/simstudioai/sim/pull/5172/files#diff-987960234022bfdd3cbb1dc0c4a39e9b34c46f2d1816efd1affde90ea0d3dc28
route.ts https://github.com/simstudioai/sim/pull/5172/files#diff-c90e30b62a67c5320b103b2aff46551b3a356206378a1c20141b00465e76e5ba
ask-ai.tsx https://github.com/simstudioai/sim/pull/5172/files#diff-1df27f9c95289e326c5df610275821df331c6be8192582376e03ab39c41719c0
package.json https://github.com/simstudioai/sim/pull/5172/files#diff-d03d2ce97fad5059ad6248fca5f5919994b09bca360f883318c03f1f817ae677
bun.lock https://github.com/simstudioai/sim/pull/5172/files#diff-bfd0ef82a01108fa1e836c2500b98b7de8a92bb1ae352a8efcbd9d6ffcaabd60
apps/docs/app/[lang]/layout.tsxhttps://github.com/simstudioai/sim/pull/5172/files#diff-987960234022bfdd3cbb1dc0c4a39e9b34c46f2d1816efd1affde90ea0d3dc28
View file https://github.com/ouiliame/sim-docs/blob/d5610a46816685f420a4e28fcc36df9d6a9e2a66/apps/docs/app/%5Blang%5D/layout.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5172/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5172/files#diff-987960234022bfdd3cbb1dc0c4a39e9b34c46f2d1816efd1affde90ea0d3dc28
https://github.com/simstudioai/sim/pull/5172/files#diff-987960234022bfdd3cbb1dc0c4a39e9b34c46f2d1816efd1affde90ea0d3dc28
https://github.com/simstudioai/sim/pull/5172/files#diff-987960234022bfdd3cbb1dc0c4a39e9b34c46f2d1816efd1affde90ea0d3dc28
https://github.com/simstudioai/sim/pull/5172/files#diff-987960234022bfdd3cbb1dc0c4a39e9b34c46f2d1816efd1affde90ea0d3dc28
apps/docs/app/api/chat/route.tshttps://github.com/simstudioai/sim/pull/5172/files#diff-c90e30b62a67c5320b103b2aff46551b3a356206378a1c20141b00465e76e5ba
View file https://github.com/ouiliame/sim-docs/blob/d5610a46816685f420a4e28fcc36df9d6a9e2a66/apps/docs/app/api/chat/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5172/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5172/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.