# FoundryConversationChainStore

> **Class** in `langchain_azure_ai`

📖 [View in docs](https://reference.langchain.com/python/langchain-azure-ai/agents/hosting/_responses/conversation_chain_store/FoundryConversationChainStore)

Store each conversation chain in a separate ``FoundryStateStore``.

Store creation and reuse follow ``FoundryStateStore.get_or_create`` semantics.
``user_isolation``, ``item_ttl_seconds``, ``description``, and ``tags`` apply
only when the underlying store is first created. Existing stores retain
their settings; neither mismatch policy updates them.

By default, each read and write fetches the store properties and fails before
item access if isolation or TTL differs from this instance's options. Set
``on_mismatch="ignore"`` to skip this validation and use existing settings.
In that mode, passing ``user_isolation=True`` does not enable isolation on
an existing non-isolated store; callers must ensure its settings are suitable.

## Signature

```python
FoundryConversationChainStore(
    self,
    credential: AsyncTokenCredential | None = None,
    endpoint: FoundryStorageEndpoint | str | None = None,
    *,
    user_isolation: bool = False,
    item_ttl_seconds: int = DEFAULT_ITEM_TTL_SECONDS,
    description: str | None = 'LangChain conversation state',
    tags: Mapping[str, str] | None = None,
    user_id: str | None = None,
    api_version: str = 'v1',
    on_mismatch: Literal['fail', 'ignore'] = 'fail',
    kwargs: Any = {},
)
```

## Description

**Example:**

Require Foundry user isolation, rejecting incompatible stores::

    from langchain_azure_ai.agents.hosting import (
        FoundryConversationChainStore,
    )

    store = FoundryConversationChainStore(user_isolation=True)

Explicitly retain existing store settings instead::

    store = FoundryConversationChainStore(on_mismatch="ignore")

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `credential` | `AsyncTokenCredential \| None` | No | Optional async Azure credential. (default: `None`) |
| `endpoint` | `FoundryStorageEndpoint \| str \| None` | No | Foundry project or storage endpoint. (default: `None`) |
| `user_isolation` | `bool` | No | Whether the underlying state store isolates items by the Foundry-resolved user. Defaults to ``False``. Applied on creation and checked on reuse unless ``on_mismatch="ignore"``. (default: `False`) |
| `item_ttl_seconds` | `int` | No | Write-sliding item TTL fixed when each state store is first created. Defaults to ``DEFAULT_ITEM_TTL_SECONDS`` (30 days). ``-1`` disables expiration. Checked on reuse unless ``on_mismatch="ignore"``. (default: `DEFAULT_ITEM_TTL_SECONDS`) |
| `description` | `str \| None` | No | Description assigned when each state store is created. (default: `'LangChain conversation state'`) |
| `tags` | `Mapping[str, str] \| None` | No | Metadata tags assigned when each state store is created. (default: `None`) |
| `user_id` | `str \| None` | No | Delegated end-user identity for trusted callers. (default: `None`) |
| `api_version` | `str` | No | Foundry storage API version. (default: `'v1'`) |
| `on_mismatch` | `Literal['fail', 'ignore']` | No | Policy for isolation or TTL mismatches. ``"fail"`` (default) raises ``ValueError`` on reads and writes. ``"ignore"`` skips the property check and retains the existing settings. Description and tags are not compared. Backend errors propagate under both policies. (default: `'fail'`) |
| `kwargs` | `Any` | No | Additional options forwarded to ``FoundryStateStore``. (default: `{}`) |

## Constructors

```python
__init__(
    self,
    credential: AsyncTokenCredential | None = None,
    endpoint: FoundryStorageEndpoint | str | None = None,
    *,
    user_isolation: bool = False,
    item_ttl_seconds: int = DEFAULT_ITEM_TTL_SECONDS,
    description: str | None = 'LangChain conversation state',
    tags: Mapping[str, str] | None = None,
    user_id: str | None = None,
    api_version: str = 'v1',
    on_mismatch: Literal['fail', 'ignore'] = 'fail',
    kwargs: Any = {},
) -> None
```

| Name | Type |
|------|------|
| `credential` | `AsyncTokenCredential \| None` |
| `endpoint` | `FoundryStorageEndpoint \| str \| None` |
| `user_isolation` | `bool` |
| `item_ttl_seconds` | `int` |
| `description` | `str \| None` |
| `tags` | `Mapping[str, str] \| None` |
| `user_id` | `str \| None` |
| `api_version` | `str` |
| `on_mismatch` | `Literal['fail', 'ignore']` |
| `kwargs` | `Any` |


## Methods

- [`get()`](https://reference.langchain.com/python/langchain-azure-ai/agents/hosting/_responses/conversation_chain_store/FoundryConversationChainStore/get)
- [`set()`](https://reference.langchain.com/python/langchain-azure-ai/agents/hosting/_responses/conversation_chain_store/FoundryConversationChainStore/set)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-azure/blob/7a6a664d617264df8dcb12fcfb1bacc09f21d504/libs/azure-ai/langchain_azure_ai/agents/hosting/_responses/conversation_chain_store.py#L62)