This document provides a detailed walkthrough of the LIFEGRAPH system, explaining why each component exists and the technology powering it.
| Component | Technology | Reasoning |
|---|---|---|
| Frontend | Next.js 14 (React) | Provides a "Universal Web App" (PWA) experience. Responsive, mobile-first, and supports native device features like Camera/Mic integration via standard Web APIs. |
| Backend | FastAPI (Python 3.10) | High-performance async API server. Standardizes logic and decoupling it from the UI, allowing for future scalability or mobile app clients. |
| Perception Engine | Gemini 3.0 Flash | Selected for its native multimodal capabilities. Ingests raw video, audio, and images directly without separate transcription services. |
| Reasoning Engine | Gemini 3.0 Flash | Used for "Hyper-RAG". We utilize its massive context window for analyzing longitudinal life patterns across decades of data. |
| Memory Persistence | Pinecone (Vector DB) | Stores high-dimensional embeddings of every memory, enabling semantic search ("Find moments of joy") rather than just keyword search. |
| Data Format | JSON | We keep a "Flat File" backup (life_timeline.json) to ensure users own their data and it's portable/readable forever. |
app/page.tsx- Tech:
Next.js App Router - Purpose: The Dashboard. The main SPA (Single Page Application). Manages the 4-tab layout ("Today", "Capture", "Ask", "Me") and state.
- Tech:
components/CaptureScreen.tsx- Tech:
UseUserMediaAPI - Purpose: Multimodal Interaction. Handles the live Camera preview, Video recording, and Audio visualization. Streams binary data to the backend.
- Tech:
main.py- Tech:
FastAPI - Purpose: The API Gateway. Exposes endpoints (
/api/timeline,/api/capture,/api/wisdom) for the frontend. Handles CORS and request validation.
- Tech:
voice_handler.py- Tech:
google-generativeai(Gemini 3.0) - Purpose: The Semantic Ear. Receives raw files, uploads them to Gemini, and enforces the "Life Event" JSON schema.
- Tech:
reasoning.py- Tech:
RAGlogic - Purpose: The Brain. Orchestrates the "Ask" tab queries. Performs vector search on Pinecone and synthesizes the results using Gemini 3.0.
- Tech:
vector_db.py- Tech:
pinecone,text-embedding-004 - Purpose: The Hippocampus. Generates embeddings for new memories and specifically indexes them for sematic retrieval.
- Tech:
life_timeline.json- Purpose: Longitudinal Database. Stores the "Facts" of the user's life (Dates, Events, Outcomes) in a machine-readable format for graphing.
identity_context.md- Purpose: North Star. Stores the user's Values and Vision (from the Genesis interview) to give the AI context about who it is analyzing.
- Wearable Backend: The simplified API structure allows this backend to serve as the brain for future hardware (AI Pins/Pendants).
- Archive Import: Scripts to ingest Google Takeout (Photos/Drive) history are planned for Q3.