Skip to main content

Apply API


In this section we re-use the datalayer variable db without further explanation. Read more about how to build it here and what it is here.

AI functionality in SuperDuperDB revolves around creating AI models, and configuring them to interact with data via the datalayer.

There are many decisions to be made and configured; for this SuperDuperDB provides the Component abstraction.

The typical process is:

1. Create a component

Build your components, potentially including other subcomponents.

from superduperdb import <ComponentClass>

component = <ComponentClass>(
**kwargs # can include other components

2. Apply the component to the datalayer

"Applying" the component the db datalayer, also applies all sub-components. So only 1 call is needed.


3. Reload the component (if necessary)

The .apply command saves everything necessary to reload the component in the SuperDuperDB system.

reloaded = db.load('type_id', 'identifier')   # `type_id`

4. Export the component (to share/ migrate)

The .export command saves the entirety of the component's parameters, inline code and artifacts in a directory:


The directory structure looks like this. It contains the meta-data of the component as well as a "mini-artifact-store". Together these items make the export completely portable.

|_component.json // meta-data and imports of component
|_blobs // directory of blobs used in the component
| |_234374364783643764
| |_574759874238947320
|_files // directory of files used in the component

You can read about the serialization mechanism here.

Read more