This repository contains the code for the GPT project. ubiubiubiub jndoueno
This is an implementation of RAG using Ollama + Langchain and some custom heuristics implemented in Typescript. It's a CLI app that is built into a platform-specific binaries that can be run alongside Ollama independently.
- Wiki Article RAG: Point the application to a Wikipedia article and this will download it, digest it and store it in a Vector DB.
- Bun
This project uses Bun v1.1.7 as the TS runtime - Ollama
It connects to Ollama to access the LLMs. Ollama needs to be running in the background (http://127.0.0.1:11434) and have the following models installed:- llama3 (8B)
- nomic-embed-text
To use the GPT, follow these steps:
bun install
macOS
bun build:mac
Linux
bun build:lin
Windows
bun build:win
macOS
./dist/mac/gpt
Linux
./dist/lin/gpt
macOS
./dist/win/gpt.exe
gpt rag -w <the Wikipedia article link> -q <the prompt to be answered about the article> -o <the output location of the vector database>
This will download and parse the article, which depending on the length might take up to 40 minutes. This will then be stored under the provided output location. If there is a matching vector database under the provided output location for the given Wikipedia article, that will be used directly.
In order to be able to view into the parsing and digestion process of the article, you can add the --verbose
flag.
You can get some more information about the command by executing:
gpt rag --help
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.