How prachee-n16/memora works
1. System shape
- This repo is a prototype for a personal memory assistant (“memora”) with a clear split between a React client, a Python/Flask API, and a set of ML/vision/audio pipelines.
- The runtime path is: user interacts in the browser/mobile UI → frontend calls Flask endpoints → backend/ML scripts process face, image, audio, and chat data → results are returned to the UI.
2. Frontend application
- client/ is a React single-page app.
- Main screens/components are organized by user workflow: Landing, SignInPage, SignUpPage, Dashboard, ChatApp, Memories, Relationships, Profile, plus navigation (Navbar, Sidebar, Searchbar).
- RootLayout and config.js suggest routed views and a configurable API base URL; the frontend is the primary presentation layer and request initiator.
3. Backend/API boundary
- client/api/app.py is the main Flask backend entry point, with requirements.txt and .flaskenv showing a standard Python API service.
- This backend is the integration boundary for the client: it likely exposes endpoints for authentication, memory retrieval, face recognition, and assistant/chat interactions.
- The repo does not show a separate database server or cloud backend; most persistence appears to be local files and serialized model artifacts.
4. Face recognition subsystem
- Face identification is a major subsystem and is implemented with DeepFace/OpenCV-based embeddings.
- The repo contains serialized embedding/model artifacts in database/, face_database/, and per-person folders such as database/John and database/Sherlock.
- File names like ds_model_facenet512_detector_opencv_aligned_normalization_base_expand_0.pkl indicate a Facenet512 embedding pipeline with OpenCV detection and alignment, used to match observed faces against known individuals.
5. Face pipeline development and experiments
- deepface_dev/, traditional/, face_rec.py, and flask_face_backend.py show multiple iterations of the face-recognition implementation.
- traditional/ appears to contain older or alternative recognition approaches, while deepface_dev/ contains DeepFace-specific experiments and notebooks.
- This makes the face stack an R&D-heavy area rather than a single clean production service.
6. Memory ingestion and summarization
- The README describes capturing photos, conversations, and surrounding context, then turning them into concise summaries.
- Image understanding is described as using Qwen for image-to-text description generation.
- Conversations are transcribed to text and then stored for later retrieval, forming the “memory” corpus the assistant can search.
7. Retrieval and chatbot flow
- The assistant is described as using GPT-style prompting to search over stored memories and return relevant information.
- Architecturally, this is a retrieval-augmented flow: user query → search over stored transcripts/image descriptions/embeddings → prompt construction → generated answer.
- The ChatApp UI and Memories views likely sit on top of this retrieval layer.
8. Voice interaction subsystem
- The repo includes whisper/ and livekit/, indicating a speech pipeline and real-time communication/assistant work.
- whisper/stt.ipynb suggests speech-to-text experimentation, while livekit/assistant.py suggests a real-time assistant or audio-session integration.
- This subsystem supports conversational input/output rather than purely text-based chat.
9. Data and artifact boundaries
- Most persisted artifacts are local: face embedding pickles, numpy arrays, notebooks, and image/audio experiment outputs.
- There is no obvious standalone database service in the tree; instead, the project relies on serialized files and folders as the storage boundary.
- The README’s “vector database” concept is present architecturally, but in this repo it appears to be implemented through local artifacts and scripts rather than a dedicated server package.
10. Deployment/model packaging and experiments
- truss/ with config.yaml and model/hf-model.py suggests packaging a Hugging Face model for deployment.
- facenet512_conversion/ and iris/ are supporting experiment/tooling areas, not core application runtime paths.
- App/ and index.html look like ancillary notebooks or standalone experiments rather than the main product surface.
11. How to draw the architecture
- A good diagram would show four main blocks: React UI, Flask API, ML services/pipelines (face, STT, image captioning, retrieval), and local artifact storage (embeddings, summaries, model files).
- Data flows should emphasize that the UI submits media/query data to the API, the API delegates to recognition/summarization components, and the returned results populate dashboard/chat/memory views.
Main entry points: RootLayout.jsx Root Layout · app.py Flask API · index.js React App · deepface_sys.py DeepFace Stack
Components 19
Client UI
React presentation layer and routed user workflows
- React App · Main browser/mobile client and entry to the product
client/src/index.js - Root Layout · Top-level routed layout for the client app
client/src/layouts/RootLayout.jsx - Dashboard · Primary overview screen for the assistant
client/src/components/Dashboard.jsx - Chat · Conversation and query experience
client/src/components/ChatApp.jsx - Memories · Memory browsing and retrieval view
client/src/components/Memories.jsx - Relationships · People-centric memory and identity view
client/src/components/Relationships.jsx - Profile · User settings and profile surface
client/src/components/Profile.jsx - Nav Shell · Shared navigation and search controls
client/src/components/Navbar.jsx - Client Config · Frontend runtime configuration such as API base URL
client/src/config.js
API Boundary
Flask service that brokers requests from the UI
- Flask API · Main backend entry point for client requests
client/api/app.py
ML Pipelines
Face, speech, and memory-processing experiments and services
- Face Backend · Flask-facing face recognition entry point and integration code
flask_face_backend.py - DeepFace Stack · DeepFace/OpenCV face embedding and recognition experiments
deepface_dev/deepface_sys.py - Traditional CV · Older or alternative face recognition approaches
traditional/face_recog.ipynb - Speech STT · Speech-to-text experimentation for voice input
whisper/stt.ipynb - LiveKit Assistant · Real-time assistant and audio-session integration
livekit/assistant.py - Model Pack · Packaged Hugging Face model for deployment
truss/model/hf-model.py
Local Artifacts
Serialized embeddings, models, and other persisted repo-local data
- Face DB · Serialized face embeddings and identity matches
face_database/ds_model_facenet512_detector_opencv_aligned_normalization_base_expand_0.pkl - Known People · Per-person face embedding artifacts
database/John/ds_model_facenet512_detector_opencv_aligned_normalization_base_expand_0.pkl - Legacy Face Data · Older embeddings and face-recognition data artifacts
traditional/face_embeddings.npy
Connections 18
- React App → Root Layout: routes through · Client UI is organized by routed views and shared layout
- Root Layout → Dashboard: shows · Primary landing for signed-in users
- Root Layout → Chat: shows · Conversation workflow
- Root Layout → Memories: shows · Memory browsing workflow
- Root Layout → Relationships: shows · People and relationship workflow
- Root Layout → Profile: shows · Profile and settings workflow
- Nav Shell → Root Layout: wraps · Shared navigation appears across client screens
- React App → Client Config: reads · Frontend uses configurable API base settings
- React App → Flask API: calls · Browser app initiates API requests
- Flask API → Face Backend: delegates vision · Backend boundary hands face work to recognition code
- Flask API → DeepFace Stack: delegates faces · DeepFace pipeline performs embedding and matching
- Flask API → Speech STT: delegates audio · Speech input is transcribed for assistant use
- Flask API → LiveKit Assistant: streams voice · Real-time assistant/session integration
- Flask API → Model Pack: invokes model · Packaged model can serve generated responses or inference
- DeepFace Stack → Face DB: matches against · Face embeddings are compared to stored identities
- DeepFace Stack → Known People: loads identities · Per-person artifacts extend the known-face set
- Traditional CV → Legacy Face Data: reads · Legacy recognition experiments use saved embedding arrays
- Face Backend → Face DB: persists · Face backend writes or consumes serialized face artifacts