A voice/text-interactive AI assistant with persistent long-term memory capabilities. Built with Google Gemini SDK, JSON Storage, and React.
- π¬ Natural Conversations: Chat with an AI that understands context and maintains conversation flow
- π§ Long-Term Memory: Automatically stores and recalls preferences, goals, and important information
- π Real-Time Web Search: Access current information (weather, news, stock prices) via Tavily AI integration
- β¨ Enhance Prompt: AI-powered prompt improvement to help you ask better questions
- π€ Voice Input: Speak to the assistant using Web Speech API (browser-based)
- π Memory Visualization: Real-time connection status and memory system monitoring
- π Feedback System: Rate AI responses with thumbs up/down to improve interaction
- π Cross-Session Persistence: Memories persist across browser sessions and devices
- π¨ Modern UI: Beautiful glassmorphism design with smooth animations
- β‘ Real-Time Updates: Instant responses with loading indicators
graph TB
A[React Frontend] -->|HTTP/REST| B[FastAPI Backend]
B -->|Google SDK| C[Gemini AI]
B -->|Read/Write| D[JSON Storage]
B -->|Memory Logic| F[Memory Manager]
F -->|Store/Retrieve| D
- FastAPI: High-performance async API framework
- Google Gemini SDK: Direct integration with Gemini 2.0 model with function calling
- Google Gemini: Advanced AI language model
- Tavily AI: Real-time web search API for current information
- JSON Storage: Lightweight file-based memory storage
- Pydantic: Data validation and settings management
- React 18: Modern UI library with hooks
- Vite: Fast build tool and dev server
- TailwindCSS: Utility-first CSS framework
- Axios: HTTP client for API communication
- Lucide React: Beautiful icon library
- Web Speech API: Browser-based voice input
- Python 3.11+
- Node.js 18+
- Google Gemini API key (Get one here)
- Tavily API key for web search (Get one here)
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY
# Run the server
python main.pyThe backend will start at http://localhost:8000
cd frontend
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env if needed (default points to localhost:8000)
# Run the dev server
npm run devThe frontend will start at http://localhost:5173
- Start a Conversation: Type a message or click the microphone icon to speak
- Enhance Prompt: Click the Sparkles icon to let AI improve your question before sending
- Enable Memory: Toggle the "Enable Memory" checkbox to control memory storage
- View Status: Check the sidebar to see the system connection status
- Provide Feedback: Use thumbs up/down buttons on AI responses
- Clear Chat: Click the "Clear" button to reset the conversation history
You: My name is Alex and I love pizza
Assistant: Nice to meet you, Alex! I'll remember that you love pizza.
[Later session]
You: What's my favorite food?
Assistant: Based on what you told me before, you love pizza!
Send a message and get a response with memory context.
Request:
{
"message": "Hello!",
"user_id": "default_user",
"memory_enabled": true
}Response:
{
"response": "Hi! How can I help you?",
"memories_used": [],
"timestamp": "2025-12-01T12:00:00Z"
}Explicitly store information in memory.
Request:
{
"key": "favorite_color",
"value": "blue",
"user_id": "default_user"
}Search for memories based on a query.
Request:
{
"query": "favorite color",
"user_id": "default_user",
"limit": 5
}Improve a user's prompt using AI.
Request:
{
"prompt": "weather"
}Response:
{
"original": "weather",
"enhanced": "Could you please provide me with the current weather conditions?"
}Get memory statistics and system status.
Query Params: user_id=default_user
# Build backend image
cd backend
docker build -t memora-backend .
# Run container
docker run -p 8000:8000 \
-e GEMINI_API_KEY=your_key_here \
memora-backend- Push your code to GitHub
- Connect your repository to Render
- Render will automatically detect
render.yaml - Add
GEMINI_API_KEYin Render dashboard - Deploy!
For frontend, deploy to Netlify or Vercel:
- Build command:
npm run build - Publish directory:
dist - Environment variable:
VITE_API_URL=https://your-backend.onrender.com
The system automatically detects and stores memories when you:
- Express preferences: "I like...", "I love...", "My favorite..."
- Ask to remember: "Remember...", "Don't forget...", "Keep in mind..."
- Share goals: "I want to...", "I'm trying to...", "My goal is..."
- Provide personal info: "My name is...", "I work as...", "I live in..."
GEMINI_API_KEY=your_gemini_api_key
CORS_ORIGINS=http://localhost:5173,http://localhost:3000
HOST=0.0.0.0
PORT=8000VITE_API_URL=http://localhost:8000memora/
βββ backend/
β βββ main.py # FastAPI application
β βββ config.py # Configuration management
β βββ models.py # Pydantic models
β βββ memory_manager.py # ChromaDB memory operations
β βββ conversation_handler.py # LangChain conversation logic
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Docker configuration
β βββ .env.example # Environment template
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ hooks/ # Custom React hooks
β β βββ services/ # API service layer
β β βββ App.jsx # Main app component
β β βββ index.css # Global styles
β βββ package.json
β βββ tailwind.config.js
β βββ vite.config.js
βββ render.yaml # Render deployment config
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for learning or commercial purposes.
- Google Gemini for the powerful AI model
- The open-source community
Built with β€οΈ using modern AI and web technologies