{"id":17930932,"url":"https://github.com/elcaiseri/survey-analysis-rag-system","last_synced_at":"2026-04-12T03:36:06.957Z","repository":{"id":258707992,"uuid":"874455006","full_name":"elcaiseri/Survey-Analysis-RAG-System","owner":"elcaiseri","description":"A web application using Retrieval-Augmented Generation (RAG) to analyze and compare survey datasets. Built with FastAPI, Nginx, and OpenAI’s models. Fully containerized with Docker for easy deployment.","archived":false,"fork":false,"pushed_at":"2024-12-16T00:06:45.000Z","size":638,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T17:16:00.008Z","etag":null,"topics":["ai","docker","docker-compose","fastapi","javascript","machine-learning","nginx","nlp","openai","python","rag","semantic-search","survey-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elcaiseri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-17T21:21:36.000Z","updated_at":"2024-12-30T22:30:41.000Z","dependencies_parsed_at":"2024-12-16T01:28:58.464Z","dependency_job_id":null,"html_url":"https://github.com/elcaiseri/Survey-Analysis-RAG-System","commit_stats":null,"previous_names":["elcaiseri/survey-analysis-rag-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elcaiseri%2FSurvey-Analysis-RAG-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elcaiseri%2FSurvey-Analysis-RAG-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elcaiseri%2FSurvey-Analysis-RAG-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elcaiseri%2FSurvey-Analysis-RAG-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elcaiseri","download_url":"https://codeload.github.com/elcaiseri/Survey-Analysis-RAG-System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244991177,"owners_count":20543627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","docker","docker-compose","fastapi","javascript","machine-learning","nginx","nlp","openai","python","rag","semantic-search","survey-analysis"],"created_at":"2024-10-28T21:18:40.126Z","updated_at":"2026-04-12T03:36:06.902Z","avatar_url":"https://github.com/elcaiseri.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI-Powered Survey Insights\n\n## Project Description\nAI-Powered Survey Insights is a web application that leverages advanced AI models to process and analyze user queries related to two survey datasets using Retrieval-Augmented Generation (RAG). This tool provides actionable insights from:\n\n- **Dataset 1:** Sustainability Research Results\n- **Dataset 2:** Christmas Research Results\n\nThe project consists of:\n\n- **Backend:** A FastAPI-based service that processes user queries and interacts with the OpenAI API.\n- **Frontend:** A simple HTML/CSS/JavaScript interface served using Nginx.\n- **Dockerized Deployment:** Both backend and frontend are containerized for easy deployment using Docker and Docker Compose.\n\n## Table of Contents\n\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Installation and Setup](#installation-and-setup)\n- [Usage Instructions](#usage-instructions)\n- [API Documentation](#api-documentation)\n- [Docker Instructions](#docker-instructions)\n- [Deployment](#deployment)\n- [License](#license)\n- [Acknowledgements](#acknowledgements)\n\n## Features\n\n- **Interactive Query Interface:** Users can ask questions about the survey datasets in natural language.\n- **AI-Generated Insights:** Retrieves precise answers using OpenAI’s models.\n- **Dataset Comparison:** Compare insights between Sustainability and Christmas survey datasets.\n- **User-Friendly Interface:** Clean, intuitive UI for easy interaction.\n- **Dockerized Setup:** Simple container-based deployment with Docker Compose.\n\n## Prerequisites\n\n- **Docker:** Install Docker.\n- **Docker Compose:** Comes bundled with Docker Desktop.\n- **OpenAI API Key:** Obtain an API key from OpenAI.\n\n## Installation and Setup\n\n1. **Clone the Repository:**\n\n\t```sh\n\tgit clone https://github.com/elcaiseri/Survey-Analysis-RAG-System.git\n\tcd Survey-Analysis-RAG-System\n\t```\n\n2. **Set Up Environment Variables:**\n\n\tCreate a `.env` file in the project root:\n\n\t```plaintext\n\tOPENAI_API_KEY=your-openai-api-key\n\tAPP_TOKEN=your-app-token\n\tBACKEND_URL=http://localhost:8000\n\tFRONTEND_URL=http://localhost:5500\n\t```\n\n\t*Note: Replace the placeholders with actual values. Do not commit this file to version control.*\n\n3. **Prepare the Data:**\n\n\tRun the exploratory data analysis script to prepare the datasets:\n\n\t```sh\n\tpython eda.py\n\t```\n\n4. **Build and Run the Containers:**\n\n\tUse Docker Compose to build and start the services:\n\n\t```sh\n\tdocker-compose up --build\n\t```\n\n\tThis will build both the frontend and backend containers and start them.\n\n## Usage Instructions\n\n1. **Access the Application:**\n\n\tOpen your browser and go to `http://localhost:5500`.\n\n2. **Interact with the Application:**\n\n\t- Enter a query in the input field (e.g., “How important is sustainability to consumers?”).\n\t- Select the relevant dataset from the dropdown (Sustainability or Christmas).\n\t- Click **Get Insights** to submit your query.\n\n3. **View Results:**\n\n\t- The AI-generated response will be displayed below the form.\n\t- If there’s an error, it will be shown in the error message section.\n\n## API Documentation\n\nThe backend exposes a POST endpoint for querying datasets.\n\n- **Endpoint:** `/query`\n- **Method:** POST\n- **Description:** Processes a user query and returns AI-generated insights.\n\n**Request Body Example:**\n\n```json\n{\n  \"query\": \"How important is sustainability to consumers?\",\n  \"dataset\": \"sustainability\"\n}\n```\n\n**Response Example:**\n\n```json\n{\n  \"answer\": \"Sustainability is highly important to consumers, with 75% preferring eco-friendly products.\"\n}\n```\n\n**Error Handling:**\n\n- If the request fails, the API returns an appropriate HTTP status code and an error message.\n\n## Docker Instructions\n\n### Building and Running the Containers\n\n1. **Build the Docker Containers:**\n\n\t```sh\n\tdocker-compose build\n\t```\n\n2. **Start the Containers:**\n\n\t```sh\n\tdocker-compose up\n\t```\n\n3. **Run in Detached Mode (Optional):**\n\n\t```sh\n\tdocker-compose up -d\n\t```\n\n### Stopping the Containers\n\n```sh\ndocker-compose down\n```\n\n### Rebuilding After Code Changes\n\nIf you make changes to the code, rebuild the containers:\n\n```sh\ndocker-compose up --build\n```\n\n## Deployment\n\nTo deploy the application to a production environment, consider using one of these services:\n\n- **AWS Elastic Beanstalk**\n- **Google Cloud Run**\n- **Azure App Service**\n- **Heroku**\n\n### Deployment Checklist:\n\n- Securely manage environment variables (e.g., using AWS Secrets Manager).\n- Configure CORS policies to allow frontend-backend communication.\n- Use HTTPS in production to ensure secure data transmission.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n\n## Acknowledgements\n\n- **OpenAI:** For providing the API and language models.\n- **FastAPI:** For the robust and lightweight web framework.\n- **Docker:** For containerization and simplified deployment.\n- **Nginx:** For serving static files efficiently.\n- **Community Resources:** Tutorials and documentation that helped shape this project.\n\nFeel free to contribute to this project by opening issues or submitting pull requests. If you have any questions, contact us at iqasem4444@gmail.com.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felcaiseri%2Fsurvey-analysis-rag-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felcaiseri%2Fsurvey-analysis-rag-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felcaiseri%2Fsurvey-analysis-rag-system/lists"}