LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicretrieversself_querybaseSelfQueryRetriever
    Class●Since v1.0

    SelfQueryRetriever

    Copy
    SelfQueryRetriever()

    Bases

    BaseRetriever

    Used in Docs

    • Astra DB integrations
    • Chroma integrations
    • Docugami integration
    • Self Querying with SAP HANA Cloud Vector Engine
    • Timescale vector (Postgres) integration

    Attributes

    Methods

    Inherited fromBaseRetriever(langchain_core)

    Attributes

    AtagsAmetadata

    Methods

    MinvokeMainvoke

    Inherited from

    View source on GitHub
    RunnableSerializable
    (langchain_core)

    Attributes

    Aname

    Methods

    Mto_jsonMconfigurable_fieldsMconfigurable_alternatives

    Inherited fromSerializable(langchain_core)

    Attributes

    Alc_secretsAlc_attributes

    Methods

    Mis_lc_serializableMget_lc_namespaceMlc_idMto_jsonMto_json_not_implemented

    Inherited fromRunnable(langchain_core)

    Attributes

    AnameAInputTypeAOutputTypeAinput_schemaAoutput_schemaAconfig_specs

    Methods

    Mget_nameMget_input_schemaMget_input_jsonschemaMget_output_schemaMget_output_jsonschemaM
    attribute
    vectorstore: VectorStore

    The underlying vector store from which documents will be retrieved.

    attribute
    query_constructor: Runnable[dict, StructuredQuery]

    The query constructor chain for generating the vector store queries.

    llm_chain is legacy name kept for backwards compatibility.

    attribute
    search_type: str

    The search type to perform on the vector store.

    attribute
    search_kwargs: dict

    Keyword arguments to pass in to the vector store search.

    attribute
    structured_query_translator: Visitor

    Translator for turning internal query language into VectorStore search params.

    attribute
    verbose: bool
    attribute
    use_original_query: bool

    Use original query instead of the revised new query from LLM

    attribute
    model_config
    attribute
    llm_chain: Runnable

    llm_chain is legacy name kept for backwards compatibility.

    method
    validate_translator

    Validate translator.

    method
    from_llm

    Create a SelfQueryRetriever from an LLM and a vector store.

    Self Query Retriever.

    Retriever that uses a vector store and an LLM to generate the vector store queries.

    config_schema
    Mget_config_jsonschema
    Mget_graph
    Mget_prompts
    Mpipe
    Mpick
    Massign
    Minvoke
    Mainvoke
    Mbatch
    Mbatch_as_completed
    Mabatch
    Mabatch_as_completed
    Mstream
    Mastream
    Mastream_log
    Mastream_events
    Mtransform
    Matransform
    Mbind
    Mwith_config
    Mwith_listeners
    Mwith_alisteners
    Mwith_types
    Mwith_retry
    Mmap
    Mwith_fallbacks
    Mas_tool