langchain-ai / langchain-postgres

LangChain abstractions backed by Postgres Backend
MIT License
134 stars 48 forks source link

Provide a way to override query building logic #134

Open Voileexperiments opened 1 month ago

Voileexperiments commented 1 month ago

Currently __query_collection is double underscore prefixed, which means it takes some extra effort to override the logic for building the queries.

This makes the class completely inextensible and non-customizable. It's also very strange, since if I'm using postgres (compared to something infinitely easier to setup and use, like ChromaDB) to operate embedding data, obviously I'm trying to utilize its RDBMS features, which means I might want to customize my queries to join tables. With the current design it's not "intended" for users to do this in the first place, which makes the class very useless.