d
WE ARE EXPERTS IN TECHNOLOGY

Let’s Work Together

n

StatusNeo

Improving Retrieval Augmented Generation: Self Querying Retrieval


  • the person types in the query 
  • we use a language model to reformat the query to get semantic elements of the query
  • we also convert the query so we can do searches on metadata. 

  • llm is for passing a language model.
  • vectorstore is used to pass a vector store
  • The name of the document_contents parameter is a bit misleading. It doesn’t refer to the actual contents of the stored documents but rather a short description of them. This is most confusing to us. document_content_description would be a better name.
  • metadata_field_info is a sequence of AttributeInfo objects, dictionaries containing information about the data in the vector database. We define a list of AttributeInfoobjects which contains information about what each attribute is and its datatype so that the language model knows what it is dealing with. 
query_constructor = load_query_constructor_runnable(
    llm, ##llm
    document_contents, #description of the documents
    metadata_field_info, #metadata information
    enable_limit=enable_limit,
    **chain_kwargs
)
return cls(
    query_constructor=query_constructor,
    vectorstore=vectorstore, #vector database
    use_original_query=use_original_query,
    structured_query_translator=structured_query_translator,
**kwargs,
)

An AI/GEN AI professional crisscrossing the currents of technology and logic. You can find him on LinkedIn AT [https://www.linkedin.com/in/rahultheogre/]