[PR #193] [MERGED] docs: partial tutorial rework #222

Closed
opened 2026-02-16 05:17:01 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langchain-postgres/pull/193
Author: @eyurtsev
Created: 4/8/2025
Status: Merged
Merged: 4/9/2025
Merged by: @eyurtsev

Base: mainHead: eugene/tutorial_rework_2


📝 Commits (2)

📊 Changes

1 file changed (+185 additions, -395 deletions)

View changed files

📝 examples/pg_vectorstore.ipynb (+185 -395)

📄 Description

Changes made

  1. Remove information about different PGEngine vectorization
  2. Remove add_texts API. Add_documents is the best way to do this and we don't need to show two ways of doing the same stuff.
  3. Replace "best practices" with concrete reasons why

Outstanding Changes

  1. Restructure so that the first created tables has metadata columns. We need to make the quickstart as short as possible end-to-end.

i.e., the first table creation should contain the metadata columns

from langchain_postgres import Column
from langchain_postgres import PGVectorStore


TABLE_NAME = "my_vectorstore_2"

await pg_engine.ainit_vectorstore_table(
    table_name=TABLE_NAME,
    vector_size=VECTOR_SIZE,
    metadata_columns=[
        Column("location", "TEXT"), 
        Column("topic", "TEXT"), 
    ],
)
  1. Documenting the types of Columns explicitly
  2. Documenting the filtering syntax
  3. Documenting what reindex does
  4. Capture the duplicated tables exception as narrowly as possible (or move into API)

Filtering syntax:

Filtering Support

The vectorstore supports a set of filters that can be applied against the metadata fields of the documents.


| Operator  | Meaning/Category        |
|-----------|-------------------------|
| $eq      | Equality (==)           |
| $ne      | Inequality (!=)         |
| $lt      | Less than (<)           |
| $lte     | Less than or equal (<=) |
| $gt      | Greater than (>)        |
| $gte     | Greater than or equal (>=) |
| $in      | Special Cased (in)      |
| $nin     | Special Cased (not in)  |
| $between | Special Cased (between) |
| $exists  | Special Cased (is null) |
| $like    | Text (like)             |
| $ilike   | Text (case-insensitive like) |
| $and     | Logical (and)           |
| $or      | Logical (or)            |

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langchain-postgres/pull/193 **Author:** [@eyurtsev](https://github.com/eyurtsev) **Created:** 4/8/2025 **Status:** ✅ Merged **Merged:** 4/9/2025 **Merged by:** [@eyurtsev](https://github.com/eyurtsev) **Base:** `main` ← **Head:** `eugene/tutorial_rework_2` --- ### 📝 Commits (2) - [`021ab45`](https://github.com/langchain-ai/langchain-postgres/commit/021ab4575def50b3d548342b39d484de3b463a19) x - [`f257baa`](https://github.com/langchain-ai/langchain-postgres/commit/f257baaa0af278029ef0a60bafa4ef63e0f6f81a) Respond to feedback ### 📊 Changes **1 file changed** (+185 additions, -395 deletions) <details> <summary>View changed files</summary> 📝 `examples/pg_vectorstore.ipynb` (+185 -395) </details> ### 📄 Description # Changes made 1. Remove information about different PGEngine vectorization 2. Remove add_texts API. Add_documents is the best way to do this and we don't need to show two ways of doing the same stuff. 3. Replace "best practices" with concrete reasons why # Outstanding Changes 1. Restructure so that the first created tables has metadata columns. We need to make the quickstart as short as possible end-to-end. i.e., the first table creation should contain the metadata columns ```python from langchain_postgres import Column from langchain_postgres import PGVectorStore TABLE_NAME = "my_vectorstore_2" await pg_engine.ainit_vectorstore_table( table_name=TABLE_NAME, vector_size=VECTOR_SIZE, metadata_columns=[ Column("location", "TEXT"), Column("topic", "TEXT"), ], ) ``` 2. Documenting the types of Columns explicitly 3. Documenting the filtering syntax 4. Documenting what reindex does 5. Capture the duplicated tables exception as narrowly as possible (or move into API) Filtering syntax: ## Filtering Support The vectorstore supports a set of filters that can be applied against the metadata fields of the documents. ```md | Operator | Meaning/Category | |-----------|-------------------------| | $eq | Equality (==) | | $ne | Inequality (!=) | | $lt | Less than (<) | | $lte | Less than or equal (<=) | | $gt | Greater than (>) | | $gte | Greater than or equal (>=) | | $in | Special Cased (in) | | $nin | Special Cased (not in) | | $between | Special Cased (between) | | $exists | Special Cased (is null) | | $like | Text (like) | | $ilike | Text (case-insensitive like) | | $and | Logical (and) | | $or | Logical (or) | ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 05:17:01 -05:00
yindo closed this issue 2026-02-16 05:17:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#222