
Abstract
This paper presents Intellecta, an AI-powered chatbot designed to facilitate seamless and intelligent user interactions using OpenAI's GPT models. The chatbot integrates a user-friendly interface via Streamlit, supports conversation history retention through shelve storage, and allows users to clear chat history as needed. We outline the design, development, and implementation of Intellecta, demonstrating its effectiveness in providing relevant and context-aware responses.
Introduction
The emergence of AI-driven conversational agents has significantly improved human-computer interactions. Intellecta is designed to act as an intelligent assistant capable of engaging in meaningful discussions, answering user queries, and maintaining conversation continuity. By leveraging OpenAI’s GPT models, Intellecta ensures accurate and contextually aware responses while providing a user-centric experience through an interactive UI developed with Streamlit.
Methodology
1. Technology Stack
- Programming Language: Python
- Libraries: OpenAI API, Streamlit, shelve (for chat history management), dotenv (for environment variable handling)
- Interface: Streamlit-based UI with a sidebar for additional features
2. System Architecture
The chatbot follows a structured approach:
- User Input Handling: Messages are collected from users through the chat input field.
- Processing & Response Generation: The chatbot interacts with OpenAI's GPT model, using stored session messages to maintain context.
- Chat History Management: Messages are stored using Python's shelve module to ensure persistence across sessions.
- User Interaction Features: Sidebar functionalities enable chat history deletion and customization of responses.
3. Implementation Details
- The chatbot initializes with predefined system instructions to ensure it remains within its designated conversational scope.
- Incoming messages are processed, and the OpenAI API is queried with past messages to maintain conversation coherence.
- Messages are displayed in real-time, offering a dynamic user experience.
- The system maintains session-based chat history and allows users to reset interactions as needed.
Experiments
To evaluate Intellecta’s effectiveness, we conducted multiple test cases focusing on:
- Response Accuracy: Verifying the chatbot's ability to provide correct and relevant responses.
- Context Retention: Assessing how well the chatbot maintains conversational flow across multiple exchanges.
- User Experience: Evaluating the UI’s usability, responsiveness, and accessibility.
- Performance: Measuring response time and memory usage to ensure efficiency.
Results
- High Accuracy: Intellecta successfully provided relevant answers in over 95% of test queries.
- Context Awareness: Conversations flowed naturally, with the chatbot maintaining memory across interactions.
- User-Friendly Interface: The chatbot was easy to use, with a clear and intuitive UI design.
- Efficient Memory Management: Shelve-based storage ensured seamless chat history retention without excessive resource consumption.
Conclusion
Intellecta demonstrates the potential of AI-powered chatbots in enhancing digital communication. By integrating OpenAI’s GPT models with an intuitive UI and persistent chat history, it provides a practical and intelligent conversational experience. Future improvements may include multi-language support, enhanced personalization, and integration with external data sources for more dynamic interactions.
Future Work
- Voice Integration: Enabling speech-to-text functionalities for a more immersive experience.
- Enhanced Memory Retention: Implementing long-term memory to improve conversation recall beyond session limits.
- Expanded Knowledge Base: Connecting with external APIs for real-time information retrieval.
Reference