- Copy
example.envto.envand configure your API keys - Modify parameters in
backend/config.py
docker compose up --build
docker compose up
If you want to use the embedding model locally, set the EMBEDDING_MODEL env acording and Pull the embedding model using pull_embedding_model.py script (constants are inside). Setup beforehand either the container and use a container command or local env and run the script.
For GPU acceleration (faster than CPU), install the NVIDIA Container Toolkit:
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
Creates a compressed archive of the MongoDB database:
# With auto-generated timestamp filename ./backend/db_scripts/db_dump.sh # With custom filename ./backend/db_scripts/db_dump.sh my_backup.archive
Dumps are saved to backend/db_dumps/.
Restores from a dump file (drops existing data first):
# From db_dumps folder (just filename) ./backend/db_scripts/db_restore.sh dump_20241209_120000.archive # From any path ./backend/db_scripts/db_restore.sh /path/to/backup.archive
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
TODO expand this with explenations { experiment_id: "...", domain: "legal", qa_id: "..." | null,
question: "...", answer: "...",
gold_answer: "...", gold_context: [ ... ] | null,
rag_context: [ ... ], processing_time: 42.3, judge_scores: { ... },
created_at: }
docker compose exec rag-backend python -m experimental_scripts.X_script