Skip to content

Enhance chat functionality with response mode toggle#61

Merged
NeonDaniel merged 15 commits into
devfrom
feat/Different-Response-Modes
Jun 9, 2026
Merged

Enhance chat functionality with response mode toggle#61
NeonDaniel merged 15 commits into
devfrom
feat/Different-Response-Modes

Conversation

@NeonRyan

@NeonRyan NeonRyan commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Description

Implements a "Generalized" response mode that synthesizes multiple advisor responses into a single cohesive answer. Users can toggle between individual advisor responses (Panel) and a unified synthesis (Generalized) per exchange.

Frontend

  • Response mode toggle in EnhancedChatInput to switch between Panel and Generalized modes
  • ChatPage wired to pass response_mode to /chat-stream and handle synthesizing progress events, aggregated advisor events, and deferred panel rendering
  • On-demand synthesis via Panel/Generalized toggle (above each Persona reply) calls new /synthesize endpoint for exchanges that don't yet have an aggregated response
  • Synthetic "Generalized" persona defined in AppConfigContext for avatar/color rendering
  • Reply and Expand buttons hidden on aggregated messages — these endpoints require a registered backend persona, and the "Generalized" Persona is synthetic
  • "Generalized" persona filtered from Settings (Advisors and Model tabs)

Backend

  • PersistMessage extended with response_group_id, is_aggregated, source_personas fields and model validator
  • ChatMessage extended with response_mode field ("panel" | "aggregated")
  • synthesize_aggregated_response orchestrator method merges panel results using COMPACT_MARKDOWN_V1 formatting
  • /chat-stream aggregated branch: generates panel responses, persists and yields them, then synthesizes and yields a single aggregated response
  • New /synthesize POST endpoint for on-demand synthesis with validated SynthesizeRequest model
  • Unit tests for schema validation, orchestrator synthesis, and request models

Issues

Closes #50

Other Notes

  • The Generalized persona (persona_id: "aggregated") is synthetic — not registered as a backend advisor. Its display name, icon, and colors are defined in AppConfigContext.js.
  • Synthesis token limits (800/1500/2400) are intentionally higher than individual advisor limits to accommodate merging multiple perspectives.
  • _event_generator in /chat-stream has a TODO for refactoring into smaller composable helpers as this endpoint is very long and difficult to parse.
  • Message count in the sidebar includes all stored messages (panel + aggregated). There isn't a straightforward way to address this as the current message count is based on the number of messages persisted to the DB, and both "Panel" and "Generalized" messages get persisted. A future improvement could count user exchanges instead of messages to address this issue.

@NeonDaniel NeonDaniel changed the base branch from main to dev May 19, 2026 00:47
@NeonDaniel NeonDaniel added this to the 2.1 milestone May 19, 2026
NeonRyan added 2 commits June 5, 2026 14:40
- Added a response mode toggle in EnhancedChatInput to switch between 'panel' and 'aggregated' response modes.
- Updated ChatPage to manage response mode state and handle message synthesis in aggregated mode.
- Enhanced advisor avatar handling in MessageBubble for improved visual representation.
- Updated AppConfigContext to include a synthetic persona for aggregated responses.

This update improves user experience by allowing for a more cohesive response from advisors.
- Enhanced ChatPage to persist user-selected response mode ('panel' or 'aggregated') across sessions using localStorage.
- Introduced functionality for on-demand synthesis of advisor responses, allowing users to toggle between individual and aggregated views for specific exchanges.
- Added error handling for streaming chat responses and improved state management for group views and synthesizing groups.

This update enhances user experience by providing a more flexible and cohesive chat interaction.
@NeonCharlie-24 NeonCharlie-24 force-pushed the feat/Different-Response-Modes branch from 21dee62 to 607e63f Compare June 5, 2026 22:04
@NeonCharlie-24 NeonCharlie-24 marked this pull request as ready for review June 8, 2026 19:59
@NeonCharlie-24 NeonCharlie-24 requested review from NeonCharlie-24 and NeonDaniel and removed request for NeonCharlie-24 June 8, 2026 19:59
@NeonDaniel

Copy link
Copy Markdown
Member

Couple UI quirks for @NeonRyan

  • Can the text entry switch match the one shown above replies? It is more understandable IMO to have both options shown with one selected vs. showing only the active mode.
  • As mentioned on Matrix, I would like to consider a different term than "Generalized" to describe the non-Panel response mode.

Comment thread multi_llm_chatbot_backend/app/api/routes/chat.py Outdated
Comment thread multi_llm_chatbot_backend/app/core/improved_orchestrator.py Outdated
Comment thread phd-advisor-frontend/src/components/EnhancedChatInput.js Outdated
Comment thread phd-advisor-frontend/src/components/EnhancedChatInput.js Outdated
Comment thread phd-advisor-frontend/src/contexts/AppConfigContext.js Outdated
@NeonCharlie-24 NeonCharlie-24 requested a review from NeonDaniel June 8, 2026 22:34
@NeonDaniel NeonDaniel merged commit 5201460 into dev Jun 9, 2026
3 checks passed
@NeonDaniel NeonDaniel deleted the feat/Different-Response-Modes branch June 9, 2026 16:12
@NeonDaniel NeonDaniel mentioned this pull request Jun 9, 2026
NeonDaniel added a commit that referenced this pull request Jun 10, 2026
# Changelog
  
## [2.0.1a11](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a11)
(2026-06-09)
  
[Full
Changelog](2.0.1a10...2.0.1a11)
  
  **Fixed bugs:**
  
- \[BUG\] Disable all advisors button throwing 400 error
[\#83](#83)
  
  **Merged pull requests:**
  
- Fix/disable all error
[\#84](#84)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
  
## [2.0.1a10](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a10)
(2026-06-09)
  
[Full
Changelog](2.0.1a9...2.0.1a10)
  
  **Fixed bugs:**
  
- \[BUG\] Advisor images are broken in production
[\#79](#79)
  
  **Merged pull requests:**
  
- fixed path for bundled avatar URIs.
[\#82](#82)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
  
## [2.0.1a9](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a9)
(2026-06-09)
  
[Full
Changelog](2.0.1a8...2.0.1a9)
  
  **Implemented enhancements:**
  
- \[FEAT\] Different Response Modes
[\#50](#50)
  
  **Merged pull requests:**
  
- Enhance chat functionality with response mode toggle
[\#61](#61)
([NeonRyan](https://github.com/NeonRyan))
  
## [2.0.1a8](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a8)
(2026-06-05)
  
[Full
Changelog](2.0.1a7...2.0.1a8)
  
  **Implemented enhancements:**
  
- \[FEAT\] Filter available LLM Backends based on config
[\#71](#71)
- \[FEAT\] Support "Hybrid" model selection
[\#51](#51)
  
  **Merged pull requests:**
  
- Feat/support hybrid model selection rebase
[\#80](#80)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
  
## [2.0.1a7](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a7)
(2026-05-30)
  
[Full
Changelog](2.0.1a6...2.0.1a7)
  
  **Implemented enhancements:**
  
- \[FEAT\] Move all message persistence from frontend to backend
[\#46](#46)
  
  **Merged pull requests:**
  
- persist advisor responses to db in /chat-stream endpoint.
[\#78](#78)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
  
## [2.0.1a6](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a6)
(2026-05-29)
  
[Full
Changelog](2.0.1a5...2.0.1a6)
  
  **Implemented enhancements:**
  
- \[FEAT\] Support BrainForge LLM Backend
[\#49](#49)
  
  **Merged pull requests:**
  
- BrainForge LLM Integration
[\#62](#62)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
  
## [2.0.1a5](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a5)
(2026-05-29)
  
[Full
Changelog](2.0.1a4...2.0.1a5)
  
  **Implemented enhancements:**
  
- \[FEAT\] Evaluate old\_routes.py for deprecation
[\#74](#74)
  
  **Merged pull requests:**
  
- deprecated old\_routes.py
[\#77](#77)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
  
## [2.0.1a4](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a4)
(2026-05-28)
  
[Full
Changelog](2.0.1a3...2.0.1a4)
  
  **Implemented enhancements:**
  
- \[FEAT\] Disable Specific Personas
[\#64](#64)
- \[FEAT\] User Tutorial
[\#29](#29)
  
  **Merged pull requests:**
  
- Disable Specific User Personas
[\#65](#65)
([NeonRyan](https://github.com/NeonRyan))
  
## [2.0.1a3](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a3)
(2026-05-21)
  
[Full
Changelog](2.0.1a2...2.0.1a3)
  
  **Merged pull requests:**
  
- Add Onboarding tour
[\#48](#48)
([NeonRyan](https://github.com/NeonRyan))
  
## [2.0.1a2](https://github.com/NeonGeckoCom/CCAI-Demo/tree/2.0.1a2)
(2026-05-19)
  
[Full
Changelog](33862e6...2.0.1a2)
  
  **Implemented enhancements:**
  
- \[FEAT\] Clear User Data
[\#52](#52)
- \[FEAT\] Support tools
[\#34](#34)
- \[FEAT\] Add endpoint and UI for User Account updates
[\#26](#26)
- \[FEAT\] Support advisor avatar images
[\#25](#25)
- \[FEAT\] Configurable User Guide
[\#24](#24)
- \[FEAT\] Support vLLM endpoints
[\#22](#22)
- \[FEAT\] Improved persona configuration handling
[\#8](#8)
- \[FEAT\] Implement automatic color picker for personas
[\#7](#7)
- \[FEAT\] Validate configured icons
[\#6](#6)
- \[FEAT\] Improved Checks for "Clarification Needed"
[\#5](#5)
- \[FEAT\] Versioning and release automation
[\#4](#4)
  
  **Fixed bugs:**
  
- \[BUG\] Deleting a chat in the UI causes an empty chat to be created
[\#45](#45)
- \[BUG\] User inputs are sometimes repeated
[\#42](#42)
- \[BUG\] Improved method for LLM JSON Generation
[\#13](#13)
  
  **Closed issues:**
  
- Pin the requirements.txt to stable versions
[\#37](#37)
  
  **Merged pull requests:**
  
- feat/Added front end support for settings page
[\#60](#60)
([NeonRyan](https://github.com/NeonRyan))
- Clear User Data
[\#58](#58)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Feat/improve clarification check
[\#57](#57)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- UI Improvements
[\#56](#56)
([NeonRyan](https://github.com/NeonRyan))
- Fix bug around chat deletion
[\#54](#54)
([NeonRyan](https://github.com/NeonRyan))
- Add User Guide
[\#53](#53)
([NeonRyan](https://github.com/NeonRyan))
- Add versioning automation
[\#47](#47)
([NeonDaniel](https://github.com/NeonDaniel))
- Fix/dup first message
[\#44](#44)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Feat/persona avatars
[\#43](#43)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Feat/account management
[\#41](#41)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Fix/json output
[\#40](#40)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Feat/advisor tools
[\#38](#38)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Feat/vllm endpoints
[\#36](#36)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Refactor/unittests
[\#33](#33)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Support Voice Interaction
[\#32](#32)
([NeonDaniel](https://github.com/NeonDaniel))
- Fix/structured json output
[\#30](#30)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Feat/auto persona colors
[\#23](#23)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Feat/validate lucide icons
[\#21](#21)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Initial setup of GitHub Actions workflow
[\#20](#20)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Refactor chat UI layout
[\#19](#19)
([NeonDaniel](https://github.com/NeonDaniel))
- Stream LLM Responses
[\#18](#18)
([NeonDaniel](https://github.com/NeonDaniel))
- Feat/improve persona config
[\#16](#16)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Add Neon AI Branding
[\#15](#15)
([NeonDaniel](https://github.com/NeonDaniel))
- Docs/update readme repo URL
[\#14](#14)
([NeonCharlie-24](https://github.com/NeonCharlie-24))
- Improve backend logic around user input parsing
[\#12](#12)
([NeonDaniel](https://github.com/NeonDaniel))
- Fix Home navigation to prevent logging out
[\#11](#11)
([NeonDaniel](https://github.com/NeonDaniel))
- Add configuration for Undergrad Advisor Panel
[\#10](#10)
([NeonDaniel](https://github.com/NeonDaniel))
- Add configuration support
[\#3](#3)
([NeonDaniel](https://github.com/NeonDaniel))
- Docker optimization by Cursor
[\#2](#2)
([NeonDaniel](https://github.com/NeonDaniel))
- Implement Docker deployment
[\#1](#1)
([NeonDaniel](https://github.com/NeonDaniel))
  
  
  
\* *This Changelog was automatically generated by
[github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
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.

[FEAT] Different Response Modes

3 participants