### ROLE
You are an expert Software engineer highly knowledgable in web technologies like HTML, Javascript, Bootstrap, “Material Design for Bootstrap” etc., and also Python development, including its core libraries, popular frameworks like Django, Flask and FastAPI. You excel at selecting the best tools for each task, always striving to minimize unnecessary complexity and code duplication. You always seek clarification if anything is unclear or ambiguous. You pause to discuss trade-offs and implementation options when choices arise. Your objective is to help me implement a requirement in the most effective way, striking a balance between solving the immediate problem and maintaining flexibility for future use. 

### CONTEXT
I’ve a FastAPI based Uvicorn app called RAGBuilder. Here’s more about RAGBuilder: "RagBuilder is a toolkit that helps you create optimal Production-ready Retrieval-Augmented-Generation (RAG) setup for your data automatically. By performing hyperparameter tuning on various RAG parameters (Eg: chunking strategy: semantic, character etc., chunk size: 1000, 2000 etc.), RagBuilder evaluates these configurations against a test dataset to identify the best-performing setup for your data. Additionally, RagBuilder includes several state-of-the-art, pre-defined RAG templates that have shown strong performance across diverse datasets. So just bring your data, and RagBuilder will generate a production-grade RAG setup in just minutes." 
Here's the current flow: ragbuilder.py -> runs the Uvicorn FastAPI app -> user can click "New project" and provide details of RAG config -> capture all user preferences as a json and send it to backend -> parse_config parses the user inputs and calls executor.rag_builder_bayes_optmization function -> calls configCombos.generate_config_space -> this proceeds to run optuna study.optimize and evaluates multiple configs in the process and stores each evaluation in a database -> user can see a dashboard in the UI and see the evaluated configs and compare performance of multiple configs for their data.


Once a "run" is complete, we show the user all the different RAG configurations that we evaluated as part of the process (`summary.html`). Currently we provide the user with "View details" and "View code snippet" buttons against each configuration. 

Now, we'd like to provide the user with an option to "chat" for each RAG configuration. This means there'll be one additional option next to "View Code snippet" called "Chat". Clicking this button should open up a new chat window where the user can try asking a question. When the user clicks submit after typing in that question, we should use that specific RAG configuration to answer the user's question and show the response.
I'd like you to think step-by-step and come up with a high level design for this new feature.

A few points to consider:
1. The RAG code snippet should ideally be run only once, and then subsequently we should only call `rag_pipeline().invoke("<user question>")`. This is because this snippet involves loading source data, embedding it, indexing it etc.
2. Consider reusing some existing opensource library or framework for the chat UI rather than reinventing the wheel.