Skip to content

Add RAG chatbot (Pixel) and admin config panel#3754

Open
yiilinzhang wants to merge 23 commits intomasterfrom
feature/public-louis
Open

Add RAG chatbot (Pixel) and admin config panel#3754
yiilinzhang wants to merge 23 commits intomasterfrom
feature/public-louis

Conversation

@yiilinzhang
Copy link
Copy Markdown
Contributor

Description

Adds a new RAG-powered course chatbot (Pixel) for Academy pages, an admin panel for configuring Pixelbot prompts.

Changes

Before After
No course-level chatbot Pixel chatbot on Academy pages with RAG-powered responses
No admin config for chatbot prompts Pixelbot Settings tab in admin panel
Chatbot fixed position Draggable chatbot with minimize/maximize
Plain text responses Markdown-rendered responses (code, tables, lists)

Key changes

  • src/commons/application/types/SessionTypes.ts — Added pixelbotRoutingPrompt, pixelbotAnswerPrompt, feedbackUrl to session and course config types
  • src/commons/sagas/RequestsSaga.ts — Added getPixelbotDocumentMap API call
  • src/features/ragChat/api.ts — New API layer for RAG chat (initRagChat, sendRagMessage)
  • src/pages/sicp/subcomponents/chatbot/ChatBox.tsx — Added expand/collapse support
  • src/pages/sicp/subcomponents/chatbot/Chatbot.tsx — Made draggable
  • src/pages/academy/adminPanel/AdminPanel.tsx — Added Pixelbot Settings tab with new config fields
  • src/pages/academy/adminPanel/subcomponents/PixelbotConfigPanel.tsx — New admin panel for routing/answer prompts and feedback URL
  • src/pages/academy/ragChatbot/RagChatBox.tsx — New chat UI with markdown rendering for RAG responses

Type of change

  • New feature (non-breaking change which adds functionality)

How to test

  1. Log in and open Source Academy
  2. Click on Pixel chatbot in bottom-right corner
  3. Send messages to Pixel like "What was covered in week 1" and "Give me some past year practice questions" to test it out
  4. Click on code blocks in a response to check out new playgrund integration
  5. Go to Admin Panel → Pixelbot Settings — Edit routing prompt, answer prompt, document map, and feedback URL fields here

Checklist

  • I have tested this code

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces 'Pixelbot,' a RAG-based chatbot for the Academy platform, which includes a draggable chat interface, new API endpoints, and an admin configuration panel for managing prompts and feedback URLs. The existing SICP chatbot was also refactored to support expansion and draggability. Feedback focuses on improving Markdown rendering by utilizing ReactMarkdown components instead of manual regex parsing and preventing a potential infinite loop in the configuration panel by selecting individual token fields for the useEffect dependency array.

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.

2 participants