Skip to main content

A modular Python package for implementing Retrieval Augmented Generation chains for the chATLAS project.

Project description

chATLAS_Chains

This package implements and benchmarks various Retrieval Augmented Generation (RAG) chains for use in the chATLAS project.

Installation

conda create -n venv chatlas_chains_env python=3.10
conda activate chatlas_chains_env
pip install chatlas-chains

Environment variables

These are required for the following use cases

  1. Using an OpenAI LLM
export CHATLAS_OPENAI_KEY='your api key'
  1. Benchmarking, set the path to the question set
export CHATLAS_BENCHMARK_QUESTIONS=/path/to/questions.josn

Available Chains

  • chains.basic.basic_retrieval_chain
  • chains.basic_graph.basic_retrieval_graph

Benchmarking

To benchmark e.g. the chains in chATLAS_Chains.chains.basic run this from the project root

python benchmark/basic.py

Testing

The tests require a running postgres server to work. If on lxplus you can modify TEST_DB_CONFIG in tests/conftest.py to connect to the chATLAS server.

If you want to create a local dummy postgres server, you need to install psql. This can be done on macOS using homebrew:

Software install

brew install postgresql
brew services start postgresql
brew install pgvector
brew unlink pgvector && brew link pgvector

Create a user

psql -h localhost -U postgres
ALTER USER postgres WITH PASSWORD 'Set_your_password_here';
CREATE EXTENSION IF NOT EXISTS vector;

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

chatlas_chains-0.1.2.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chatlas_chains-0.1.2-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file chatlas_chains-0.1.2.tar.gz.

File metadata

  • Download URL: chatlas_chains-0.1.2.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for chatlas_chains-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2c47b1b9c592791db9e6866a1a62308a6dc6bbf7985ff3b2cfb4cafa0b5c4a14
MD5 f40a1caedef12835d70d5e70cb3c4af1
BLAKE2b-256 485451f79184d3b68d9484f167a69567671c6ff50a19a8ba039abd1a8b4d494e

See more details on using hashes here.

File details

Details for the file chatlas_chains-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: chatlas_chains-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for chatlas_chains-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da4195e7ad5150dc5fa4d0a15fd441b11ece864c1a4120d09906dc2759f8bac3
MD5 b31e3967e410aea160b064743ee205d9
BLAKE2b-256 caa08a26dede7001bf2ca4121cd481b86bce220f5cd87b019bd7165f642c4663

See more details on using hashes here.

Supported by

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