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;

CHANGELOG

0.1.3

Fixing imports

Changed output format of basic_retrieval_chain (docs key is now a list of Document objects, rather than a dict)

Unit tests for basic_retrieval_chain

0.1.2

Unit tests

First Langgraph chain

0.1.1

Initial Release


📄 License

chATLAS_Benchmark is released under Apache v2.0 license.


Made with ❤️ by the ATLAS Collaboration

For questions and support, please contact

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.3.tar.gz (26.5 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.3-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chatlas_chains-0.1.3.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for chatlas_chains-0.1.3.tar.gz
Algorithm Hash digest
SHA256 827e4894414565bfd72635955f9b1d14dc00a897f7bf25ee427706b11cf67eeb
MD5 1d382f95f6f1cedf13e21261524b2a25
BLAKE2b-256 7b1e95371906f7d540e04f21e358e0d8ca99e292eb51fc30cc56bc2459d49d6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chatlas_chains-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 88e43199e8a69cfd05d4d0ff4edbd768c9c817dcf02c063f2e1f0d9805657a5b
MD5 ba6e1cb8a8313863d7a3e71e1e283cbd
BLAKE2b-256 aa8b74fd528e8626a1269008a1eb92863c64b8eba1c561a03db0889a13eff28f

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