Azure AI Search vs pgvector

Azure AI Search suits Microsoft-centered teams that want managed indexing, AI enrichment and Entra ID controls. pgvector suits teams that already run Postgres and can own the embedding pipeline and database operations.

On this page

Azure AI Search alternative: when pgvector fits and when it does not

Choose pgvector when your team already runs PostgreSQL, has engineers who will own the chunking and embedding jobs, and needs vector search joined to SQL filters on the same tables. Stay on Azure AI Search when integrated indexing, AI enrichment, agentic retrieval and Entra ID document-level access are central to the product. A renewal, a rising Azure bill or a wish to keep vectors next to relational data often starts the review, but none of those settles it alone. Azure AI Search indexes JSON documents pushed through its API or pulled by indexers from supported data sources, so the first step is to list which of its built-in features your application calls today. See Microsoft Learn's overview of Azure AI Search for the full feature set.

The decision turns on four points, and the first is who owns the ingestion pipeline. In Azure, indexers and skillsets run extraction, chunking and vectorization for you. With pgvector, your code handles extraction, chunking, embedding, upserts and re-embedding whenever the model changes, so the pipeline becomes a service your engineers must maintain. Dimensions come next: the pgvector README says the vector type can be indexed up to 2,000 dimensions and halfvec up to 4,000, so compare your embedding model's output size with those limits before you choose a column type. Confirm the limits against the pgvector version your platform team will install, since the README's install instructions clone tag v0.8.7 and support Postgres 13 and later.

The last two points are keyword search and operating capacity. pgvector provides vector similarity search with exact and approximate methods, using HNSW or IVFFlat indexes. If your users depend on keyword relevance, synonyms or scoring profiles, plan Postgres full-text search or a second engine and test those queries on a copy of your data before you commit. On capacity, cost shifts from Azure search units to servers, storage, backups, Postgres upgrades and the engineering time spent tuning index builds and recall. Run a pilot on one index, measure latency and recall with your real SQL filters, and decide in writing who on your team is paged when search slows down.

Which scenarios favor Azure AI Search and which favor pgvector

This table compares the conditions under which Azure AI Search or self-hosted pgvector is the better fit for a retrieval workload. Read each row as a test: if the condition in the Why column holds in your environment, the named option usually reduces the work your team takes on. The main takeaway is that the deciding factors are where your data must live, who operates the database, and whether your permission model depends on Entra ID.

ScenarioBetter fitWhy
Existing Postgres estate with relational datapgvectorHolds when your team already operates Postgres and vector queries must join relational tables in the same query.
RAG stack built on Azure services with integrated vectorizationAzure AI SearchHolds when your sources work with indexers and you can supply content as JSON documents.
Document-level access through Entra IDAzure AI SearchHolds when per-document permissions must map to Entra ID users and groups. Confirm how your permission model maps before committing.
Team with no database or platform capacityAzure AI SearchHolds when nobody on the team can own Postgres patching, backups and failover. Managed hosting moves those tasks to Azure, and cost follows the tier.
Data that must stay on the organization's serverspgvectorHolds when data cannot leave your servers, because pgvector runs in Postgres you operate, while Azure AI Search is cloud-hosted.
Very large vector counts that need sizing testsDecide by testRun sizing tests on both. Azure limits depend on tier and units, pgvector on memory, index type and dimensions; confirm with your own data.

What Azure AI Search includes that pgvector leaves to your code

Azure AI Search ships a retrieval stack, and pgvector ships an index. Azure AI Search is a fully managed, cloud-hosted service that offers full-text, vector, hybrid and multimodal queries, agentic retrieval over knowledge bases, and AI enrichment for chunking and vectorization. Microsoft describes it as the service that underpins Foundry IQ, so chunking, embedding and query handling are part of the product. pgvector is an extension that adds vector types, HNSW and IVFFlat indexes, and distance functions to Postgres. Everything above the index is yours to build: how documents are split, which embedding model runs, how keyword and vector results are merged, and how an agent calls the store. Treat that as application code with owners and tests before comparing query speed. Microsoft Learn overview of Azure AI Search

The ingestion path is where the gap is most concrete. Azure AI Search only indexes JSON documents, loaded either by pushing documents through its API or by pulling them with indexers from supported data sources. Indexers and skillsets run the pull and the enrichment steps inside the service. With pgvector, vectors sit in ordinary Postgres tables, so your loaders and embedding jobs must fill them: extract from each source, split text into chunks, call an embedding model, write rows with a vector column, and handle failures and re-embedding whenever the model changes. Each source needs a job with a named owner. List every index, its indexer or push client, and the skillset steps it runs, then map each one to a script or service you will operate. Confirm in Microsoft's documentation which of your sources have a supported indexer before assuming one exists.

How much this gap matters depends on who already owns pipelines. It matters most when the team has few pipeline engineers, because pgvector leaves chunking, retries, backfills and embedding model upgrades with the people who maintain the application. It matters least when a data platform team already runs ETL into Postgres: extraction, scheduling, monitoring and data quality checks exist, and adding an embedding step to that flow is a smaller change. Ask three questions before choosing: which sources feed the index, whether an existing Postgres pipeline already loads them, and who gets paged when an embedding job fails. The answers show whether the search unit charges you would avoid with pgvector are offset by pipeline work you currently get from Azure.

How Azure AI Search and pgvector compare on capabilities

This table compares what Azure AI Search provides as a managed service with what pgvector provides as an extension inside a Postgres server you run. Read the pgvector column as database features, and treat any cell marked as your code or a Postgres feature to confirm as work your team owns. The main takeaway is that pgvector covers vector storage and similarity search directly, while ingestion, chunking, agentic retrieval and the access model need design work.

CapabilityAzure AI Search (commercial)pgvector (open source)
Vector search modes and indexesVector queries alongside full-text and hybrid queries in one managed service. Confirm index algorithm options in current docs.HNSW and IVFFlat indexes with exact and approximate nearest neighbor search.
Distance functions and vector typesConfirm supported similarity metrics and vector field types in the index definition.L2, inner product, cosine, L1, Hamming and Jaccard distances. Vector, halfvec, bit and sparsevec types.
Dimension limitsConfirm the maximum vector dimensions per field for your tier in current docs.Indexed up to 2,000 dimensions for vector and up to 4,000 for halfvec.
Hybrid, full-text and keyword searchFull-text, vector and hybrid queries in one service.Not built into the extension. Use Postgres full-text search and your own fusion code, to confirm.
Integrated vectorization and chunkingAI enrichment for chunking and vectorization, run by the service.Your code. Chunking, embedding calls and writes to vector columns are yours to build.
Indexers and data sourcesIndexers pull from supported data sources. Only JSON documents are indexed, pushed through the API or pulled by indexers.Your code. Vectors live in tables beside source data, synced by your own jobs.
Agentic retrievalAgentic retrieval over knowledge bases, which underpins Foundry IQ.Your code. No built-in agent or knowledge base layer; build retrieval logic in your application.
Identity and access controlMicrosoft Entra ID, Azure Private Link, document-level access control and role-based access.Postgres roles and row-level security, to confirm against your vector tables. Network controls are yours.
Client accessAzure portal, REST APIs and SDKs for .NET, Java, JavaScript and Python.Any Postgres SQL client, driver or ORM with vector type support. Confirm your driver supports it.

What the PostgreSQL License covers and what Azure bills

The PostgreSQL License is a permissive grant, and the pgvector LICENSE file is the document to read before anyone signs off on use. GitHub does not detect the license automatically, so the repository page will not give your legal or procurement team the answer on its own. Open the file and check two things: the copyright notices from the PostgreSQL Global Development Group and the Regents of the University of California, and the grant that permits use, copying, modification and distribution of the software. Record the version you deploy as well. The README's install instructions clone tag v0.8.7, so name that tag, or the exact build your platform team produces, in the review record.

Azure AI Search is a managed service billed by tier and units, so the license question turns into a cost question. The Azure AI Search pricing page lists per-unit limits that shape the choice: Basic at 15 GB and 15 indexes, S1 at 160 GB and 50 indexes, S2 at 512 GB and 200 indexes, and S3 at 1 TB and 200 indexes, with Storage Optimized L1 and L2 at 2 TB and 4 TB per unit. Compare your index count and corpus size against these limits before you compare costs, because the index limit can push you to a higher tier even when storage still fits. The semantic ranker includes 1,000 free requests a month and is not available on the dedicated Free tier. The same page describes a serverless model in preview with billing beginning September 13, 2026, so confirm which model your contract uses before you build the comparison.

The extension license does not cover the terms of any hosted Postgres provider. If the team runs pgvector on a managed Postgres service, the provider's terms, data location, backups and extension support are separate agreements that you must confirm yourself. The pgvector README links a list of hosted providers, and that list is a starting point, but a listing does not confirm which pgvector version, index types or dimension limits a provider enables. Ask each provider in writing which pgvector version it ships, whether HNSW and IVFFlat indexes are available, and which terms govern your data. File those answers with your license review so the cost model and the compliance evidence cover the same deployment.

Where the data lives and who operates it in each option

Azure AI Search and pgvector differ mainly in who holds the data, who controls access, who runs the server and who produces compliance evidence. Azure AI Search places those duties with Microsoft inside the regions you select, while pgvector places them with your team inside a Postgres server you operate. Check each card against your residency, identity and audit requirements before you compare costs.

Where the index data lives

Azure AI Search runs in the Azure region you select when you create the service. It indexes only JSON documents, pushed through the API or pulled by indexers from supported sources, so your source systems remain the system of record and a rebuild from source is the recovery path. Confirm the region, plus any replicas and backups, against your residency rules. With pgvector, the vectors sit in a Postgres server you operate in your cloud account, a data center or an air-gapped network, so location is your decision from the start. Also check where embedding models run and where logs and backups are written.

Who can query which documents

Azure AI Search supports Microsoft Entra ID, Azure Private Link, document-level access control and role-based access, so identity policy sits in the Azure tenant and network you already run. With pgvector, access is built from Postgres roles, grants and any row-level security policies you design and test, and single sign-on sits in your Postgres platform or access layer. Test document-level filtering first, because a row policy must hold on every query path, including approximate nearest neighbor searches and any application that connects with a shared service account.

Microsoft Learn overview

Who patches and backs up

Azure AI Search is a fully managed, cloud-hosted service, so Microsoft operates the service while you choose a tier and capacity. With pgvector, you run the extension inside a Postgres server, so your team or the hosted Postgres provider you pick owns patching, upgrades, backups and restore tests. A hosted Postgres provider changes who performs those tasks, but each task still needs a named owner. Confirm which Postgres major version the provider supports, since the pgvector README says the extension supports Postgres 13 and later.

pgvector repository

Who produces the evidence

For Azure AI Search, much of the control evidence for the managed service comes from Microsoft's documentation, and you still document your own configuration, access reviews and retention choices. For pgvector, the evidence is yours to produce: database audit logs, access reviews, change records and retention settings for backups and logs must come from your own controls. DeployOpen prepares that evidence but does not issue audit reports or certifications. Independent auditors and certification bodies make those determinations, so ask your assessor which artifacts they accept from each option before you choose.

How the retrieval pipeline changes when you move to Postgres

The diagram starts at your source systems and shows two routes to the same application. On the Azure path, an indexer or push API loads JSON documents, AI enrichment chunks and vectorizes them, and the search index serves queries. On the pgvector path, which runs inside your infrastructure, your loader and embedding job write chunks and vectors into a Postgres table with a vector column and an HNSW or IVFFlat index. The hand-offs to check are the embedding job and the table writes, since your team owns both. Mark where identity checks and audit logging sit in your design before you compare the two paths.

Azure path versus your own pipeline, with identity and audit controls inside your infrastructure.

What drives the cost of Azure AI Search compared with running pgvector

Azure AI Search bills by tier and search units. pgvector costs sit in the Postgres servers, embedding work and people you run yourself. The four cards separate one-time build and backfill costs from recurring ones, and each names the inputs to request in a written quote.

Search units by tier

Azure AI Search bills by tier and search units, and each tier caps storage and indexes per unit. Free offers 50 MB and 3 indexes, Basic 15 GB and 15 indexes, S1 160 GB and 50 indexes, S2 512 GB and 200 indexes, and S3 1 TB and 200 indexes. Storage Optimized L1 and L2 offer 2 TB and 4 TB with 10 indexes each. Standard and Storage Optimized scale to 36 units, and the semantic ranker includes 1,000 free requests a month but is unavailable on Free. The pricing page lists a serverless model in preview with billing beginning September 13, 2026, a date that has passed, so confirm current rates.

Azure AI Search pricing

Postgres servers and storage

Postgres servers are recurring costs for the instance, memory, disk, backups and any replicas. Vector count and dimensions set the size of the index, and pgvector indexes the vector type up to 2,000 dimensions. HNSW and IVFFlat indexes perform best when their index memory fits the server, so measure index size at your planned vector count. Query volume drives CPU and replica count. Ask for the instance class, storage size, backup retention and vector count the estimate assumes.

pgvector repository

Embedding calls and hosting

Embedding is paid once for the backfill of existing content and again for every change to source documents, since updated chunks must be re-embedded. Query-time embeddings add a cost that scales with traffic. A hosted embedding API bills per token or per request. A self-hosted model bills as compute, often GPU instances, whether or not queries arrive. Azure's integrated vectorization calls embedding services that may bill separately, so confirm which service your current pipeline calls and who pays for it.

Engineering and operations

Replacing indexers and skillsets is a one-time build: ingestion code, a pgvector schema, hybrid query logic and cutover testing. The recurring part is operations: Postgres minor and major upgrades, pgvector version upgrades, security patching, backup restore tests, monitoring and on-call. Azure's managed service carries much of this today, so these tasks move to your team or a partner. pgvector supports Postgres 13 and later, so plan around that floor. In a quote, ask for build milestones, upgrade cadence, on-call hours and separate one-time and monthly line items.

How a move off Azure AI Search to pgvector runs

This sequence moves Azure AI Search indexes, vectors and query logic into self-hosted Postgres with pgvector, running in your own infrastructure. It starts with an inventory of definitions, then decides vector by vector whether to keep or re-embed, and rebuilds ingestion from the source systems without copying Azure indexes. It ends with parallel testing, cutover and decommissioning once data deletion terms are confirmed.

  1. Inventory indexes, fields, filters and scoring

    Start with definitions, not data. List every index with its fields, key, analyzers, filters, facets, suggesters, scoring profiles and synonym maps, then list every indexer, skillset, data source and knowledge base that feeds or queries it. The search owner and the application team usually do this together, working from the Azure portal and REST definitions. Done when each index has a one-page schema record and each consuming application is named against it, so no query path is missed.

  2. Decide whether to keep or re-embed vectors

    For each vector field, record its name, dimension count, embedding model and version, and distance metric. The pgvector README says the vector type can be indexed up to 2,000 dimensions and halfvec up to 4,000, so any field above those limits needs a smaller model output or a redesign before it moves. Keep stored vectors only when the new query path will use the same model and the values can be read back for the copy. Otherwise re-embed from source during ingestion. Done when every vector field has a written keep or re-embed decision and a dimension check.

  3. Build the Postgres platform with pgvector

    Stand up a supported Postgres server in your own cloud account, data center or air-gapped network. The pgvector README says the extension supports Postgres 13 and later, so pick a version in that range that your DBA team supports. Install the extension from tag v0.8.7, the tag the README's install steps name, after checking that it is still the newest tag, and confirm the version with a query against the installed extension. Configure backups with a tested restore, TLS, role-based access for application and admin accounts, and audit logging. Done when a restore has been rehearsed and the extension version is recorded in your change log.

  4. Rebuild ingestion from the source systems

    Build new ingestion jobs that read from the systems of record. Azure AI Search can only index JSON documents, so each source needs a step that extracts text, applies the chunking and metadata rules from your Azure skillsets, and writes rows with stable IDs and access attributes into Postgres. Exporting Azure indexes would copy their schema, enrichment output and gaps, so avoid it. Done when a sample from each source reconciles on record counts and on a set of spot-checked documents, and the access attributes match the source permissions.

  5. Move query logic into application code

    Translate each OData filter into a parameterized SQL WHERE clause, and map each search request to the Postgres query it needs. Move hybrid ranking and each scoring profile, which combine keyword and vector scores, into the application or the query layer, and document the weights so they can be tuned. Move agentic retrieval steps, such as query rewriting and multi-step lookups, into orchestration code that you own, since pgvector does not provide a knowledge base layer. Done when a list of production queries returns the same filtered result sets in both systems, with the ranking differences documented.

  6. Run in parallel, cut over and decommission

    Send a fixed test set of queries to both systems and compare results, latency and access behavior before any traffic moves. Cut over application by application, keeping the Azure index available for rollback until the new path has run cleanly. Once the cutover is accepted, confirm the data deletion terms for your Azure subscription and any retention period in writing, then delete the search services and their keys. Done when the Azure resources are removed, the deletion is documented, and the Postgres backups cover the new data.

Questions teams ask about the Azure AI Search alternative cost and effort

What drives the cost of moving off Azure AI Search?

The main cost drivers are the engineering work to rebuild and validate the search layer and the infrastructure that replaces Azure's search units. One-time costs include the inventory, schema mapping, pipeline rewrite, relevance testing and cutover. Recurring costs include database or search server hosting, storage, backups, patching and on-call support. Costs rise with the number of indexes, document volume, vector dimensions, the number of indexers and skillsets, and whether existing vectors can be copied or must be re-embedded. Parallel running during cutover adds cost for the overlap period. On the Azure side, tier choice is set by storage and index limits per search unit, and the semantic ranker is billed separately. Confirm current rates on the Azure AI Search pricing page. Ask any quote to itemize internal effort, outside effort, hosting, and overlap costs separately.

How long does a migration from Azure AI Search take?

No single duration fits every team, because the length depends on scope. The main inputs are the number of indexes, indexers and skillsets, the size of the corpus and its change rate, whether vectors can be copied or must be re-embedded, how many applications call the search API, and how many query behaviors must match, such as filters, scoring profiles and synonym maps. Work usually runs in stages: inventory, schema mapping, ingestion rebuild, relevance testing, cutover and decommissioning. Ask for a written timeline with each stage, its owner and a named acceptance test. If a partner gives a duration before inventorying your indexes, ask which assumptions it depends on. Confirm Azure-side schedules and any indexer dependencies in your own environment before accepting any estimate.

What does a migration need from our internal team?

The internal team supplies knowledge of the source data, access approvals and decisions, while the build work can be shared with an outside partner. You need an owner for each source system, someone who knows how applications query the index, a security reviewer for identity and access rules, and an approver who signs off relevance results. Engineers must change application code that calls the Azure SDKs or REST APIs. Access is needed to the Azure portal or export tooling, the source databases or files, the embedding model choice, and the network where the new system will run. Azure AI Search supports document-level access control, so the equivalent filtering must be rebuilt in your own query layer and reviewed. Ask the partner to list these roles and handoffs in the written scope.

Can our own team run this migration without outside help?

Yes, a team with Postgres administration, search, and application experience can do it alone, but the risk sits in the parts it has not done before. The work most often under-scoped is relevance testing and cutover, because indexes can look correct while results drift. Teams usually buy outside help for specific pieces: an assessment of indexes and pipelines, a fixed-scope build, an independent security review of access rules, or retainer support after cutover. DeployOpen plans, implements, hardens, backs up and documents self-hosted platforms inside the client's own infrastructure. Most engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts. Ask any partner which parts they will hand over, what documentation you keep, and who operates the system after go-live.

Does pgvector retrieval quality match Azure AI Search on our data?

It can match, but only on your own data and settings, so test it before cutover. pgvector supports exact and approximate nearest neighbor search through HNSW and IVFFlat indexes, with several distance functions including cosine and inner product. Azure's results also depend on its vectorization, semantic ranker and hybrid scoring, so a fair comparison holds the embedding model constant across both systems. Build a labeled query set from live user searches, record the documents that should appear, and run both systems against the same vectors. Compare recall at the cutoff your application uses, review ranking on difficult queries, and measure approximate index settings against exact search. Include filtered queries, because filters often change results. Agree the acceptance threshold in the written scope.

Does keyword search survive the move from Azure AI Search?

Keyword search can move, but it must be rebuilt and retested because scoring will differ. Azure AI Search full-text search uses its own analyzers, scoring profiles, synonym maps and suggesters. pgvector covers vectors only, so the keyword side typically uses Postgres full-text search (tsvector columns with GIN indexes) or a dedicated search engine running next to Postgres. Hybrid search needs both sides plus a merge step, which you configure and test. Inventory the analyzers, languages, synonyms, boosts and suggesters each index uses, and map each one to a target feature. Expect some query behavior to change, and document every change so application owners can review it. Confirm which features your applications actually call before assuming parity.

Can Azure AI Search keep running as a fallback during cutover?

Yes, if you keep the Azure index and its ingestion running until the new path passes acceptance, and you plan routing before cutover. Common options include a configuration switch in the application that routes queries to either backend, a shadow period where queries run on both systems and results are compared without serving users from the new one, and a frozen Azure index as the rollback target. Ingestion is the hard part: while both systems run, document changes must reach both, or you accept and record a gap. Running both systems costs more during the overlap, so ask the quote to price that period separately and check current rates on the Azure pricing page. Define the rollback trigger, how long Azure stays on, and keep copies of index, indexer and skillset definitions before decommissioning.

How DeployOpen helps teams evaluate and move off Azure AI Search

DeployOpen helps teams decide whether Azure AI Search or self-hosted pgvector fits their retrieval workload, then plans and builds the chosen option inside their own cloud account, data center or air-gapped network. Work starts from a written scope that covers the index, filter and access requirements, the embedding pipeline and the systems that must be re-indexed. Each step ends with documentation the client's own security and compliance teams can review.

How we scope

  • The written scope lists each Azure AI Search index, its filters, ranking needs and feeding source systems.
  • Scope also records Entra ID, Private Link and document-level access rules that the replacement must enforce.
  • Engagements are fixed-scope, so deliverables and timelines are agreed in writing before work starts.

How we build

  • Index schemas are rebuilt as pgvector tables with columns for metadata, full-text search and vector embeddings.
  • HNSW or IVFFlat indexes are tuned against the recall and latency targets agreed in the scope.
  • Ingestion moves from Azure indexers and skillsets to pipelines the client's team can operate and monitor.

How we hand over

  • Handover covers the runbook, schema and index definitions, pipeline code and access model, delivered to your team.
  • Compliance evidence, such as configuration records and access reviews, is prepared for your independent auditors to assess.
  • The cutover plan includes a rollback path and a retest of search results and access controls.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Security testing of the search API, the application and the agents that query it can be scoped separately.
  • Ask whether retainers cover pgvector version upgrades, Postgres major versions and backup restore tests.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.