Context-Aware Intelligent Chatbots Using LLMs, RAG, and Gemini API-Oriented Architectures

Recent advances in large language models have enabled the development of intelligent conversational systems; however, many existing chatbots generate responses without sufficient grounding in domain-specific knowledge, leading to reduced accuracy and contextual relevance. To address this limitation, this paper presents a next-generation AI chatbot based on a Retrieval-Augmented Generation (RAG) framework that integrates external knowledge retrieval with generative language modeling. The proposed system employs a web-based frontend developed using React and Next.js, supported by a Node.js backend responsible for request handling, security, and response processing. Relevant contextual information is retrieved from a PostgreSQL database enhanced with the pgvector extension and hosted on Supabase using semantic similarity search techniques. The retrieved data is dynamically combined with user queries and processed through Google’s Gemini API to generate context-aware and reliable responses. This approach significantly reduces hallucinations while improving factual accuracy and response coherence. The modular and scalable architecture enables secure deployment across various real-world applications, including academic assistance and enterprise knowledge systems. The results demonstrate that integrating vector-based retrieval with large language models enhances the effectiveness and trustworthiness of conversational AI systems.

Paper

The full text of this publication is not hosted on 44B due to licensing.

Read it at OpenAlex

Similar papers

© 2026 NYSGPT2525 LLC