## 3 Hypothesis and Functional Specification
### Solution Architecture
Two primary API methods are incorporated: one for generating predictions devoid of context and another employing the Retrieval-Augmented Generation technique to enhance answer accuracy by integrating pertinent documents from the database. The server manages user query preparation, document retrieval, and communication with the VERTEX AI model, with the most relevant literature included when necessary. Figure 1: System Architecture for Scalable and Accurate Contextual Response Generation Using Palm-2 Model. * The SMAC (Subject Matter Assistant Client) application on the client side has been developed using the Next.js framework, which provides a user interface for query input and return presentation. Every question is handled autonomously, ensuring that no record of prior exchanges is retained. The client application aims to enhance user experience using visual components, including a question submission form, response display, and context visualization, which allow users to validate the precision of the model's responses. The main interface components and their functions within the SMAC virtual assistant application are presented in Figure 2. The interface is initiated with the (1) Title and Logo linked to the university's official website, enhancing the user experience by providing a recognizable branding element. A (2) GitHub Link is provided to direct users to the project's GitHub repository, where the source code and technical documentation can be accessed for transparency and further exploration. The question entered by the user is displayed in the User Query field, which initiates interaction with the virtual assistant. In contrast, the response generated by the assistant is shown in the Answer to Query section. The combined input, including context, model instructions, and the user's question, is contained within the (5) Full Query box, which the VERTEX AI API subsequently processes. The literature snippets retrieved using the RAG method are provided by a (6) Source field, ensuring that responses are grounded in contextually relevant information. Instructions regarding the assistant's role and the user's question are incorporated into the (7) Model Query, guiding the model in response generation. Inquiries may be entered by users in the (8) \"Question\" Form, a dedicated text input field, and submitted via the (9) \"Send\" Button, which facilitates the transmission of the query to the server for processing. Finally, the (10) \"Clear\" Button is designed to enable the deletion of the displayed query history from the interface, thereby ensuring that the workspace remains organized and accessible for new interactions. A user-friendly workflow is supported by this comprehensive layout, with engagement enhanced through the virtual assistant while ensuring that responses are both relevant and well documented. Figure 2: SMAC Application Interface: Key Functional Elements and User Interaction Workflow. The efficiency of this architecture was the reason for its selection. PostgreSQL is integrated with a PNG vector for semantic similarity, facilitating accurate information retrieval. The RAG technique improves precision by integrating pertinent materials into model queries, diminishing hallucinations. Rapid processing and an intuitive interface for query submission and return verification facilitate the division of server (Flask) and client (Next.js). The virtual assistant determines the absence of suitable literature by conducting a cosine similarity search within a vector database, where each query is evaluated against a threshold for semantic similarity. Suppose the similarity score falls below this threshold, indicating no sufficiently relevant documents. In that case, the model flags the absence of context and generates a response without specific retrieved information, guiding acquiring additional information instead.