SchemagateRetriever
A retriever component in LangChain for retrieving database schemas on demand in Text-to-SQL scenarios. It performs offline table selection based on BM25 and a small embedder, supports permission filtering, and returns DDL documents for the relevant tables.
Timeline (last 90 days)
The official LangChain documentation has newly added SchemagateRetriever, listed under the Retrievers category.
SchemagateRetriever was tested on Snowflake and BigQuery schemas containing more than 50 tables (the Spider 2.0 benchmark), and the median prompt size was reduced by 92.9%.
On BIRD's seven-table database, SchemagateRetriever reduced prompt size by only 8.8%.
SchemagateRetriever's selection process is fully offline, relying on BM25 plus a small embedder, and makes no model calls.
SchemagateRetriever inherits from LangChain's BaseRetriever, so it can be plugged directly into existing chain compositions.
SchemagateRetriever's permission filtering happens at the retrieval stage, rather than intercepting after the model has generated SQL.
SchemagateRetriever uses the Principal parameter to carry the caller's identity and role, together with top_k to control the upper limit of candidate tables.
SchemagateRetriever returns one Document per table, and each Document contains that table's DDL.
SchemagateRetriever can be installed via pip install langchain-schemagate.
SchemagateRetriever's source code is hosted on GitHub (ashishsinha1602/schemagate).
1 more timeline events
All Facts (11)
The official LangChain documentation has newly added SchemagateRetriever, listed under the Retrievers category.
50%UnverifiedSchemagateRetriever was tested on Snowflake and BigQuery schemas containing more than 50 tables (the Spider 2.0 benchmark), and the median prompt size was reduced by 92.9%.
50%UnverifiedOn BIRD's seven-table database, SchemagateRetriever reduced prompt size by only 8.8%.
50%UnverifiedSchemagateRetriever's selection process is fully offline, relying on BM25 plus a small embedder, and makes no model calls.
50%UnverifiedSchemagateRetriever inherits from LangChain's BaseRetriever, so it can be plugged directly into existing chain compositions.
50%UnverifiedSchemagateRetriever's permission filtering happens at the retrieval stage, rather than intercepting after the model has generated SQL.
50%UnverifiedSchemagateRetriever uses the Principal parameter to carry the caller's identity and role, together with top_k to control the upper limit of candidate tables.
50%UnverifiedSchemagateRetriever returns one Document per table, and each Document contains that table's DDL.
50%UnverifiedSchemagateRetriever can be installed via pip install langchain-schemagate.
50%UnverifiedSchemagateRetriever's source code is hosted on GitHub (ashishsinha1602/schemagate).
50%UnverifiedSchemagateRetriever's differentiators include: permission-aware retrieval, offline lightweight selection (BM25 plus a small embedder, with no model calls), and the composability brought by the standard Retriever interface.
50%