Skip to content

m3nin0-labs/sitsrag

Repository files navigation

sitsrag dragoman logo

RAG for the SITS R Package documentation

Installation

To run the sitsrag, you need to have Python 3.11+ and uv installed. Then, to install it, first clone the repository:

git clone https://github.com/m3nin0-labs/sitsrag.git

Then, access the repository downloaded:

cd sitsrag

Finally, you can sync the dependencies:

uv sync

Configuration

Before running the sitsrag, you need to configure the anthropic and cohere keys. For this, first copy the .env.example file:

cp .env.example .env

Then, you set the variables in the file:

ANTHROPIC_API_KEY=sk-ant-...
RERANKER_API_KEY=cohere_...

It is possible to configure other parameters. You can check all of them in the .env.example file.

Usage

To start using sitsrag, you first need to create the database (SQLite) for it:

sitsrag db migrate

Next, prepare domain knowledge data used as auxiliary resources during search:

# Domain knowledge (satellites, indices, sits collections) 
sitsrag ontology load all
sitsrag ontology link

Then, you can index the sits materials:

sitsrag index documentation
sitsrag index reference
sitsrag index articles

Finally, you can run the server:

sitsrag serve

The server listens on http://127.0.0.1:8000/ by default.

Production

For production environments, you can run the server behind nginx and gunicorn (multiple workers) via Docker Compose:

docker compose up --build

The Docker Compose builds an image for the sitsrag, which bakes in the pre-built database and the embedding model. The Compose also stars an nginx, which exposes the server on port 80.

Development

uv sync --extra dev
uv run pytest             # run the test suite
uv run ruff check .       # lint

Contributing

Contributions are welcome. Please open an issue to discuss significant changes, and ensure tests, linting and type checks pass before submitting a pull request.

License

sitsrag is distributed under the GPL-v3.0 license. See LICENSE for the full text.

About

RAG for the SITS R Package documentation

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages