LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.storebaseSearchOp
    Classā—Since v1.0

    SearchOp

    Copy
    SearchOp()

    Bases

    NamedTuple

    Used in Docs

    • Aerospike integrations

    Attributes

    View source on GitHub
    attribute
    namespace_prefix: tuple[str, ...]

    Hierarchical path prefix defining the search scope.

    Examples
    ()  # Search entire store
    ("documents",)  # Search all documents
    ("users", "content")  # Search within user content
    attribute
    filter: dict[str, Any] | None

    Key-value pairs for filtering results based on exact matches or comparison operators.

    The filter supports both exact matches and operator-based comparisons.

    attribute
    limit: int

    Maximum number of items to return in the search results.

    attribute
    offset: int

    Number of matching items to skip for pagination.

    attribute
    query: str | None

    Natural language search query for semantic search capabilities.

    Examples
    • "technical documentation about REST APIs"
    • "machine learning papers from 2023"
    attribute
    refresh_ttl: bool

    Whether to refresh TTLs for the returned item.

    If no TTL was specified for the original item(s), or if TTL support is not enabled for your adapter, this argument is ignored.

    Operation to search for items within a specified namespace hierarchy.

    This operation supports both structured filtering and natural language search within a given namespace prefix. It provides pagination through limit and offset parameters.

    Note

    Natural language search support depends on your store implementation.

    Examples

    Search with filters and pagination:

    SearchOp(
        namespace_prefix=("documents",),
        filter={"type": "report", "status": "active"},
        limit=5,
        offset=10
    )

    Natural language search:

    SearchOp(
        namespace_prefix=("users", "content"),
        query="technical documentation about APIs",
        limit=20
    )