Skip to main content

This that I use a lot for workshops, it contains some utils for splitters, tokenizers, and a weaviate client that I reuse a lot

Project description

RAG4P - Retrieval Augmented Generation for Python

Welcome to the repository for our project RAG4P.org. This project is a Python implementation of the Retrieval Augmented Generation framework. It is a framework that is simple to use and understand. But powerful enough to extend for your own projects.

Setting up your environment

Python

We encourage you to use a python environment manager. Poetry makes it easy to use multiple python versions and packages. where you can switch versions per project. Read this Poetry documentation page to learn how to set up your environment. No poetry installed? Read this page to install it for your environment. Poetry installation

Setting the right version of python for the project

poetry env use 3.10

Install dependencies

poetry install

Run the project

poetry run python rag4p/app_step1_chunking_strategy.py

No poetry

Setup your venv

python3 -m venv venv
source venv/bin/activate

Install dependencies

pip install -r poetry-requirements.txt

Loading API keys

We try to limit accessing Large Language Models and vector stores to a minimum. You do not need an LLM or vector store to learn about all the elements of the Retrieval Augmented Generation framework, except for the generation part. In the workshop we use the LLM of Open AI, which is not publicly available. We will provide you with a key to access it, if you don't have your own key.

Please use this key for the workshop only, and limit the amount of interaction, or we get blocked for exceeding our limits. The API key is obtained through a remote file, which is encrypted. Of course you can also use your own key if you have it.

Environment variables

The easiest way to load the API key is to set an environment variable for each required key. In Python we prefer the file .env.properties in the root of the project with the following properties:

openai_api_key=sk-...
weaviate_api_key=...
weaviate_url=...

If you do not have your own key, you can load ours. The key is stored in a remote location. You need the .env.properties file in the root of the project with the following line:

secret_key=...

This secret key is used to decrypt the remote file containing the API keys. We will provide the value for this key during the workshop.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rag4p-0.1.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

rag4p-0.1.0-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file rag4p-0.1.0.tar.gz.

File metadata

  • Download URL: rag4p-0.1.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.4.0

File hashes

Hashes for rag4p-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ee674067eff3e850bd247a76bc2ae459d24a6125d305464de534cf4c8be67e0
MD5 219de5f2c7704f78639652104275b222
BLAKE2b-256 588ac61323aa74dc1fc70ba5fbf8f349c5a455905ec1db3c53b40ee2b0ed399e

See more details on using hashes here.

File details

Details for the file rag4p-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rag4p-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.4.0

File hashes

Hashes for rag4p-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 013d2ff3c4cb25063a7e18f15b5bd0887d08ec3687c4a21845067dbe714e2131
MD5 5f8ccbfbdf4a5ac008f171ec25e2d9dc
BLAKE2b-256 536b6ba293b1ac40dca17352c8a85cc32c24385c443788ecc8494e607a95c10e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page