Debuly

Guide · Developer platforms

How to store and search embeddings in a vector database

Store text embeddings in a vector database and run similarity search: the steps, seven tools compared with pricing and stated limits, and the mistakes to avoid.

By the end of this guide you will have turned a set of documents into embeddings, stored them in a vector database, and run a similarity search that returns the passages closest in meaning to a question. The job needs two kinds of tool: an embedding model that converts text to vectors, and a vector database that stores the vectors and finds their nearest neighbours.

If you need a vector database for embeddings, the main choice is between a managed service, an open-source engine you host, and an extension to a database you already run. This guide covers each route and compares seven tools from our Developer platforms category.

Key takeaways

  • The flow is: split your content, embed each piece with one model, store vectors with metadata, then embed the query with the same model and search for the nearest matches.
  • The main decision is where the index lives: a managed service (Pinecone, Weaviate Cloud, Qdrant Cloud, Chroma Cloud), an embedded or self-hosted engine (LanceDB, Chroma, Qdrant), or inside Postgres with pgvector.
  • Use the same embedding model for documents and queries, and make sure the index dimensions match the model's output.
  • Free tiers are small and differ in what they cap, so check storage, object counts and region before you load real data.

What you need before you start

  • Content to index. Documents, product descriptions, support tickets or code, split into pieces you can retrieve on their own.
  • An embedding model. A hosted API or a local model. Voyage AI, for example, sells embedding models and rerankers through an API.
  • A language you can code in. Python is the common choice. Chroma and LanceDB list Python, TypeScript and Rust clients, and pgvector works from any language with a Postgres client.
  • A small test set. Ten or so queries with the passage you expect each one to return.
  • Time. A first working index takes under an hour. Tuning and loading a large collection takes longer.
  • Difficulty. Moderate. You need to be comfortable with an API or SQL.

Which kind of AI tool fits this job

The right choice depends on who runs the database.

A managed vector database when you do not want to operate servers. Pinecone is fully managed and offers serverless indexes (dense, sparse and full-text), namespaces to separate data, and its own embedding and reranking models. Weaviate stores objects with their vectors, supports hybrid search and multi-tenancy, and offers Weaviate Cloud or a self-managed open-source database.

An open-source engine you can run anywhere. Qdrant can be self-hosted or used as Qdrant Cloud, and supports hybrid search, quantization and payload filtering. Chroma is Apache 2.0 licensed, runs from a laptop to your own servers, and has a serverless cloud option. LanceDB runs embedded in your own application process and stores vectors and raw multimodal data in versioned tables.

An extension to the database you already use. pgvector adds vector columns and similarity search to PostgreSQL, so embeddings sit next to your other data and you query them with SQL. This keeps ACID compliance and JOINs, which suits teams already on Postgres.

An embedding model to feed any of them. Voyage AI provides text and multimodal embedding models and rerankers through an API. Pinecone also lists hosted embedding models, and Weaviate has hosted embeddings in its cloud.

Step 1: Prepare and split your content

Embeddings work best on pieces that each carry one idea.

  1. Gather the source text and remove boilerplate such as navigation, footers and repeated legal text.
  2. Split long documents into passages that make sense alone, such as sections or paragraphs.
  3. Keep an ID and useful metadata with each passage: source file, title, date, product or customer.
  4. Keep a record of how you split, so you can reproduce the index later.

Check it worked by reading ten random passages and confirming each stands on its own.

Step 2: Choose an embedding model

You end this step with one model that you will use for both documents and queries.

  1. Pick a model that fits your content type. Voyage AI lists general-purpose and multilingual models, a code model, and finance and legal models, plus a multimodal endpoint for text, images and video frames.
  2. Note the output dimensions. Voyage AI lists adjustable dimensions of 256, 512, 1024 or 2048 on its models. Your index must use the same value as the model.
  3. Check pricing and limits. Voyage AI is billed by usage with free tokens for new accounts, and some vector databases bundle embedding models.
  4. Use one model for both documents and queries. Mixing models makes similarity scores meaningless.

Check it worked by embedding two similar sentences and one unrelated one, and confirming the first pair scores closer.

Step 3: Choose a vector database

You end this step with a store that matches your scale and operations.

  1. Decide who will operate it: a managed service, your own servers, or your existing Postgres.
  2. Check free-tier limits against your data. Weaviate's Free plan allows 100,000 objects, 1 collection and 3 tenants. Qdrant's free tier is a single node with 0.5 vCPU, 1GB RAM and 4GB disk. Pinecone's Starter plan is limited to AWS in us-east-1 with up to 5 indexes and 2 GB of storage.
  3. Check the search types you need: pure vector, filtered, hybrid with keywords, or full-text. Pinecone, Weaviate, Qdrant, Chroma, LanceDB and pgvector each list hybrid or full-text options.
  4. Use the comparison table below for pricing and stated limits.

Check it worked by confirming your expected number of vectors fits within the plan or server you chose.

Step 4: Create the index or collection

The goal is an empty index configured to match your vectors.

  1. Create the index, collection or table. In pgvector this means running CREATE EXTENSION vector and adding a vector column to a table.
  2. Set the dimension to match your embedding model, and choose a distance measure. pgvector lists L2, inner product, cosine, L1, Hamming and Jaccard distances.
  3. Choose an approximate index if the collection will be large. pgvector offers HNSW and IVFFlat, and lists that HNSW builds are slower and use more memory than IVFFlat.
  4. Use namespaces, collections or tenants to separate data sets. Pinecone has namespaces, and Weaviate and Qdrant list multi-tenancy.

Check it worked by inserting one test vector and reading it back.

Step 5: Embed and upsert your data

Now load the content in batches.

  1. Embed the passages in batches, using the model from Step 2. Voyage AI lists a Batch API with a discount for jobs that can wait, and notes that free tokens do not apply to Batch API usage.
  2. Upsert each vector with its ID and metadata. Metadata is what lets you filter later.
  3. Log failures and retry them, rather than silently skipping documents.
  4. For large files in object storage, check whether the database can import them directly. Pinecone lists import from object storage.

Check it worked by comparing the count of vectors in the database with the count of passages you sent.

Step 6: Run similarity searches and add filters

Query with the same model and look at what comes back.

  1. Embed the query with the same model, then ask for the closest matches.
  2. Read the top results for each test query, not just the scores.
  3. Add metadata filters to narrow results by product, language or date. Qdrant lists payload filtering, and pgvector lets you filter with ordinary SQL conditions.
  4. Note that pgvector's approximate indexes can return different results than exact search, and filtered queries can return fewer rows unless iterative scans are enabled.
  5. Try hybrid search if exact terms matter, such as part numbers or names.

Check it worked by confirming the expected passage appears in the top results for most of your test queries.

Step 7: Tune, monitor and keep the index fresh

An index drifts as your content changes, so plan for upkeep.

  1. Add a reranker if the right passage appears but not first. Pinecone lists reranking through its inference service, and Voyage AI lists rerankers.
  2. Re-embed changed documents and delete removed ones, so stale content does not surface.
  3. Watch usage against plan limits. Chroma Cloud pauses the service when usage limits are exceeded, and Pinecone's Builder plan blocks usage beyond its limits rather than billing it.
  4. If you change embedding models, rebuild the whole index, since vectors from different models are not comparable.

Check it worked by re-running your test set after each change and recording the results.

Tools for this job compared

Tool Good fit for Pricing Stated limits
Pinecone Managed vector search on AWS, GCP or Azure Freemium, paid from $20/mo (checked 24 Oct 2026) Starter: AWS us-east-1, up to 5 indexes, 2 GB storage; Standard and Enterprise have monthly minimums
pgvector Adding vector search to an existing PostgreSQL database Open source Needs PostgreSQL 13 or newer; you manage tuning and scaling unless a host does it
Qdrant Open-source or cloud vector search with payload filtering Freemium Free tier: single node, no high availability, no backups or uptime SLA
Weaviate Hybrid search and multi-tenancy, self-managed or cloud Freemium, paid from $45/mo (checked 24 Oct 2026) Free plan: 100,000 objects, 1 collection, 3 tenants, no backup retention or replication
Chroma Open-source search database with a serverless cloud Open source, paid from $250/mo (checked 24 Oct 2026) Each cloud database stays in the one region you pick; exceeding usage limits pauses the service
LanceDB An embedded store for vectors and multimodal data Open source OSS runs in a single process and shares CPU with your app; Enterprise pricing not published
Voyage AI Embedding models and rerankers through an API Freemium, paid from $0.02, usage-based (checked 24 Oct 2026) Free tokens do not apply to Batch API usage; older models get no free tokens

Prices and plan limits change, so confirm the current terms on each vendor's site before you commit.

Common mistakes to avoid

  • Mixing embedding models. Vectors from different models live in different spaces, so queries return nonsense. Fix it by using one model for documents and queries and rebuilding the index if you switch.
  • Setting the wrong dimension. An index sized for one model rejects vectors from another. Fix it by reading the model's output size and creating the index to match.
  • Storing vectors without metadata. You cannot filter by tenant, date or product later. Fix it by saving an ID and useful fields with every vector from the start.
  • Trusting approximate results without checking. Approximate indexes trade exactness for speed and can miss items, especially with filters. Fix it by testing against a known set of queries and, where available, enabling options such as pgvector's iterative scans.
  • Ignoring plan limits until they bite. Free tiers cap objects, storage or regions, and some pause or block usage. Fix it by comparing your data size with the limits before loading everything.

How we put this together

This is an evidence-based guide built from each tool's listing in our directory, which is compiled from the vendor's own site and pricing page. It is not a review based on using the tools. We don't rank tools, and nobody paid to be included. Some outbound links may be affiliate links; see our disclosure.

Frequently asked questions

Is there a free vector database?

Several have free options. pgvector, Chroma, Qdrant and LanceDB are open source, and Pinecone, Weaviate and Qdrant also list free cloud tiers with limits. Weaviate's Free plan allows 100,000 objects, for example, and Qdrant's free tier is a single node without backups.

Do I need a dedicated vector database, or can I use Postgres?

If your data is already in PostgreSQL and the collection is modest, pgvector keeps vectors next to your other data and lets you use SQL and JOINs. A dedicated database may offer managed scaling and extra search features. Test with your own data and query volume before deciding.

Vector search finds items close in meaning, while keyword or full-text search finds exact terms. Hybrid search combines the two, which helps when users type product codes or names. Pinecone, Weaviate, Qdrant, Chroma, LanceDB and pgvector each list a hybrid or full-text option.

Can I keep my data private?

Yes, if you choose a self-hosted option. pgvector, Qdrant, Chroma and LanceDB can run on your own infrastructure, and Qdrant lists Private Cloud and Hybrid Cloud options. Managed services process your data on their platforms, so read each vendor's data and security terms first.

How long does it take to set up?

It depends on your data and your familiarity with the tools. A first index with a few hundred passages means four steps: split, embed, store and query. Loading a large collection, tuning retrieval and setting up refresh jobs take longer.

Compare more options in our Developer platforms category. If you are building a chatbot on top of the index, see how to build a RAG chatbot over your own docs.

Related guides

Developer platforms

How to add AI-powered search to your website or app

Add semantic and hybrid AI site search to your website or app: the steps, eight tools compared on pricing and limits, and the mistakes that hurt relevance.

Debuly Editorial · Published

Developer platforms · Coding

How to build a RAG chatbot over your own docs

Build a retrieval-augmented chatbot that answers from your own documents with citations: the steps, seven tools compared, pricing and stated limits, and mistakes.

Debuly Editorial · Published

Related categories