Skip to content

Conversation

@AbeOmor
Copy link

@AbeOmor AbeOmor commented Oct 14, 2025

Overview

Description: Added vector store and memory usage documentation for Azure Database for PostgreSQL using our NEW LangChain/LangGraph connector

This PR to show support for the Azure Database for PostgreSQL Vector Store and pgVector in a Notebook

Azure Database for PostgreSQL - Flexible Server
Azure Database for PostgreSQL pgvector extension

Issue: Last PR was closed because we didn't have a LangChain package of Azure Postgres #27129. We just release one this month: https://pypi.org/project/langchain-azure-postgresql/

Twitter handle: @_aiabe

Type of change

New documentation page

Related issues/PRs

Checklist

  • I have read the contributing guidelines
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed
  • I have gotten approval from the relevant reviewers

Additional notes

This was already reviewed by @ccurme, @mdrxy and @Kpreya in the LangChain repo. I was asked to move to this repo.

Copilot AI review requested due to automatic review settings October 14, 2025 01:59
@vercel
Copy link

vercel bot commented Oct 14, 2025

@AbeOmor is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added langchain For docs changes to LangChain python For content related to the Python version of LangChain projects oss labels Oct 14, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive documentation for the Azure Database for PostgreSQL vector store integration by introducing a new notebook demonstrating vector storage and memory usage capabilities using the newly released LangChain Azure PostgreSQL connector package.

  • Adds a new documentation page for Azure Database for PostgreSQL - Flexible Server vector store
  • Updates the vector stores index to include the new Azure PostgreSQL integration
  • Demonstrates both Microsoft Entra authentication and password-based authentication methods

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/oss/python/integrations/vectorstores/index.mdx Adds navigation card for the new Azure Database for PostgreSQL integration and reorganizes Azure service cards
src/oss/python/integrations/vectorstores/azure_db_for_postgresql.mdx New comprehensive documentation page covering setup, authentication, vector operations, and usage examples for Azure PostgreSQL vector store

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings October 14, 2025 02:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings October 24, 2025 16:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

<Card title="Azure Cosmos DB Mongo vCore" icon="link" href="/oss/integrations/vectorstores/azure_cosmos_db_mongo_vcore" arrow="true" cta="View guide"/>
<Card title="Azure Database for PostgreSQL - Flexible Server" icon="link" href="/oss/integrations/vectorstores/azure_db_for_postgresql" arrow="true" cta="View guide"/>
<Card title="Azure Cosmos DB No SQL" icon="link" href="/oss/integrations/vectorstores/azure_cosmos_db_no_sql" arrow="true" cta="View guide"/>
<Card title="Azure Cosmos DB Mongo vCore" icon="link" href="/oss/integrations/vectorstores/azure_cosmos_db" arrow="true" cta="View guide"/>
Copy link

Copilot AI Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The href path appears incorrect. The original line referenced '/oss/integrations/vectorstores/azure_cosmos_db_mongo_vcore' but the new path is '/oss/integrations/vectorstores/azure_cosmos_db'. Verify this path change is intentional and that the corresponding file exists at this location.

Suggested change
<Card title="Azure Cosmos DB Mongo vCore" icon="link" href="/oss/integrations/vectorstores/azure_cosmos_db" arrow="true" cta="View guide"/>
<Card title="Azure Cosmos DB Mongo vCore" icon="link" href="/oss/integrations/vectorstores/azure_cosmos_db_mongo_vcore" arrow="true" cta="View guide"/>

Copilot uses AI. Check for mistakes.
@vercel
Copy link

vercel bot commented Oct 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
reference-docs Canceled Canceled Oct 24, 2025 5:03pm

@mdrxy mdrxy changed the title docs(langchain): adding Azure Database for PostgreSQL example notebook integration: adding Azure Database for PostgreSQL example notebook Oct 27, 2025
Copilot AI review requested due to automatic review settings October 27, 2025 20:30
…ql.mdx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


## Setup

Since Azure Database for PostgreSQL is open-source Postgres, you can use [LangChain's Postgres support](https://python.langchain.com/docs/integrations/vectorstores/pgvector/) to connect to Azure Database for PostgreSQL.
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement is misleading. The documentation then proceeds to use the langchain-azure-postgresql package exclusively, not LangChain's standard Postgres support. Consider revising to: 'Azure Database for PostgreSQL is based on open-source Postgres. This integration uses the dedicated langchain-azure-postgresql package which provides optimized support including DiskANN indexing and Microsoft Entra authentication.'

Suggested change
Since Azure Database for PostgreSQL is open-source Postgres, you can use [LangChain's Postgres support](https://python.langchain.com/docs/integrations/vectorstores/pgvector/) to connect to Azure Database for PostgreSQL.
Azure Database for PostgreSQL is based on open-source Postgres. This integration uses the dedicated [`langchain-azure-postgresql`](https://pypi.org/project/langchain-azure-postgresql/) package, which provides optimized support including DiskANN indexing and Microsoft Entra authentication.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +34
First download the partner package:

```python
%pip install -qU langchain-azure-postgresql
%pip install -qU langchain-openai
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The azure-identity package is only required when using Microsoft Entra authentication. Consider adding a note that this dependency is optional for password-based authentication, or restructure the installation instructions to clarify when each package is needed.

Suggested change
First download the partner package:
```python
%pip install -qU langchain-azure-postgresql
%pip install -qU langchain-openai
First download the partner packages:
```python
%pip install -qU langchain-azure-postgresql
%pip install -qU langchain-openai

If you plan to use Microsoft Entra authentication, you will also need to install the azure-identity package:

Copilot uses AI. Check for mistakes.
Embedding dimension is not specified, defaulting to 1536.
Embedding index is not specified, defaulting to 'DiskANN' with 'vector_cosine_ops' opclass.
```

Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These output messages suggest that parameters can be explicitly specified to override defaults, but the documentation doesn't explain how to configure these options (metadata type, embedding dimension, index type, etc.). Consider adding a section or note explaining these configuration options, especially since DiskANN indexing is highlighted as a key feature.

Suggested change
## Configuring Vector Store Parameters
You can override the default parameters for metadata type, embedding dimension, index type, and more when initializing `AzurePGVectorStore`. This allows you to tailor the vector store to your specific use case and data.
**Key configuration options:**
- `metadata_column_type`: The type of the metadata column (default: `'jsonb'`). Set to `'jsonb'`, `'text'`, etc.
- `embedding_column_type`: The type of the embedding column (default: `'vector'`).
- `embedding_dimension`: The dimension of your embedding vectors (default: `1536`).
- `embedding_index_type`: The index type for vector search (default: `'DiskANN'`). Other options may include `'ivfflat'`, `'hnsw'`, etc.
- `embedding_index_opclass`: The operator class for the index (default: `'vector_cosine_ops'`).
**Example:**
```python
vector_store = AzurePGVectorStore(
embedding=embeddings,
table_name=table_name,
connection=connection,
metadata_column_type="jsonb", # or "text"
embedding_column_type="vector",
embedding_dimension=768, # set to match your model's output
embedding_index_type="DiskANN", # or "ivfflat", "hnsw", etc.
embedding_index_opclass="vector_cosine_ops", # or "vector_l2_ops", etc.
)

For a full list of options and their defaults, refer to the AzurePGVectorStore API reference.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants