Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 3.39 KB

File metadata and controls

58 lines (43 loc) · 3.39 KB

LIFEGRAPH Architecture & Tech Stack

This document provides a detailed walkthrough of the LIFEGRAPH system, explaining why each component exists and the technology powering it.

🛠️ Technology Stack

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.

📂 File & Folder Walkthrough

1. frontend/ (The Application Layer)

  • 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.
  • components/CaptureScreen.tsx
    • Tech: UseUserMedia API
    • Purpose: Multimodal Interaction. Handles the live Camera preview, Video recording, and Audio visualization. Streams binary data to the backend.

2. backend/ (The Logic Layer)

  • main.py
    • Tech: FastAPI
    • Purpose: The API Gateway. Exposes endpoints (/api/timeline, /api/capture, /api/wisdom) for the frontend. Handles CORS and request validation.
  • 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.
  • reasoning.py
    • Tech: RAG logic
    • Purpose: The Brain. Orchestrates the "Ask" tab queries. Performs vector search on Pinecone and synthesizes the results using Gemini 3.0.
  • vector_db.py
    • Tech: pinecone, text-embedding-004
    • Purpose: The Hippocampus. Generates embeddings for new memories and specifically indexes them for sematic retrieval.

3. data/ (The Memory Layer)

  • 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.

🔮 Future Architecture (Post-Hackathon)

  1. Wearable Backend: The simplified API structure allows this backend to serve as the brain for future hardware (AI Pins/Pendants).
  2. Archive Import: Scripts to ingest Google Takeout (Photos/Drive) history are planned for Q3.