Dave J and I spoke today and one of the final items remaining before launch is polishing Dave’s AI chat Plugin. Going to speak to Matt H and see if he’s up for shifting his attention off of search and to working on this instead. PRD below:
1. Overview
The goal is to deliver a polished, reliable, and intuitive AI text chat experience that is competitive with other leading AI chat UIs. This is a core part of the BrainDrive launch readiness. The chat interface must feel smooth, be bug-free, and demonstrate potential for extensibility.
2. Objectives
Ensure that first-time users can immediately start chatting with a model without encountering quirks or confusion.
Achieve a fluid and responsive UI that meets user expectations for modern AI chat systems.
Implement expected control features (stop, continue, regenerate).
Support smooth reading during generation and improve context-handling functionality.
Lay the groundwork for easy future enhancements like Chat with Documents, link scraping, and file attachment.
Ensure model selection and switching works reliably, with clear indication of which model is active.
Provide a way to start a new conversation without reloading (e.g., “New Chat” button).
3. Scope & Requirements
3.1 Functional Requirements
Smooth Streaming Output
Display responses token-by-token or in small batches so the user can read while the AI is generating.
Ability to scroll during generation so BrainDrive Owners can scroll while text is generating.
User Controls
Stop: Cancel ongoing generation.
Continue: Resume generation if the response was cut off due to token limits.
Regenerate: Re-run the last prompt for an alternative answer.
Context Enhancements
Recognize or similar tags and collapse them into an accordion by default (click to expand).
Improve markdown rendering to handle:
Code blocks with syntax highlighting.
Block quotes.
Lists and bold/italic formatting.
Search Integration (Future-ready)
Preserve compatibility with planned chat search functionality.
Attachment & Scraping Hooks (Optional for Launch)
Ability to add files as context (integration with Chat with Documents when ready). (Beck Project Owner for this feature)
Ability to paste a URL and have system fetch & parse page content into context (for future implementation).
Session Management
“New Chat” option that clears conversation context without reloading the full app.
Model Switching UX
Clearly display the current model name in the chat UI.
Ensure switching models mid-session works without errors or leftover cached responses.
Loading & Error States
Show a visual indicator during generation (spinner/progress dots).
Display a friendly, actionable error message if generation fails.
Accessibility & Keyboard Shortcuts
Enter to send, Shift+Enter for newline, Esc to stop generation.
Maintain focus on the input box after actions.
3.2 Non-Functional Requirements
Must work reliably across major browsers (Chrome, Firefox) and OSes (Windows, Ubuntu, Mac).
Lightweight and responsive on reasonable hardware.
Maintainable structure with documented hook points for future feature additions (attachments, scraping, prompt library integration).
4. Deliverables
Updated AI chat plugin with above functional improvements.
Clean, maintainable code that’s easy for other developers to extend.
Internal test cases covering:
Generation streaming.
Stop/Continue/Regenerate behavior.
Accordion handling for tags.
Markdown rendering correctness.
Model switching and new chat workflow.
Easy-to-follow documentation for developers who wish to modify or extend the plugin.
5. Out of Scope for This Iteration
Full Chat with Documents implementation (bonus if ready).
Full link scraping integration (planned for later).
Mobile UI optimizations (on roadmap but not launch-blocking).
6. Dependencies
Backend model streaming support.
Existing plugin framework for chat.
Beck’s work on Chat with Documents for attachment integration (if included).
7. Acceptance Criteria
User can type a message and see a smooth, streaming AI response.
User can stop, continue, and regenerate responses.
content appears collapsed with the ability to expand.
Markdown formatting displays correctly for common patterns.
No UI bounce or lost focus during/after generation.
Works across Chrome, Firefox, Mac, and Windows.
Switching models mid-session works without errors and updates the UI.
“New Chat” creates a fresh session without requiring reload.
Loading and error states are clear and informative.
Thanks Matt! I’ve merged this with the running Chat Plugin Polishing post we have to keep things easily reviewable for anyone who wants to see the progress of this project.
@DJJones FYI we can discuss in our call later today and I’ll post the recording here for everyone as well.
Questions, comments, issues, and ideas welcome as always. Just hit the reply button.
I added a commit for the rest of the requirements missing.
I was able to install all parts and this is what I found to be missing thus far:
Chat History: Accordion can be dropped off the page (I thought we discussed collapsed up and down?)
Persona’s not exposed in the chat window and still hidden by a menu
Web Search and Document upload need to be hidden (still exposed, since work not finished and for current state of prodections)
Top bar not able to be collapsed
Continued functionality, creates a new chat box instead of using the current one.
I have noticed chats are causing a new history with each response, I am not sure of the cause of this but I have already put it on my plate for this week.
Since I clean up the requirements and the backend worked in testing I went ahead and merged the PR into the Core. (This is just some of the backend changes needed, not the frontend)
I merged the second part of this work, in the plugin itself as well.
Additional information:
I also did a fix and merge yesterday in the core that appears to clean up how chat history was being created. The issue was when streaming the user id was not being parsed correctly.
Changes in 1.0.17
Now uses the API for all models to allow access to other LLM providers (Currently tested with Ollama and Openrouter).
Layout changed: Model, Persona and Chat History are all moved to the header
Input box is now dynamic, only shows a single line initially but will expand to 4 lines then a scrollbar as needed based on text.
Future changes:
I want to clean up the dropdowns, this can clearly look a lot more polished. I also think we need to move away from the single dropdown on the header to allow for searching based on typed input because just adding Openrouter alone created a long list. This can happen to Persona and Chat History as well in the future.
@DJJones the two main thinking models that are small enough to run on ollama are qwen and deepseek and thinking UX is working properly on both so I think we are good on this for now and we will address other models as they come.
Good morning @DJJones. Here’s what I’m thinking for the intro message when people first login to BrainDrive. Let me know what you think at your convenience.
Thanks,
Dave W.
Welcome to your BrainDrive!
If you see AI models in the models dropdown above you are ready to start chatting.
If not, the next step is to set up your AI models.
Sounds good, I am wondering if down below where we have the AI warning label, why not add those two links there as well. This way no matter where you are in BrainDrive owners will have instant access to the manual and community links?
In today’s Dev call livestream Dave J. showed off the BrainDrive AI chat plugins new content augmented generation (CAG) feature. This allows you to upload a document and your BrainDrive will parse the document and allow you to chat with the contents of that document, 100% locally on your own computer, without even needing an internet connection.
In addition you can decide wether or not you want to commit the contents of the document to the chat history or not. If you want the full document in the chat history you can choose to have it. If on the otherhand you only need a portion of the document included in the context of your chat, then you can use the “one shot” functionality instead.
This functionality is especially useful in a local AI system like BrainDrive where the context window of smaller models can become an issue.
Recording below. If you give it a try let us know what you think!