This article details the implementation of a chat history system using Azure Cosmos DB for Go applications with langchaingo.Chat history is essential for storing and retrieving conversations, providing context for AI models like LLMs.The chatbot application showcases basic operations like read, upsert, and integration with Azure Cosmos DB emulator for testing.langchaingo framework offers pluggable APIs for various components including chat history, enhancing AI application development.The backend of the chat application exposes operations via a REST API and incorporates chat history for LLM processing.Azure Cosmos DB integration for chat history involves methods like AddMessage, Messages, and Clear for managing conversations efficiently.The article also discusses testing procedures with Azure Cosmos DB emulator using testcontainers-go for quicker and cost-effective tests.Proper data modeling is crucial for chat history requirements, considering aspects like metadata storage, data retention, and analytics.Users are encouraged to explore the sample chatbot application and share their feedback on leveraging Azure Cosmos DB for Go applications.Adhering to best practices in data modeling is advised, with references provided for further guidance on Azure Cosmos DB data partitioning.