How manojmadduri/ai-memory-clone works
Project Overview
• This is a full-stack application that builds a personal AI capable of memory recall, semantic search, and image processing.
• The system is split between a React-based frontend styled with Tailwind CSS and a FastAPI-based backend written in Python.
• Additional functionalities include integration with face recognition, image ingestion, and memory processing powered by GPT and semantic embeddings.
• The project leverages Supabase (PostgreSQL and Storage) as its database and storage solution.
Main Components
a. Frontend:
• A “Frontend (React + Tailwind)” component.
• Elements inside include pages such as Chat, Home, MemoryView, People, Timeline, and Upload.
• Connects to the backend via HTTP API calls (using Axios/CORS as mentioned in the README).
b. Backend:
• A “Backend (FastAPI)” component.
• Detail modular sub-components:
• main.py – the API entry point.
• Memory Manager (memory_manager.py) – handles storing and retrieving memory embeddings.
• GPT Response (gpt_response.py) – responsible for chat responses and context generation.
• Image Ingestion (image_ingestion.py) – processes images, applies face recognition (utilizing face_recognition/dlib) and caption generation.
• Additional utilities (face_utils.py, cluster_utils.py, timeline_utils.py) – manage specialized tasks such as face recognition and memory clustering based on timeline or person.
• Bulk Memory Import (bulk_memory_import.py) – for importing large numbers of memories from a text file.
• Supabase Integration (supabase_client.py) – for interaction with Supabase storage and database.
• Personal memories file (personal_memories.txt) acting as a local store for bulk import scenarios.
c. Database and External Services:
• A “Database” (Supabase with PostgreSQL) component.
• Links from the backend to Supabase for memory storage.
• Optionally, note integration with external AI services such as GPT (via OpenAI API or a local model) and sentence-transformers for text embedding.
• Image-related storage (Supabase Storage) for processed images.
Relationships and Data Flow
• Data flow from the Frontend (user actions and API requests) → Backend endpoints.
• Backend interactions with the Database for memory retrieval, storage of embeddings, and image metadata.
• Functional flow within the backend that calls specialized modules (e.g., image_ingestion processing images and then invoking Supabase).
• Cycle between the GPT module and memory manager – input user query triggers memory retrieval, which then informs GPT’s response.
Architectural Patterns & Technologies
• Separation of concerns between frontend and backend.
• Integration points: APIs for chat and memory APIs, image processing endpoints, and potential callbacks to external AI models.