# ZepCloudChatMessageHistory

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/chat_message_histories/zep_cloud/ZepCloudChatMessageHistory)

Chat message history that uses Zep Cloud as a backend.

Recommended usage::

    # Set up Zep Chat History
    zep_chat_history = ZepChatMessageHistory(
        session_id=session_id,
        api_key=<your_api_key>,
    )

    # Use a standard ConversationBufferMemory to encapsulate the Zep chat history
    memory = ConversationBufferMemory(
        memory_key="chat_history", chat_memory=zep_chat_history
    )

Zep - Recall, understand, and extract data from chat histories.
Power personalized AI experiences.

Zep is a long-term memory service for AI Assistant apps.
With Zep, you can provide AI assistants with the
ability to recall past conversations,
no matter how distant,
while also reducing hallucinations, latency, and cost.

see Zep Cloud Docs: https://help.getzep.com

This class is a thin wrapper around the zep-python package. Additional
Zep functionality is exposed via the `zep_summary`, `zep_messages` and `zep_facts`
properties.

For more information on the zep-python package, see:
https://github.com/getzep/zep-python

## Signature

```python
ZepCloudChatMessageHistory(
    self,
    session_id: str,
    api_key: str,
    *,
    memory_type: Optional[MemoryGetRequestMemoryType] = None,
    lastn: Optional[int] = None,
    ai_prefix: Optional[str] = None,
    human_prefix: Optional[str] = None,
    summary_instruction: Optional[str] = None,
)
```

## Extends

- `BaseChatMessageHistory`

## Constructors

```python
__init__(
    self,
    session_id: str,
    api_key: str,
    *,
    memory_type: Optional[MemoryGetRequestMemoryType] = None,
    lastn: Optional[int] = None,
    ai_prefix: Optional[str] = None,
    human_prefix: Optional[str] = None,
    summary_instruction: Optional[str] = None,
) -> None
```

| Name | Type |
|------|------|
| `session_id` | `str` |
| `api_key` | `str` |
| `memory_type` | `Optional[MemoryGetRequestMemoryType]` |
| `lastn` | `Optional[int]` |
| `ai_prefix` | `Optional[str]` |
| `human_prefix` | `Optional[str]` |
| `summary_instruction` | `Optional[str]` |


## Properties

- `zep_client`
- `zep_client_async`
- `session_id`
- `memory_type`
- `lastn`
- `ai_prefix`
- `human_prefix`
- `summary_instruction`
- `messages`
- `zep_messages`
- `zep_summary`
- `zep_facts`

## Methods

- [`add_user_message()`](https://reference.langchain.com/python/langchain-community/chat_message_histories/zep_cloud/ZepCloudChatMessageHistory/add_user_message)
- [`add_ai_message()`](https://reference.langchain.com/python/langchain-community/chat_message_histories/zep_cloud/ZepCloudChatMessageHistory/add_ai_message)
- [`add_message()`](https://reference.langchain.com/python/langchain-community/chat_message_histories/zep_cloud/ZepCloudChatMessageHistory/add_message)
- [`add_messages()`](https://reference.langchain.com/python/langchain-community/chat_message_histories/zep_cloud/ZepCloudChatMessageHistory/add_messages)
- [`aadd_messages()`](https://reference.langchain.com/python/langchain-community/chat_message_histories/zep_cloud/ZepCloudChatMessageHistory/aadd_messages)
- [`search()`](https://reference.langchain.com/python/langchain-community/chat_message_histories/zep_cloud/ZepCloudChatMessageHistory/search)
- [`clear()`](https://reference.langchain.com/python/langchain-community/chat_message_histories/zep_cloud/ZepCloudChatMessageHistory/clear)
- [`aclear()`](https://reference.langchain.com/python/langchain-community/chat_message_histories/zep_cloud/ZepCloudChatMessageHistory/aclear)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/chat_message_histories/zep_cloud.py#L72)