Skip to content

Conversation

@eyurtsev
Copy link
Collaborator

@eyurtsev eyurtsev commented Apr 8, 2025

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)            |
Copy link
Collaborator

@averikitsch averikitsch left a comment

Choose a reason for hiding this comment

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

I have added more changes. PTAL. This should pair well with the how-to

@averikitsch averikitsch marked this pull request as ready for review April 9, 2025 23:28
@eyurtsev eyurtsev merged commit dbed216 into main Apr 10, 2025
5 checks passed
@eyurtsev eyurtsev deleted the eugene/tutorial_rework_2 branch April 10, 2025 01:36
@eyurtsev
Copy link
Collaborator Author

@averikitsch this looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants