LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    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
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph-sdk_syncstoreSyncStoreClientget_item
    Methodā—Since v0.3

    get_item

    Copy
    get_item(
      self,
      namespace: Sequence[str],
      ,
      key: str,
      *,
      
    View source on GitHub
    refresh_ttl
    :
    bool
    |
    None
    =
    None
    ,
    headers
    :
    Mapping
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    params
    :
    QueryParamTypes
    |
    None
    =
    None
    )
    ->
    Item

    Parameters

    NameTypeDescription
    key*str

    The unique identifier for the item.

    namespace*Sequence[str]

    Optional list of strings representing the namespace path.

    refresh_ttlbool | None
    Default:None

    Whether to refresh the TTL on this read operation. If None, uses the store's default behavior.

    headersMapping[str, str] | None
    Default:None

    Retrieve a single item.

    client = get_sync_client(url="http://localhost:8123")
    item = client.store.get_item(
        ["documents", "user123"],
        key="item456",
    )
    print(item)
    ----------------------------------------------------------------
    
    {
        'namespace': ['documents', 'user123'],
        'key': 'item456',
        'value': {'title': 'My Document', 'content': 'Hello World'},
        'created_at': '2024-07-30T12:00:00Z',
        'updated_at': '2024-07-30T12:00:00Z'
    }

    Optional custom headers to include with the request.