Skip to content
SynthGraph
How it works

Six steps, one record.

A provenance record is built up in the order the research happens. These are the steps of the quickstart, with the code that records each one.

  1. 01

    Install and configure

    The SDK is a Python package. Create an API key in the dashboard, then point the SDK at your backend with two environment variables. Nothing runs in the background, and nothing changes in how you generate or train.

    shell
    $ pip install "git+https://github.com/Abinash-Anand/SynthGraph.git#subdirectory=synthgraph-sdk-cli" $ export SYNTHGRAPH_API_KEY="..."$ export SYNTHGRAPH_API_URL="https://your-synthgraph-backend"
  2. 02

    Record a generation

    Open a generation with its generator, version, seed and parameters, and run your pipeline inside it. The block starts the generation, completes it when your code finishes, and marks it failed if your code raises. A failed generation stays in the record.

    capture.py
    with experiment.generation(    generator="blender",    generator_version="4.2",    parameters={"weather": "rain", "occlusion": 0.3, "camera_distance": 12},    seed=42,) as generation:    run_my_blender_pipeline()  # your code, unchanged
  3. 03

    Record the data it produced

    A dataset is recorded by reference: where it lives and what you call it. Nothing is uploaded. You can ask the SDK to hash a local folder if you want to be able to prove the bytes have not changed.

    capture.py
    dataset = generation.dataset(    name="rain_dataset_v1",    uri="s3://lab-bucket/rain_dataset_v1",    format="image",)
  4. 04

    Record the training run

    Create the run with the data it used, then start it. A training run moves through its own lifecycle, which you call. Passing the dataset when you create the run is what links the run to its data.

    capture.py
    training = experiment.training(    model="yolo",    framework="pytorch",    dataset=dataset,    config={"epochs": 50, "batch_size": 32, "learning_rate": 0.001},)training.start()
  5. 05

    Record what it scored

    Log metrics as the run goes, then record the evaluation. An evaluation always names the dataset version it was measured on. Complete the run when it ends.

    capture.py
    training.log_metric(step=1, metrics={"loss": 0.9})training.evaluation(    metrics={"mAP": 0.724, "precision": 0.78, "recall": 0.69},    dataset_version_id=dataset,)training.complete()
  6. 06

    Read it back

    Open the dashboard to see the lineage, the metrics and how completely each run was recorded, or use the command line to query and export it. Every line in the graph is a link you recorded.

    The lineage graph of a demo project: generations, dataset versions, training runs and evaluations joined by recorded links.

    Demo data: an invented adverse-weather detection project.

Open source · MIT

Your next experiment should leave a trail.

Install the SDK and record your next generation. The next time someone asks which seed, you will already have the answer.

SDK 1.0.0 is an alpha: the API only changes by adding, and the SDK can still change. See the docs for what it does and what it does not do.