Vectors And Vector Databases
What Is A Vector?
A vector is a list of numbers that describes a piece of data. Machine learning models turn text, images, audio, and video into these lists, called embeddings, so that a computer can compare meaning instead of exact words. Two pieces of content that mean similar things end up with vectors that sit close together, and unrelated content ends up far apart.
Take the sentences "How do I reset my password?" and "I forgot my login." They share almost no words, yet an embedding model places them next to each other because they describe the same problem. A keyword search would miss the match. A search over vectors finds it.
The length of the list is called the dimension, and it is fixed by the embedding model you choose. A model that outputs 1536 numbers per item produces 1536-dimensional vectors, and every vector stored together must have the same dimension.
How Is Similarity Measured?
Finding related content means measuring how close two vectors are. The measurement is called a distance metric. Cosine distance compares the direction of two vectors and ignores their length, which suits text embeddings well. Euclidean distance compares the straight-line gap between them.
When you create an index on AIOZ Storage you choose the metric once, and every query against that index uses it. The AIOZ Storage SDK guides use cosine.
What Does A Vector Database Do?
A vector database stores vectors and answers one question quickly: which stored vectors are closest to this one? Instead of scanning every record, it keeps the vectors in a structure built for nearest-neighbor search, so results come back fast even when the collection holds millions of items.
Along with each vector, you can keep metadata such as a title, a source, or a document ID. The vector finds the match by meaning, and the metadata tells your application what the match is.
How Do Vector Databases Power RAG?
Retrieval-augmented generation, usually shortened to RAG, gives a language model access to your own data at the moment it answers. The flow has four steps:
- Your documents are split into chunks and sent through an embedding model.
- The resulting vectors are stored in a vector database, together with the original text or a reference to it.
- When a user asks a question, the question is embedded with the same model and the database returns the closest chunks.
- Those chunks are passed to the language model as context, so the answer is grounded in your content instead of the model's memory.
The same pattern drives semantic search, recommendations, and long-term memory for AI agents. The database sits in the middle of all of them, so its speed, scale, and reliability affect everything built on top.
What Should You Look For In A Vector Database?
Picking the wrong store tends to show up late, once real data and real traffic arrive. These are the questions worth asking early:
- Query performance: does it return good matches quickly at your data size?
- Scale: can it grow from thousands of vectors to millions without a redesign?
- Ingestion: how easy is it to load data and keep it up to date?
- Metadata: can you store context next to each vector and get it back with the results?
- Durability: are your embeddings protected against loss and outages?
- Integration: does it work with the tools and SDKs your team already uses?
- Lock-in and cost: can you move away later, and does the price stay predictable as you grow?
How Does This Work On AIOZ Storage?
AIOZ Storage exposes vectors through the AWS S3 Vectors API (S3 compatibility), so the SDKs you may already know work against it. Your data is organized in three levels:
- A vector bucket is the namespace that holds your indexes.
- A vector index stores the embeddings. You set its
dimensionto match your embedding model and itsdistanceMetricwhen you create it. - A vector has a unique
key, its numericdata, and optionalmetadata.
Four operations cover the common workflow: create a bucket and index, put vectors, query for the closest ones, and delete vectors by key. This example uses the JavaScript SDK:
await client.send(new CreateIndexCommand({
vectorBucketName: 'my-bucket',
indexName: 'my-index',
dataType: 'float32',
dimension: 1536,
distanceMetric: 'cosine'
}))
await client.send(new QueryVectorsCommand({
vectorBucketName: 'my-bucket',
indexName: 'my-index',
queryVector: { float32: [0.11, 0.85, 0.47] },
topK: 5,
includeMetadata: true
}))Because AIOZ Storage runs on the AIOZ DePIN network, the vectors you store are replicated across the network by default, the same way every other object is. There is no cluster to size, patch, or scale, and no separate database to keep in step with your object storage.
Where To Go Next
- Options And Comparison shows where an S3-compatible vector store fits among the other kinds of vector databases.
- Cost, Use Cases And Next Steps covers what drives cost and how teams put vectors to work.
- The SDK guides for Python, JavaScript, and Golang walk through the full workflow in code.
See Also
- Super Intelligence Memory - memory for AI agents without embeddings to manage.
- Access Grant - create the credentials the SDKs use.