RAG App is a Python-based application designed to enhance natural language understanding by incorporating document (PDF/CSV) retrieval capabilities. It uses Retrieval-Augmented Generation (RAG) to answer queries based on private and previously unseen document collections, enabling accurate and contextual responses.
- Clone the repository:
git clone https://github.com/aliosmankaya/rag-app.git cd rag-app
- Install dependencies using Poetry:
poetry install
📦 rag-app
├─ .gitignore
├─ LICENSE
├─ README.md
├─ assets
│ └─ image.webp
├─ main.py
├─ poetry.lock
├─ pyproject.toml
├─ settings.toml
└─ src
├─ __init__.py
├─ api
│ ├─ __init__.py
│ ├─ db.py
│ ├─ file.py
│ ├─ model.py
│ └─ search.py
├─ config.py
├─ core
│ ├─ __init__.py
│ ├─ db.py
│ ├─ file.py
│ └─ model.py
└─ parser
├─ __init__.py
├─ db.py
├─ file.py
├─ model.py
└─ search.py
-
Run the Application:
python main.py
-
File Operations:
- Upload File
- POST /upload
- Upload a file with multipart/form-data (PDF/CSV).
- Response: { "Uploaded successfully." }
- POST /upload
- List Files
- GET /list
- Retrieve all uploaded files.
- Response: [ *files ]
- GET /list
- Update File
- PUT /update
- Update an existing file with multipart/form-data.
- Response: { "Updated successfully." }
- PUT /update
- Delete File
- DELETE /delete
- Delete a file.
- Response: { "Deleted successfully." }
- DELETE /delete
- Upload File
-
Database Operations:
- Create Vector DB Collection
- POST /create
- Create a vector database collection.
- Response: { "Created successfully." }
- POST /create
- Insert File to Collection
- POST /insert
- Insert embeddings of the file to the collection.
- Response: { "Inserted successfully." }
- POST /insert
- List Collections
- GET /list
- Retrieve all uploaded collections.
- Response: [ *collections ]
- GET /list
- Update Collection
- PUT /update
- Update an existing collection.
- Response: { "Updated successfully." }
- PUT /update
- Delete Collection
- DELETE /delete
- Delete a collection.
- Response: { "Deleted successfully." }
- DELETE /delete
- Create Vector DB Collection
-
Search:
- Search relevant chunks (part of the file)
- POST /search
- Search with a query on the file.
- Response: [ *chunks ]
- POST /search
- Search relevant chunks (part of the file)
-
Model:
- Question answering powered by a LLM model using RAG
- POST /model
- Asking question about the file and answering by a LLM.
- Response: { "..." }
- POST /model
- Question answering powered by a LLM model using RAG
- Modify
settings.toml
to adjust retrieval or generation parameters. - Update
pyproject.toml
for dependency management.
Contributions are welcome! Please submit issues or feature requests via GitHub's issue tracker.
This project is licensed under the Apache 2.0 License.
Feel free to modify or add more specific instructions if needed!