Thank you so much for your consideration of contributing to AutoRAG! Okay Let's get started!
- Fork the repo and clone your fork
- Create a new virtual environment and activate it
- Install the dependencies and package (
pip install -e '.[all]'
) - Install docs and test dependencies (
pip install -r docs/requirements.txt
andpip install -r tests/requirements.txt
)
Also, join our Discord at here and discuss about your contribution with the community.
- Add new modules or nodes to the AutoRAG.
- Fix bugs
- Add new feature to the AutoRAG
- Add new sample config YAML files
- Add new sample dataset
- Improve code quality & documentation
- Report a bug or suggest new feature
It can be great you search 'good first issue' tag on github issue tab.
The AutoRAG
repo have a standard python library structure.
You can find the core part of the library in autorag
folder.
You can find the test codes of the AutoRAG
at the tests
folder.
Plus, you can find the AutoRAG docs at the docs
folder.
For resources, you can find sample config YAML files at sample_config
folder.
Plus, you can find sample dataset download script from sample_dataset
folder.
As a python package, AutoRAG tested primarily in Python versions >= 3.9. Here's a guide to set environment.
- Fork AutoRAG Github repo and clone it to your local machine. (New to GitHub / git? Here's how.)
- Open your cloned repository to your IDE or open your project at the terminal through
cd
. - Install pre-commit hooks by running
pre-commit install
in the terminal. - Make a new virtual environment (Highly Recommended)
- Install AutoRAG as development version.
pip install -e '.[all]'
- Install test dependencies
pip install -r tests/requirements.txt
- Write
pytest.ini
file and add env variable for running tests. (We do not need OPENAI_API_KEY at GitHub actions)
[pytest]
env =
OPENAI_API_KEY=sk-xxxx
log_cli=true
log_cli_level=INFO
- Install docs dependencies
pip install -r docs/requirements.txt
Let's make sure to format/lint
our change.
For bigger changes, let's also make sure to test
our change.
We use ruff
to linting and formatting our code.
If you have installed pre-commit hooks in this repo, they should have taken care of the formatting and linting automatically.
(Use pre-commit install
)
If you want to do it manually, you can lint and format with ruff.
ruff check --fix
ruff format
If you modified or added new code logic, you have to create tests for them, too.
- In almost all cases, add unit tests.
- If your new features uses heavy GPU models or outside API connections, you must use mock and pytest fixtures.
- The added test case must not leave any extra files.
- You must cover all cases of features or adjust that you made.
- If you don't know well about
pytest
,pytest-env
and pytest fixtures and mock, please learn about it. - Lastly, if the test you made must need CUDA-enabled device, you can mark the test with
@pytest.mark.skipif(is_github_action())
so we can skip it on github actions.
Plus, your test will run as github actions when you try to merge it to the main branch.
When executing test at github actions, it will be failed due to the OpenAI API key. Don't worry, we will run the test locally and merge your code if there is no problem.
You can make a pull request to the main branch of the AutoRAG repo.
At the fork repository, you will make a PR to AutoRAG repo.
You can assign the issue with close #issue_number
to automatically close the issue when the PR is merged.
After that, please assign vkehfdl1
or bwook00
as a reviewer.
For merge, you will have to get at least one approval from the reviewer.