Skip to content

A full-stack Retrieval-Augmented Generation (RAG) chatbot built with Django and React, allowing users to chat with their documents

License

Notifications You must be signed in to change notification settings

nabobery/Neurality-Take-Home-Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG Chatbot Project

This project implements a Retrieval-Augmented Generation (RAG) chatbot. It consists of a backend built with Django and a frontend built with React.

Project Structure

The project is organized as follows:

  • backend/: Contains the Django backend application.
    • core/: Core Django project settings and configurations.
    • chat/: Django app for handling chat functionalities.
      • services/: Contains the core logic for document processing, embedding, and question answering.
  • frontend/: Contains the React frontend application.
    • components/: React components for the user interface.
  • docker-compose.yml: Defines the services for running the application using Docker.

Prerequisites

Before running the application, ensure you have the following installed:

Running the Application

  1. Clone the repository:

    git clone <your-repository-url>
    cd rag-chatbot
  2. Build and start the services using Docker Compose:

    docker-compose up --build

    This command will:

    • Build the Docker images for the backend and frontend.
    • Start the containers for the backend and frontend.
  3. Access the application:

    • The frontend will be accessible at http://localhost:3000.
    • The backend will be accessible at http://localhost:8000.

Development

Backend

  • Navigate to the backend directory:

    cd backend
  • To run the backend locally without Docker:

    1. Create a virtual environment:

      python -m venv venv
      source venv/bin/activate # On Windows use `venv\Scripts\activate`
    2. Install dependencies:

      pip install -r requirements.txt
    3. Apply migrations:

      python manage.py migrate
    4. Run the development server:

      python manage.py runserver
  • Make changes to the code in the chat app, specifically in the services directory for the core logic.

Frontend

  • Navigate to the frontend directory:

    cd frontend
  • To run the frontend locally without Docker:

    1. Install dependencies:

      npm install
    2. Start the development server:

      npm start
  • Make changes to the code in the src directory, specifically in the components directory for the UI and services for API calls.

Key Components

  • Document Upload: Allows users to upload documents that will be processed by the backend.
  • Chat Interface: Provides a user interface for interacting with the chatbot.
  • Document Processor: Handles the processing of uploaded documents.
  • Embedding Service: Generates embeddings for the documents.
  • QA Service: Uses the embeddings to answer user questions.

Notes

  • The docker-compose.yml file defines the necessary configurations for running the application using Docker.
  • The requirements.txt file in the backend directory lists the Python dependencies for the backend.
  • The package.json file in the frontend directory lists the JavaScript dependencies for the frontend.

Further Development

  • Implement more advanced document processing techniques.
  • Improve the accuracy of the question-answering system.
  • Add more features to the user interface.

About

A full-stack Retrieval-Augmented Generation (RAG) chatbot built with Django and React, allowing users to chat with their documents

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published