# Store vectors on the blockchain · Semantic search on Chromia using Vector DB · Learn Chromia

> This lesson walks you through uploading vector embeddings and complete movie metadata to your Chromia chain. Once the upload finishes, you can search the…

Source: https://chromia.com/learn/vector-db-movie-demo/data-pipeline/upload-vectors/

Semantic search on Chromia using Vector DBLesson 10 of 15

1. [01Searching movies semantically on Chromia](https://chromia.com/learn/vector-db-movie-demo/introduction/)

Module 1: Project setup

1. [02Overview](https://chromia.com/learn/vector-db-movie-demo/setup/)
2. [03Choose an embedding model](https://chromia.com/learn/vector-db-movie-demo/setup/embedding-model/)
3. [04Configure your Rell module](https://chromia.com/learn/vector-db-movie-demo/setup/configure.rell/)
4. [05Deploy your Rell module](https://chromia.com/learn/vector-db-movie-demo/setup/deploy-rell-module/)
5. [06Finalize your Python environment](https://chromia.com/learn/vector-db-movie-demo/setup/finalize-python-env/)

Module 2: Running the data pipeline

1. [07Overview](https://chromia.com/learn/vector-db-movie-demo/data-pipeline/)
2. [08Preprocess movie data](https://chromia.com/learn/vector-db-movie-demo/data-pipeline/preprocess/)
3. [09Generate sentence embeddings](https://chromia.com/learn/vector-db-movie-demo/data-pipeline/generate-embeddings/)
4. [10Store vectors on the blockchain](https://chromia.com/learn/vector-db-movie-demo/data-pipeline/upload-vectors/)

1. [11Search the vector database](https://chromia.com/learn/vector-db-movie-demo/search/)

Module 4: A deep dive into the code

1. [12Overview](https://chromia.com/learn/vector-db-movie-demo/code-deep-dive/)
2. [13Link your data to the Vector DB with Rell](https://chromia.com/learn/vector-db-movie-demo/code-deep-dive/rell-interface/)
3. [14Work with Chromia through the Python client](https://chromia.com/learn/vector-db-movie-demo/code-deep-dive/python-client/)

1. [15Use cases and extensions](https://chromia.com/learn/vector-db-movie-demo/use-cases/)

[Learn](https://chromia.com/learn/)[Semantic search on Chromia using Vector DB](https://chromia.com/learn/vector-db-movie-demo/)

10 / 15Module 2: Running the data pipelineAdvanced

# Store vectors on the blockchain

This lesson walks you through uploading vector embeddings and complete movie metadata to your Chromia chain. Once the upload finishes, you can search the data on-chain with semantic queries.

## Run the script

From the `python/` folder, run this command:

bash

```nolines
python upload_vectors.py
```

The script does three things:

* Reads the input from `data/movie_vectors.jsonl`
* Calls the `add_movie` operation to send movie vectors and metadata to the blockchain in batches
* Prints a progress update for each movie it uploads

## How it works?

Movies go up in batches of 50 by default. Batching keeps transactions efficient and avoids overloading the chain.

Every movie is uploaded through one blockchain operation that carries:

* The vector embedding derived from the movie's plot
* The complete metadata, including title, release date, box office earnings, and other fields

For each batch, the script signs the transaction and submits it to your Chromia chain.

## Retry logic

When a batch upload fails, the script retries it automatically, up to 5 times. The wait between attempts grows exponentially (2s, 4s, 8s, and so on), which helps it recover from network problems and transient transaction failures.

## Output and confirmation

While the script runs, the terminal shows a live count of the movies uploaded so far.

When it finishes, your on-chain database contains the full dataset and is ready for semantic search.

## What’s next?

The next module has you run real queries against the chain and explore what on-chain semantic search can do.

Written for this site from Chromia’s public course. Code samples are the course’s own.

[← Previous**Generate sentence embeddings**](https://chromia.com/learn/vector-db-movie-demo/data-pipeline/generate-embeddings/)[Next →**Search the vector database**](https://chromia.com/learn/vector-db-movie-demo/search/)

On this page

* [Run the script](#run-the-script)
* [How it works?](#how-it-works)
* [Retry logic](#retry-logic)
* [Output and confirmation](#output-and-confirmation)
* [What’s next?](#whats-next)
