examples/chains-conversation-memory-sqlite/README.md
Hello there! 👋 This example demonstrates how to create a conversational AI system with memory persistence using SQLite in Go with the LangChain library. Let's break down what this exciting code does!
Sets up an OpenAI Language Model: It initializes an OpenAI language model to power our conversational AI.
Creates a SQLite Database: The code sets up a SQLite database to store conversation history.
Implements Conversation Memory: It uses SQLite to maintain a persistent memory of the conversation, allowing the AI to remember previous interactions.
Prepares Sample Data: If the database is empty, it inserts a sample message to kickstart the conversation.
Runs a Conversation: The example runs a conversation chain, asking the AI a question that requires memory of previous interactions.
sqlite3.NewSqliteChatMessageHistory to create a chat history stored in SQLite.memory.NewConversationBuffer to manage the conversation memory.chains.NewConversation to handle the flow of the conversation.This example showcases how to create a conversational AI system with persistent memory, allowing for more context-aware and personalized interactions over time!
Feel free to run this example and experiment with different questions to see how the AI remembers and uses previous conversation context! 🚀🤖