This is an AI-powered web application that allows users to upload documents, perform semantic searches using large language models (LLMs), and generate document summaries.
- Document Upload: Upload documents for search and analysis.
- Semantic Search: Perform AI-based contextual searches using LLMs.
- Chat with Documents: Chat with your documents using LLMs.
- Text Summarization: Generate concise summaries of document content.
- User Authentication: Secure login and registration with JWT tokens.
- Backend: Python (FastAPI)
- Frontend: Svelte
- Database: PostgreSQL
- AI Libraries: LangChain, OpenAI
- Containerization: Docker, Docker Compose
-
Clone the repository:
git clone https://github.com/Leg0shii/smart-documents.git cd smart-documents
-
Set up the environment variables in
backend/.env
:FRONTEND_PORT=5000 BACKEND_PORT=8000 SECRET_KEY=your_secret_key OPENAI_API_KEY=your_openai_api_key POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DB=smart_documents POSTGRES_HOST=db POSTGRES_PORT=5432 DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
-
Run the application with Docker:
docker-compose up --build
-
Access the application:
- Frontend:
http://localhost:5000
- Backend:
http://localhost:8000
- Frontend:
- Register/Login: Create an account or log in.
- Upload Documents: Upload your documents for search.
- Perform Search: Use the search bar to find documents with custom top K results.
- Get Summaries: Retrieve summaries of the search results.
To run locally without Docker:
-
Backend:
cd backend pip install -r requirements.txt uvicorn app.main:app --reload
-
Frontend:
cd frontend npm install npm run dev
This project is licensed under the MIT License.