This project is a full-stack AI-powered platform for document upload, search, and analysis. It combines FastAPI (Python backend), a modern frontend, and several AI/ML and database components (Weaviate, MySQL, Redis, Ollama, etc.) to provide semantic search, chunking, embedding, and LLM-based question answering over uploaded documents.
- FastApiBackend: content all of the backend code including authentication logic, retreival logic and database setup.
- test1: content all of the frontend code with interface setup the styling is with inline styling for easier modification
- diagram: content all of the system flow charts
- Backend: FastAPI (Python)
- Frontend: (React/Vue/Other) (Check
frontend
folder for details) - Database: MySQL (for metadata), Redis (for caching), Weaviate (vector DB)
- LLM/Embedding: Ollama, LangChain, Nomic Embed, OpenAI, Google GenAI
- Others: Docker, Docker Compose, NLTK, SQLAlchemy, Pydantic
Before setting up the project, make sure you have the following dependencies installed and setup on your machine:
- Python (required for the backend code Steps)
- Nodejs (required for the frontend code Steps)
- Docker Desktop (including Docker Compose)
- Git (for cloning the repository)
- NVIDIA GPU and drivers (required for GPU-accelerated LLMs and embeddings, make sure cuda is installed and setup properly Steps)
- Sufficient RAM (at least 6GB recommended for all services to run smoothly)
- Docker Hub account (if you want to push/pull images)
- Ollama (for local llm usage, make sure nomic-embed-text is install in your ollama)
- Test documents (for testing purposes, can download from arxiv with the provided scripts or other sources)
git clone <repo-url>
cd FYP_final
Create a .env file in the FastApiBackend folder with the setting below, the value should follow your device settings and the docker service setup
DB_HOST
DB_PORT
DB_USER
DB_PASSWORD
DB_NAME
SECRET_KEY
ALGORITHM
ACCESS_TOKEN_EXPIRE_MINUTES
REDIS_HOST
REDIS_PORT
FRONTEND_ADDRESS
DEPLOYMENT_MODE
docker-compose build
docker-compose up
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000/docs
cd FastApiBackend
pip install -r requirement.txt
cd test1
npm install
Need to change from docker deployment environment to local development environment
Example:
api_endpoint="http://host.docker.internal:11434"
To
api_endpoint="http://localhost:11434"
Important
Do not change the docker.internal path in the def CollectionCreation() function in the preprocessing.py file
uvicorn ApiEndPoint:app --reload
npm start