Installation and Setup

To install AutoRAG, you can use pip:

pip install AutoRAG

Plus, it is recommended to install PyOpenSSL and nltk libraries for full features.

pip install --upgrade pyOpenSSL
pip install nltk
python3 -c "import nltk; nltk.download('punkt_tab')"
python3 -c "import nltk; nltk.download('averaged_perceptron_tagger_eng')"

Trouble with installation?

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

Installation for Local Models 🏠

For using local models, you need to install some additional dependencies.

pip install "AutoRAG[gpu]"

Installation for vLLM ⚡

If you plan to use vLLM (as a generator or embedding backend), install the vllm optional dependencies.

# pip
pip install "AutoRAG[vllm]"

# uv (recommended)
uv pip install "AutoRAG[vllm]"

When developing from source, you can also install everything at once:

uv pip install -e .[all]

Installation for Parsing 🌲

For parsing you need to install some local packages like libmagic, tesseract, and poppler. The installation method depends upon your OS.

After installing this, you can install AutoRAG with parsing like below.

pip install "AutoRAG[parse]"

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.

Installation for Japanese 🇯🇵

pip install "AutoRAG[ja]"

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.

Additional Notes

  • Ensure that the necessary directories (sample_config and projects) are present in the host system.

  • If running in a CI/CD pipeline, consider using environment variables or .env files to manage API keys and paths dynamically.