-
Couldn't load subscription status.
- Fork 394
integration: adding Azure Database for PostgreSQL example notebook #872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@AbeOmor is attempting to deploy a commit to the LangChain Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this 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 |
src/oss/python/integrations/vectorstores/azure_db_for_postgresql.mdx
Outdated
Show resolved
Hide resolved
src/oss/python/integrations/vectorstores/azure_db_for_postgresql.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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.
There was a problem hiding this 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.
src/oss/python/integrations/vectorstores/azure_db_for_postgresql.mdx
Outdated
Show resolved
Hide resolved
src/oss/python/integrations/vectorstores/azure_db_for_postgresql.mdx
Outdated
Show resolved
Hide resolved
| <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"/> |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
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.
| <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"/> |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ql.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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. |
Copilot
AI
Oct 27, 2025
There was a problem hiding this comment.
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.'
| 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. |
| First download the partner package: | ||
|
|
||
| ```python | ||
| %pip install -qU langchain-azure-postgresql | ||
| %pip install -qU langchain-openai |
Copilot
AI
Oct 27, 2025
There was a problem hiding this comment.
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.
| 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:
| Embedding dimension is not specified, defaulting to 1536. | ||
| Embedding index is not specified, defaulting to 'DiskANN' with 'vector_cosine_ops' opclass. | ||
| ``` | ||
|
|
Copilot
AI
Oct 27, 2025
There was a problem hiding this comment.
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.
| ## 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.
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
docs devsrc/docs.jsonif neededAdditional notes
This was already reviewed by @ccurme, @mdrxy and @Kpreya in the LangChain repo. I was asked to move to this repo.