This is an API build for Nissa.
The Service uses FASTAPI and HNSWLIB to query cards data and rules regarding Magic: The Gathering
.
- Start the Server
fastapi run app.py
- Look at the Interfaces and Try out the Service
http://127.0.0.1:8000/docs
At the moment there are two Vector Databases that have to be filled before the dataservice can start working.
-
Rules DB
- includes data relevant for understanding the game:
- Comprehensive Rulebook
- Data about Keywords
- Question Answer pairs from RulesGuru
- Question Answer pairs from Stackoverflow
-
Cards DB
- includes all mtg card data from scryfall
To fill the database there are scripts in the folder src/etl
every script beginning with create_
will create data as json files that can then be vectorized and inserted in the corresponding database. For vectorizing the data at the moment we are using the opensouce model gte-large from huggingface.
pip install --upgrade poetry
poetry install
poetry shell