OpenAI provides pre-trained embedding models that convert text into dense vector representations. These embeddings capture semantic meaning, making them well-suited for similarity search, retrieval-augmented generation (RAG), and clustering tasks. VectorAI DB works with any OpenAI embedding model. You generate embeddings using the OpenAI API, then store and search them in VectorAI DB using a supported client.Documentation Index
Fetch the complete documentation index at: https://docs.vectoraidb.actian.com/llms.txt
Use this file to discover all available pages before exploring further.
Before running the examples on this page, make sure you have a VectorAI DB collection created and your VectorAI DB instance running. See Collections for setup instructions.
Supported models
| Model | Dimensions | Description |
|---|---|---|
text-embedding-3-small | 1536 | Smaller, faster model with strong performance for most use cases. |
text-embedding-3-large | 3072 | Higher-dimensional model for maximum accuracy. |
text-embedding-ada-002 | 1536 | Legacy model. Use text-embedding-3-small for new projects. |
Installation
Install the OpenAI Python client and the VectorAI DB client:Generate and store embeddings
The following example generates embeddings for a set of texts using OpenAI’stext-embedding-3-small model, stores them in a VectorAI DB collection, and runs a similarity search:
Search with OpenAI embeddings
Before running this example, create the collection and upsert the sample points from the previous section. To search, generate an embedding for the query text using the same model, then pass it as the query vector:Always use the same embedding model for both indexing and querying. Mixing models produces incompatible vector spaces and returns meaningless results.
Using text-embedding-3-large
For higher accuracy, use text-embedding-3-large, which produces 3072-dimensional vectors. Update the model name and collection dimension accordingly:
Next steps
To continue building with embeddings, see the following resources:- LangChain — Use OpenAI embeddings with VectorAI DB through the LangChain framework.
- Vectors — Learn how VectorAI DB stores and indexes vector data.
- Search — Explore the vector search operations available in VectorAI DB.
- Collections — Understand how collections organize your vectors.