Prompt

I'm building a vector index for millions of records, what architecture should I use

Artificial Intelligence / AI Search3 observationsLast seen Nov 4, 2026

Latest observation

Nov 4, 2026OpenAI APIWeb search: off

For millions of records, the right architecture is usually a distributed vector retrieval layer with metadata filtering, not a single monolithic index.

Recommended architecture

1) Split storage into two layers

A. Vector index

  • Stores embeddings and supports ANN search
  • Built with something like:
    • FAISS for self-managed, high-performance setups
    • Milvus, Weaviate, Pinecone, Qdrant for managed/distributed systems
    • pgvector only if scale/performance needs are moderate

B. Source-of-truth metadata store

  • Keep full records in:
    • Postgres / MySQL
    • DynamoDB / Cassandra
    • Elasticsearch/OpenSearch for keyword search
  • Store only:
    • record ID
    • embedding
    • minimal searchable metadata in the vector system

This keeps the vector DB lean and fast.


2) Use sharding / partitioning

For millions of vectors, use horizontal partitioning:

  • Split by tenant, category, time range, region, or hash of ID
  • Benefits:
    • faster queries
    • easier reindexing
    • lower memory pressure
    • better multi-tenancy isolation

If you have a natural filter like tenant_id, product_type, or language, partition on that.


3) Choose an ANN index type that fits your workload

If you need high recall and fast search:

  • HNSW
    • great latency/recall
    • memory heavy
    • excellent for read-heavy workloads

If you need lower memory and large scale:

  • IVF / IVF-PQ
    • more compact
    • good for tens/hundreds of millions
    • slightly more tuning required

If vectors are static and performance is critical:

  • DiskANN-style approaches
    • very scalable
    • good for very large corpora
    • often used in production search systems

Rule of thumb:

  • Up to a few million: HNSW is often easiest
  • Tens of millions+: consider IVF-PQ or DiskANN-like systems
  • If you want operational simplicity: managed vector DB

4) Support hybrid retrieval

Use both:

  • vector search
  • keyword / lexical search

Then combine results with:

  • reranking
  • score fusion
  • business rules

This improves quality a lot, especially for exact terms, names, IDs, and rare entities.


5) Add a reranking stage

Typical retrieval pipeline:

  1. Filter by metadata
  2. ANN vector search top 50–200
  3. Optional keyword search
  4. Merge candidates
  5. Rerank with:
    • cross-encoder
    • LLM reranker
    • learning-to-rank model

This gives better quality than relying only on nearest neighbors.


A practical production setup

Option A: Managed and simple

  • Vector DB: Pinecone / Weaviate / Qdrant Cloud / Milvus managed
  • Metadata DB: Postgres
  • Object store: S3/GCS for raw records
  • Pipeline: Kafka / Airflow / Celery for ingestion

Best if you want less ops burden.

Option B: Self-managed scalable

  • Vector service: Milvus or Qdrant cluster
  • Metadata: Postgres + Redis cache
  • Keyword search: OpenSearch
  • Batch indexing: Spark / Ray / Python workers
  • Embedding generation: GPU inference service

Best if you need control and lower long-term cost.

Option C: Search-first enterprise

  • OpenSearch/Elasticsearch for lexical + vector
  • Postgres for source data
  • Separate embedding pipeline
  • Reranker service

Good when text search is as important as vector search.


Important design decisions

Embedding dimension

Higher dimension = better semantic power, more memory/cost.

  • Common sizes: 384, 768, 1024, 1536

Update pattern

  • Static corpus: optimize heavily for search
  • Frequent updates: choose an index that supports incremental inserts well, like HNSW or a managed DB

Filtering

If you need frequent metadata filters, make sure your vector system supports:

  • pre-filtering
  • efficient filtering on structured fields

This matters a lot at scale.

Memory estimate

Roughly:

  • #vectors × dimension × bytes per value
  • float32 uses 4 bytes/value

Example:

  • 10 million vectors
  • 768 dims
  • float32

That’s about:

  • 10,000,000 × 768 × 4 ≈ 30.7 GB just for raw vectors
  • plus index overhead, often significantly more

So memory planning is critical.


My default recommendation

If you’re building for millions of records and want a safe default:

  • Use Qdrant, Milvus, or Pinecone
  • Store IDs + embeddings + metadata
  • Keep full records in Postgres/Object Storage
  • Use sharding by tenant/category
  • Use HNSW if memory is acceptable
  • Add hybrid search + reranking

If you want, I can give you a recommendation based on:

  1. your vector count
  2. update frequency
  3. whether you need metadata filters
  4. your latency target
  5. whether you prefer managed vs self-hosted

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (3 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.