docs/cookbooks/companions/quickstart-demo.mdx
You can create a personalized AI Companion using Mem0. This guide will walk you through the necessary steps and provide the complete setup instructions to get you started.
<video autoPlay muted loop playsInline className="w-full aspect-video rounded-lg" src="https://github.com/user-attachments/assets/cebc4f8e-bdb9-4837-868d-13c5ab7bb433"
</video>
You can try the Mem0 Demo live here.
The Personalized AI Companion leverages Mem0 to retain information across interactions, enabling a tailored learning experience. It creates memories for each user interaction and integrates with OpenAI's GPT models to provide detailed and context-aware responses to user queries.
Before you begin, follow these steps to set up the demo application:
Clone the Mem0 repository:
git clone https://github.com/mem0ai/mem0.git
Navigate to the demo application folder:
cd mem0/examples/mem0-demo
Install dependencies:
pnpm install
Set up environment variables by creating a .env file in the project root with the following content:
OPENAI_API_KEY=your_openai_api_key
MEM0_API_KEY=your_mem0_api_key
You can obtain your MEM0_API_KEY by signing up at <a href="https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=cookbook-companions-quickstart" rel="nofollow">Mem0 API Dashboard</a>.
Start the development server:
pnpm run dev
Once the demo is running, you can customize and enhance the Next.js application by modifying the components in the mem0-demo folder. Consider:
You can find the complete source code for this demo on GitHub: Mem0 Demo GitHub
This setup demonstrates how to build an AI Companion that maintains memory across interactions using Mem0. The system continuously adapts to user interactions, making future responses more relevant and personalized. Experiment with the application and enhance it further to suit your use case!