60 lines
1.9 KiB
Markdown
60 lines
1.9 KiB
Markdown
# Mem0 Chat Frontend
|
|
|
|
A simple, clean frontend for chatting with your Mem0 memories.
|
|
|
|
## Features
|
|
|
|
- **Chat Interface**: Send messages and get AI responses with memory context
|
|
- **Memory Sidebar**: View all your memories with timestamps
|
|
- **Memory Management**: Delete individual memories with confirmation
|
|
- **Persistent Chat**: Chat history saved in localStorage (survives page refresh)
|
|
- **Real-time Updates**: Memories automatically refresh after each chat
|
|
- **Simple & Clean**: No fancy animations, just working functionality
|
|
|
|
## Setup
|
|
|
|
1. **Make sure the backend is running** on `http://localhost:8000`
|
|
|
|
2. **Open the frontend** by simply opening `index.html` in your browser:
|
|
```bash
|
|
open frontend/index.html
|
|
```
|
|
Or serve it with a simple HTTP server:
|
|
```bash
|
|
cd frontend
|
|
python3 -m http.server 8080
|
|
# Then open http://localhost:8080
|
|
```
|
|
|
|
## Usage
|
|
|
|
1. **Start chatting** - Type messages in the input field and press Enter or click Send
|
|
2. **View memories** - All extracted memories appear in the right sidebar
|
|
3. **Delete memories** - Click the "Delete" button on any memory (with confirmation)
|
|
4. **Refresh memories** - Click the 🔄 button to manually refresh the memories list
|
|
5. **Persistent history** - Your chat history is saved and will reload when you refresh the page
|
|
|
|
## Configuration
|
|
|
|
- **User ID**: Hardcoded as "pratik" in the JavaScript
|
|
- **Backend URL**: `http://localhost:8000` (change in the JavaScript if needed)
|
|
- **Memory Limit**: Loads up to 50 memories
|
|
|
|
## Debugging
|
|
|
|
Open browser console and use:
|
|
- `clearChatHistory()` - Clear all stored chat history
|
|
|
|
## Files
|
|
|
|
- `index.html` - Complete frontend (HTML + CSS + JavaScript all in one file)
|
|
- `README.md` - This file
|
|
|
|
## API Integration
|
|
|
|
The frontend uses these backend endpoints:
|
|
- `POST /chat` - Send messages and get responses
|
|
- `GET /memories/pratik` - Load user memories
|
|
- `DELETE /memories/{id}` - Delete specific memory
|
|
|
|
Simple, functional, and clean - exactly as requested!
|