Vector also supports the self-querying retriever functionality, which gives it the ability to query itself. Given a natural language query with a query statement and filters (single or composite), the retriever uses a query constructing LLM chain to write a SQL query and then applies it to the underlying PostgreSQL database in the Timescale Vector vectorstore.For more on self-querying, see the docs.To illustrate self-querying with Timescale Vector, we'll use the same gitlog dataset from Part 3.COLLECTION_NAME = "timescale_commits"vectorstore = TimescaleVector(    embedding_function=OpenAIEmbeddings(),    collection_name=COLLECTION_NAME,    service_url=SERVICE_URL,)Next we'll create our self-querying 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="id",        description="A UUID v1 generated from the date of the commit",        type="uuid",    ),    AttributeInfo(        name="date",        description="The date of the commit in timestamptz format",        type="timestamptz",    ),    AttributeInfo(        name="author_name",        description="The name of the author of the commit",        type="string",    ),    AttributeInfo(        name="author_email",        description="The email address of the author of the commit",        type="string",    )]document_content_description = "The git log commit summary containing the commit hash, author, date of commit, change summary and change details"# Instantiate the self-query retriever from an LLMllm = OpenAI(temperature=0)retriever = SelfQueryRetriever.from_llm(    llm, vectorstore, document_content_description, metadata_field_info,
This notebook shows how to use the Postgres vector database Timescale Vector. You'll learn how to use TimescaleVector for (1) semantic search, (2) time-based vector search, (3) self-querying, and (4) how to create indexes to speed up queries.
This notebook shows how to use the Postgres vector database Timescale Vector. You'll learn how to use TimescaleVector for (1) semantic search, (2) time-based vector search, (3) self-querying, and (4) how to create indexes to speed up queries. ->: Vector also supports the self-querying retriever functionality, which gives it the ability to query itself. Given a natural language query with a query statement and filters (single or composite), the retriever uses a query constructing LLM chain to write a SQL query and then applies it to the underlying PostgreSQL database in the Timescale Vector vectorstore.For more on self-querying, see the docs.To illustrate self-querying with Timescale Vector, we'll use the same gitlog dataset from Part 3.COLLECTION_NAME = "timescale_commits"vectorstore = TimescaleVector(    embedding_function=OpenAIEmbeddings(),    collection_name=COLLECTION_NAME,    service_url=SERVICE_URL,)Next we'll create our self-querying 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="id",        description="A UUID v1 generated from the date of the commit",        type="uuid",    ),    AttributeInfo(        name="date",        description="The date of the commit in timestamptz format",        type="timestamptz",    ),    AttributeInfo(        name="author_name",        description="The name of the author of the commit",        type="string",    ),    AttributeInfo(        name="author_email",        description="The email address of the author of the commit",        type="string",    )]document_content_description = "The git log commit summary containing the commit hash, author, date of commit, change summary and change details"# Instantiate the self-query retriever from an LLMllm = OpenAI(temperature=0)retriever = SelfQueryRetriever.from_llm(    llm, vectorstore, document_content_description, metadata_field_info,