feat: add chat functionality with AI assistant and content indexing#40
Merged
feat: add chat functionality with AI assistant and content indexing#40
Conversation
Owner
Sithumli
commented
Mar 25, 2026
- Implemented a content index watcher to automatically index markdown files.
- Created a chat widget component for user interaction with the AI assistant.
- Developed a chat page to handle user messages and display responses.
- Integrated Google Generative AI for generating responses based on user queries.
- Added API endpoint for chat interactions, including vector search for relevant content.
- Introduced new types for chat messages, requests, and responses to improve type safety.
- Enhanced user experience with loading indicators and markdown parsing for responses.
There was a problem hiding this comment.
Pull request overview
Adds an AI chat assistant experience (homepage “Ask Anything”, chat page, and floating widget) backed by a RAG pipeline that indexes site content into Upstash Vector and uses Google Gemini to generate answers.
Changes:
- Introduces chat UI surfaces (homepage AskAnything, dedicated chat page, and ChatWidget component).
- Adds
/api/chatendpoint that performs vector search + Gemini streaming responses. - Adds content indexing scripts (batch index + watch) and supporting types/constants/docs.
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| template/src/types/index.ts | Re-exports new chat-related types. |
| template/src/types/constants.ts | Adds chat/indexing constants and role/type definitions. |
| template/src/types/chat.ts | Introduces request/response/context/vector typing for chat + indexing. |
| template/src/pages/index.astro | Adds the AskAnything section to the homepage. |
| template/src/pages/chat/[uid].astro | Adds a dedicated chat page with client-side streaming rendering. |
| template/src/pages/api/chat.ts | Adds chat API route integrating Upstash Vector + Google Gemini streaming. |
| template/src/components/Hero.astro | Removes CTA button markup from the hero section. |
| template/src/components/ChatWidget.astro | Adds a modal-based floating chat widget UI + streaming client. |
| template/src/components/AskAnything.astro | Adds homepage “Ask Anything” input that routes into chat. |
| scripts/index-watch.ts | Adds a dev watcher to re-index content on markdown changes. |
| scripts/index-content.ts | Adds a batch indexer with manifest-based incremental uploads. |
| package.json | Adds scripts/dependencies for indexing + AI services and changes build flow. |
| pnpm-lock.yaml | Locks new dependencies for AI/indexing/Vercel adapter. |
| astro.config.mjs | Adds Vercel adapter configuration. |
| README.md | Documents the new AI chat assistant feature and setup. |
| .gitignore | Ignores the indexing manifest. |
| .env.example | Provides env placeholders for Upstash + Gemini keys. |
| .changeset/plain-grapes-notice.md | Changeset for minor release. |
| .changeset/ai-chat-feature.md | Changeset describing the AI chat feature. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.