[PR #8523] [MERGED] docs: custom AI chat #16282

Closed
opened 2026-04-13 10:28:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8523
Author: @ping-maxwell
Created: 3/9/2026
Status: Merged
Merged: 3/13/2026
Merged by: @ping-maxwell

Base: canaryHead: docs/custom-ai-chat


📝 Commits (10+)

  • 1e80808 docs: custom AI chat
  • 5ec2ea5 Merge branch 'canary' into docs/custom-ai-chat
  • 0256573 chore: lint
  • e478a4f chore: remove logs
  • 3a5ba5b add: search suppor
  • 99f4800 chore: change model
  • 130e224 Merge branch 'canary' into docs/custom-ai-chat
  • 339aaef chore: mcp use context7
  • a3df53c feat: integrate GitHub code search and file retrieval
  • 1f93c9a docs: custom AI chat

📊 Changes

25 files changed (+626 additions, -422 deletions)

View changed files

📝 .cspell/custom-words.txt (+1 -1)
📝 .cspell/tech-terms.txt (+2 -0)
📝 docs/content/docs/concepts/api.mdx (+1 -1)
📝 docs/content/docs/concepts/cli.mdx (+1 -1)
📝 docs/content/docs/concepts/client.mdx (+1 -1)
📝 docs/content/docs/concepts/cookies.mdx (+1 -1)
📝 docs/content/docs/concepts/database.mdx (+1 -1)
📝 docs/content/docs/concepts/email.mdx (+1 -1)
📝 docs/content/docs/concepts/hooks.mdx (+1 -1)
📝 docs/content/docs/concepts/oauth.mdx (+1 -1)
📝 docs/content/docs/concepts/plugins.mdx (+1 -1)
📝 docs/content/docs/concepts/rate-limit.mdx (+1 -1)
📝 docs/content/docs/concepts/session-management.mdx (+1 -1)
📝 docs/content/docs/concepts/typescript.mdx (+1 -1)
📝 docs/content/docs/concepts/users-accounts.mdx (+1 -1)
📝 docs/content/docs/introduction.mdx (+3 -35)
📝 landing/.env.example (+7 -2)
📝 landing/app/api/docs/chat/route.ts (+1 -21)
📝 landing/components/ai-chat.tsx (+24 -25)
📝 landing/components/sidebar-content.tsx (+6 -0)

...and 5 more files

📄 Description

Summary

  • Removed inkeep code, added custom LLM code with AI-sdk, open-router & upstash-ratelimit.
  • Optimized some mdx file description to be better for LLMs to find the right docs.
  • Added "dynamic base URL" docs to our docs sidebar because it was missing for some reason.

Production Todo

  • Add UPSTASH_REDIS_REST_URL & UPSTASH_REDIS_REST_TOKEN to ENV for upstash rate-limits.
  • Add OPENROUTER_API_KEY to ENV for open-router AI gateway to communicate with AIs.

How it works

This works by providing an overview of each documentation page into it's system prompt.
Then we provide a getDocumentation tool which the LLM can provide a slug, we use that slug to find the documentation and return the information.
A big part of improving the LLM at finding the right information is by improving the documentation descriptions, which I've done a lot for the concepts category in this PR. This helps the LLM to find the right docs page to get the needed info.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/8523 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 3/9/2026 **Status:** ✅ Merged **Merged:** 3/13/2026 **Merged by:** [@ping-maxwell](https://github.com/ping-maxwell) **Base:** `canary` ← **Head:** `docs/custom-ai-chat` --- ### 📝 Commits (10+) - [`1e80808`](https://github.com/better-auth/better-auth/commit/1e808082cfd07f5e82809dc06cd2d798bfba95a3) docs: custom AI chat - [`5ec2ea5`](https://github.com/better-auth/better-auth/commit/5ec2ea5e4dfcbb854ac8baefd49fe2e42f9530fc) Merge branch 'canary' into docs/custom-ai-chat - [`0256573`](https://github.com/better-auth/better-auth/commit/02565736c7b525896e9c2856dfbe3adacac8f792) chore: lint - [`e478a4f`](https://github.com/better-auth/better-auth/commit/e478a4fea3ee65394fa65a00816b51b579a3265d) chore: remove logs - [`3a5ba5b`](https://github.com/better-auth/better-auth/commit/3a5ba5b5d523bdc9d57953906f960ad54e902494) add: search suppor - [`99f4800`](https://github.com/better-auth/better-auth/commit/99f480047c455b719725a06b90ce02e1fd24b852) chore: change model - [`130e224`](https://github.com/better-auth/better-auth/commit/130e2247a8a329ab0ee366b65d6b4536b1b1a8b1) Merge branch 'canary' into docs/custom-ai-chat - [`339aaef`](https://github.com/better-auth/better-auth/commit/339aaeff678f1a1f1492b0fa54056f6317c3b4f8) chore: mcp use context7 - [`a3df53c`](https://github.com/better-auth/better-auth/commit/a3df53ca3de16f20d759fee08f645c90fa3b7481) feat: integrate GitHub code search and file retrieval - [`1f93c9a`](https://github.com/better-auth/better-auth/commit/1f93c9a15cb537ff2be06e98f0d3022d7f8bb5dc) docs: custom AI chat ### 📊 Changes **25 files changed** (+626 additions, -422 deletions) <details> <summary>View changed files</summary> 📝 `.cspell/custom-words.txt` (+1 -1) 📝 `.cspell/tech-terms.txt` (+2 -0) 📝 `docs/content/docs/concepts/api.mdx` (+1 -1) 📝 `docs/content/docs/concepts/cli.mdx` (+1 -1) 📝 `docs/content/docs/concepts/client.mdx` (+1 -1) 📝 `docs/content/docs/concepts/cookies.mdx` (+1 -1) 📝 `docs/content/docs/concepts/database.mdx` (+1 -1) 📝 `docs/content/docs/concepts/email.mdx` (+1 -1) 📝 `docs/content/docs/concepts/hooks.mdx` (+1 -1) 📝 `docs/content/docs/concepts/oauth.mdx` (+1 -1) 📝 `docs/content/docs/concepts/plugins.mdx` (+1 -1) 📝 `docs/content/docs/concepts/rate-limit.mdx` (+1 -1) 📝 `docs/content/docs/concepts/session-management.mdx` (+1 -1) 📝 `docs/content/docs/concepts/typescript.mdx` (+1 -1) 📝 `docs/content/docs/concepts/users-accounts.mdx` (+1 -1) 📝 `docs/content/docs/introduction.mdx` (+3 -35) 📝 `landing/.env.example` (+7 -2) 📝 `landing/app/api/docs/chat/route.ts` (+1 -21) 📝 `landing/components/ai-chat.tsx` (+24 -25) 📝 `landing/components/sidebar-content.tsx` (+6 -0) _...and 5 more files_ </details> ### 📄 Description ## Summary * Removed inkeep code, added custom LLM code with AI-sdk, open-router & upstash-ratelimit. * Optimized some mdx file description to be better for LLMs to find the right docs. * Added "dynamic base URL" docs to our docs sidebar because it was missing for some reason. ## Production Todo - [ ] Add `UPSTASH_REDIS_REST_URL` & `UPSTASH_REDIS_REST_TOKEN` to ENV for upstash rate-limits. - [ ] Add `OPENROUTER_API_KEY` to ENV for open-router AI gateway to communicate with AIs. ## How it works This works by providing an overview of each documentation page into it's system prompt. Then we provide a `getDocumentation` tool which the LLM can provide a slug, we use that slug to find the documentation and return the information. A big part of improving the LLM at finding the right information is by improving the documentation descriptions, which I've done a lot for the `concepts` category in this PR. This helps the LLM to find the right docs page to get the needed info. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 10:28:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16282