{"id":28448333,"url":"https://github.com/mzazakeith/mem0chat","last_synced_at":"2026-06-25T03:31:10.158Z","repository":{"id":293519330,"uuid":"984303218","full_name":"mzazakeith/Mem0Chat","owner":"mzazakeith","description":"Mem0Chat is an application showcasing an LLM-powered chat with a model-agnostic persistent memory layer powered by mem0. It enables context-aware conversations, using mem0's memory management to retain and utilize key memories across sessions/chats for a personalized, efficient user experience. ","archived":false,"fork":false,"pushed_at":"2025-05-16T04:04:11.000Z","size":855,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T02:41:05.187Z","etag":null,"topics":["ai","chat","llm","llm-chat","mem0","mem0ai","memory"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mzazakeith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-15T17:57:27.000Z","updated_at":"2025-06-12T08:59:21.000Z","dependencies_parsed_at":"2025-05-15T19:34:53.956Z","dependency_job_id":null,"html_url":"https://github.com/mzazakeith/Mem0Chat","commit_stats":null,"previous_names":["mzazakeith/mem0chat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mzazakeith/Mem0Chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzazakeith%2FMem0Chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzazakeith%2FMem0Chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzazakeith%2FMem0Chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzazakeith%2FMem0Chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mzazakeith","download_url":"https://codeload.github.com/mzazakeith/Mem0Chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzazakeith%2FMem0Chat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34758773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chat","llm","llm-chat","mem0","mem0ai","memory"],"created_at":"2025-06-06T13:08:13.954Z","updated_at":"2026-06-25T03:31:10.152Z","avatar_url":"https://github.com/mzazakeith.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mem0Chat - AI Chat with Persistent Memory\n\nThis project is a Next.js application demonstrating an AI chat interface with a persistent memory layer powered by [Mem0.ai](https://mem0.ai/). It allows users to have conversations with various AI models, where the AI can recall information from previous interactions to provide more personalized and context-aware responses.\n\n## Key Features\n\n*   **AI Chat Interface:**  Chat UI built with Next.js, React, Radix UI, and Tailwind CSS.\n*   **Chat History Sidebar:** Displays a list of past chat sessions, allowing users to easily navigate and revisit conversations. Stored locally using Dexie.js.\n*   **Persistent Memory:** Utilizes [Mem0.ai](https://github.com/mem0ai/mem0) as \"The Memory Layer for your AI Agents,\" enabling the chat application to remember user preferences or anything the user needs it to.\n*   **Configurable AI Models:** Supports multiple AI models from Google (Gemini series) and OpenRouter (e.g., DeepSeek, Llama, Qwen). Users can set global default models and override them per chat session.\n*   **Client-Side Data Persistence:** Leverages Dexie.js (IndexedDB wrapper) to store chat sessions, messages, and a local cache of memories, enabling faster load times and some offline access.\n*   **Dynamic Title Generation:** Automatically generates concise titles for new chat conversations based on the initial message content.\n*   **Real-time Streaming:** Streams AI responses for a smooth and interactive user experience using the Vercel AI SDK.\n*   **Theming:** Supports light and dark modes.\n*   **Animated UI:** Uses Framer Motion for subtle UI animations.\n\n### Settings Overview\nThe application provides a \"Default Settings\" drawer where users can configure global preferences:\n*   Toggle global memory activation.\n*   Set the default AI model for chat.\n*   Set the default AI model for title generation.\n\n![Default Settings Panel](./3.png)\n\n## Key Features in Action\n\n### Memory Persistence\n\n**1. Conversation without memory:** The AI responds without prior knowledge.\n\n![AI response without memory active](./1.png)\n\n**2. Conversation with memory:** After a relevant memory is added (e.g., \"Prefers coffee to tea\"), the AI uses this information in its response. The \"My Memories\" panel shows the active memories.\n\n![AI response with memory active, demonstrating recall](./2.png)\n\n## Technologies Used\n\n*   **Framework:** Next.js 15\n*   **Memory Layer:** [Mem0.ai](https://github.com/mem0ai/mem0) (`mem0ai` SDK)\n*   **AI Model Providers:**\n    *   Google (Gemini series)\n    *   OpenRouter (DeepSeek, Llama, Qwen, etc.)\n*   **UI Components:** Radix UI, Shadcn/ui \n*   **Styling:** Tailwind CSS\n*   **Animations:** Framer Motion\n*   **Client-Side Database:** Dexie.js (IndexedDB wrapper)\n*   **Icons:** Lucide React\n\n\n## Mem0.ai Integration\n\nThis project integrates [Mem0.ai](https://github.com/mem0ai/mem0) to provide a persistent memory layer for the AI. As described on their website, \"Mem0 is a self-improving memory layer for LLM applications, enabling personalized AI experiences that save costs and delight users.\"\n\nKey aspects of the Mem0.ai integration in this project:\n*   **Memory Storage:** User interactions and explicitly added memories are stored via the Mem0.ai service.\n*   **Contextual Retrieval:** Before sending a query to an AI model, the application searches Mem0.ai for relevant memories based on the current conversation context.\n*   **Enhanced Prompts:** Retrieved memories are injected into the system prompt, providing the AI model with historical context and user preferences.\n*   **Personalization:** This allows the AI to \"remember\" past interactions and tailor its responses accordingly.\n*   **Client-Side Caching:** Memories fetched from Mem0.ai are cached locally using Dexie.js to improve performance.\n\nThe application uses the `mem0ai` JavaScript SDK to interact with the Mem0 Platform (Cloud version).\n\n## Setup and Installation\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/mzazakeith/Mem0Chat.git\n    cd Mem0Chat\n    ```\n\n2.  **Install dependencies:**\n    ```bash\n    npm install\n    # or\n    # yarn install\n    # or\n    # pnpm install\n    ```\n\n3.  **Set up environment variables:**\n    Create a `.env.local` file in the root of the project and add the following environment variables:\n\n    ```env\n    # Mem0.ai Credentials (Required for memory functionality)\n    MEM0_API_KEY=\"your_mem0_api_key\"\n    MEM0_PROJECT_ID=\"your_mem0_project_id\"\n\n    # OpenRouter API Key (Required if using OpenRouter models)\n    OPENROUTER_API_KEY=\"your_openrouter_api_key\"\n\n    # Google API Key \n    GOOGLE_GENERATIVE_AI_API_KEY=\"your_google_api_key\"\n    ```\n    *   Obtain your `MEM0_API_KEY` and `MEM0_PROJECT_ID` from your [Mem0.ai dashboard](https://mem0.ai/).\n    *   Obtain your `OPENROUTER_API_KEY` from your [OpenRouter dashboard](https://openrouter.ai/).\n\n4.  **Run the development server:**\n    ```bash\n    npm run dev\n    ```\n    The application should now be running on [http://localhost:3000](http://localhost:3000).\n\n## Acknowledgements\n\n*   **[Mem0.ai](https://mem0.ai/):** For providing the intelligent memory layer.\n*   **Vercel AI SDK:** For simplifying AI model integration and streaming.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzazakeith%2Fmem0chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmzazakeith%2Fmem0chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzazakeith%2Fmem0chat/lists"}