Important Note: The RecencySpace
feature is turned off by default due to the constraints of this release. For a detailed explanation and instructions on enabling it, refer to the Using Recency Space section of the documentation.
Note: The primary aim of this document is to guide you on how to operate the Superlinked system with your preferred configuration, rather than explaining the inner workings of the Superlinked components. For a deeper understanding of the components, please refer to the notebooks mentioned above.
index.py
- Defines schemas, spaces, and indexesquery.py
- Specifies the queriesapi.py
- Configures the executor that integrates the aforementioned components and other crucial configurationsIt is crucial to understand that all definitions in this file determine the vectors of your elements. Any modifications to this file, such as adding a new space or altering the schema, will render the previously ingested data invalid, necessitating re-ingestion.
Note: In the absence of specified chunking, the loader will attempt to read and load the entire file into the system by default. Mind your memory! If possible, utilize file formats that support chunking and include the necessary parameters in the pandas_read_kwargs
as indicated below.
Constraints:
Name of your data loader: TheThe data loader is now configured but it only runs if you send a request to the data loader endpoint! To see how to trigger it, check the API documentation herename
parameter inDataLoaderConfig
is optional. By default, it adopts the snake_case version of your schema’s name used inDataLoaderSource
. If you have multiple data loaders for the same schema or prefer a different name, simply set thename
parameter accordingly. Note that the name will always be converted to snake_case. To see the configured data loaders in your system, refer to the API documentation.
id
column has a different name for example, as well as the other schema fields, it needs to be mapped to the schema you are attempting to load. To map field names to your schema, utilize the data parser as shown below:
To prevent out-of-memory issues, it’s recommended to use chunking when dealing with large datasets. Set theTo implement chunking, you’ll need to use either CSV or JSON formats (specifically JSONL, which includes JSON objects on each line). Here’s an example of what a chunking configuration might look like:LOG_LEVEL
environment variable toDEBUG
to monitor pandas memory usage metrics, which can help you determine optimal chunk sizes and estimate total memory requirements. These metrics are available regardless of whether chunking is enabled.
ONLINE_PUT_CHUNK_SIZE
environment variable to the desired number.
RestEndpointConfiguration
, which can alter your URL. By default the API looks like:
/api/v1/search/<query_name>
which aligns with the schema: /<api_root_path>/<query_path_prefix>/<query_name>
/api/v1/ingest/<schema_name>
which aligns with the schema: /<api_root_path>/<ingest_path_prefix>/<schema_name>
now
. Each modification and restart of the application will result in a new timestamp, which does not dynamically update during runtime.EXECUTOR_DATA
to your executor, like:
DISABLE_RECENCY_SPACE
environment variable to false
Ensure that your system has a GPU compatible with PyTorch and that the GPU drivers are up to date. For optimal performance, we recommend using NVIDIA GPUs as they provide the best support for deep learning frameworks like PyTorch.To enable GPU acceleration in Superlinked, configure the
GPU_EMBEDDING_THRESHOLD
environment variable. This variable determines when GPU embedding is activated based on batch size:
Variable | Type | Explanation | Default Value |
---|---|---|---|
APP_MODULE_PATH | str | Path to server code files. | ”superlinked_app” |
DISABLE_RECENCY_SPACE | Bool | Server will explicitly reject RecencySpace in an index (see above for more RecencySpace information). | True |
EXPOSE_PII | bool | - | False |
JSON_LOG_FILE | str | Filename for the JSON log file produced by the server. | None |
LOG_AS_JSON | str | Produce a log in JSON format (avoids query truncation). | False |
LOG_LEVEL | str | https://docs.python.org/3/library/logging.html#logging-levels | ”INFO” |
PERSISTENCE_FOLDER_PATH | str | - | ”in_memory_vdb” |
SERVER_HOST | str | IP address of the server. | ”0.0.0.0” |
SERVER_PORT | int | Port of the server. | 8080 |
WORKER_COUNT | int | Number of workers | 1 |