1979,            "rating": 9.9,            "director": "Andrei Tarkovsky",            "genre": "science fiction",            "rating": 9.9,        },    ),]Finally, we'll create our Timescale Vector vectorstore. Note that the collection name will be the name of the PostgreSQL table in which the documents are stored in.COLLECTION_NAME = "langchain_self_query_demo"vectorstore = TimescaleVector.from_documents(    embedding=embeddings,    documents=docs,    collection_name=COLLECTION_NAME,    service_url=TIMESCALE_SERVICE_URL,)Creating our self-querying retriever‚ÄãNow we can instantiate our retriever. To do this we'll need to provide some information upfront about the metadata fields that our documents support and a short description of the document contents.from langchain.llms import OpenAIfrom langchain.retrievers.self_query.base import SelfQueryRetrieverfrom langchain.chains.query_constructor.base import AttributeInfo# Give LLM info about the metadata fieldsmetadata_field_info = [    AttributeInfo(        name="genre",        description="The genre of the movie",        type="string or list[string]",    ),    AttributeInfo(        name="year",        description="The year the movie was released",        type="integer",    ),    AttributeInfo(        name="director",        description="The name of the movie director",        type="string",    ),    AttributeInfo(        name="rating", description="A 1-10 rating for the movie", type="float"    ),]document_content_description = "Brief summary of a movie"# Instantiate the self-query retriever from an LLMllm = OpenAI(temperature=0)retriever = SelfQueryRetriever.from_llm(    llm, vectorstore, document_content_description, metadata_field_info, verbose=True)Self Querying Retrieval with Timescale Vector‚ÄãAnd now we can try actually using our retriever!Run the queries below and note how you can specify a query, filter, composite filter (filters with AND, OR) in natural language and the self-query retriever will translate
Timescale Vector is PostgreSQL++ for AI applications. It enables you to efficiently store and query billions of vector embeddings in PostgreSQL.
Timescale Vector is PostgreSQL++ for AI applications. It enables you to efficiently store and query billions of vector embeddings in PostgreSQL. ->: 1979,            "rating": 9.9,            "director": "Andrei Tarkovsky",            "genre": "science fiction",            "rating": 9.9,        },    ),]Finally, we'll create our Timescale Vector vectorstore. Note that the collection name will be the name of the PostgreSQL table in which the documents are stored in.COLLECTION_NAME = "langchain_self_query_demo"vectorstore = TimescaleVector.from_documents(    embedding=embeddings,    documents=docs,    collection_name=COLLECTION_NAME,    service_url=TIMESCALE_SERVICE_URL,)Creating our self-querying retriever‚ÄãNow we can instantiate our retriever. To do this we'll need to provide some information upfront about the metadata fields that our documents support and a short description of the document contents.from langchain.llms import OpenAIfrom langchain.retrievers.self_query.base import SelfQueryRetrieverfrom langchain.chains.query_constructor.base import AttributeInfo# Give LLM info about the metadata fieldsmetadata_field_info = [    AttributeInfo(        name="genre",        description="The genre of the movie",        type="string or list[string]",    ),    AttributeInfo(        name="year",        description="The year the movie was released",        type="integer",    ),    AttributeInfo(        name="director",        description="The name of the movie director",        type="string",    ),    AttributeInfo(        name="rating", description="A 1-10 rating for the movie", type="float"    ),]document_content_description = "Brief summary of a movie"# Instantiate the self-query retriever from an LLMllm = OpenAI(temperature=0)retriever = SelfQueryRetriever.from_llm(    llm, vectorstore, document_content_description, metadata_field_info, verbose=True)Self Querying Retrieval with Timescale Vector‚ÄãAnd now we can try actually using our retriever!Run the queries below and note how you can specify a query, filter, composite filter (filters with AND, OR) in natural language and the self-query retriever will translate