https://github.com/matsjfunke/rag-from-scratch
implemented vector similarity algorithms to understand their inner workings, used local embeddding models
https://github.com/matsjfunke/rag-from-scratch
embeddings large-language-models local-llm ollama python rag vector-similarity
Last synced: 2 months ago
JSON representation
implemented vector similarity algorithms to understand their inner workings, used local embeddding models
- Host: GitHub
- URL: https://github.com/matsjfunke/rag-from-scratch
- Owner: matsjfunke
- Created: 2024-04-18T22:44:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-22T07:20:24.000Z (about 1 year ago)
- Last Synced: 2025-02-02T09:41:31.478Z (4 months ago)
- Topics: embeddings, large-language-models, local-llm, ollama, python, rag, vector-similarity
- Language: Python
- Homepage:
- Size: 11.9 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[More on how I personally think about the algorithms here](ALGORITHMS.md)
# How to run scripts, and experiment
1. **clone repo**
```bash
git clone https://github.com/matsjfunke/rag-from-scratch.git
```
2. **install dependences**
```bash
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
```
3. **run scripts**
- will take some time on the first run because embeddings aren’t cached (have a look at the handle_embeddings() function to understand)
```bash
python dot-product-rag.py
```
5. **tinkering optiions**
- each script contains a main() function this function gives you inside on tweaks you can make
- different data: upload other .txt files in the root dir of the repo and specify thier name in file_name variable of main()
- different prompt: change prompt vairable in main()