Installation and Setup

To install AutoRAG, you can use pip:

pip install AutoRAG

Trouble with installation?

Do you have any trouble with installation? First, you can check out the troubleshooting page.

Installation for Korean 🇰🇷

You can install optional dependencies for the Korean language.

pip install AutoRAG[ko]

And after that, you have to install jdk 17 for using konlpy. Plus, remember to set environment PATH for jdk. (JAVA_HOME and PATH)

The instruction for Mac users is here.

Setup OPENAI API KEY

To use LLM and embedding models, it is common to use OpenAI models. If you want to use other models, check out here

You need to set OPENAI_API_KEY environment variable. You can get your API key at here.

export OPENAI_API_KEY="sk-...your-api-key..."

Or, as an alternative, you can set env variable using the .env file.

pip install python-dotenv

Then, make an.env file at your root folder like below.

OPENAI_API_KEY=sk-...your-api-key...

And when you try to run AutoRAG, you can use below code to load .env file.

from dotenv import load_dotenv

load_dotenv()

And you are ready to use AutoRAG!

Build from source

If you want to build AutoRAG from source, the first step is to clone the AutoRAG repository.

git clone https://github.com/Marker-Inc-Korea/AutoRAG.git

And install AutoRAG to editable.

cd AutoRAG
pip install -e .

And then, for testing and documentation build, you need to install some additional packages.

pip install -r tests/requirements.txt
pip install -r docs/requirements.txt

For testing, you have to set the environment variable at pytest.ini. Make a new pytest.ini file at the root of the project and write below.

[pytest]
env =
    OPENAI_API_KEY=sk-...your-api-key...

log_cli=true
log_cli_level=INFO

After that, you can run tests with pytest.

python -m pytest -n auto

After this, please check out our documentation for contributors. We are writing this documentation for contributors, so please wait for a while.