# carlkho-minerva/omi-hackathon_25mnrv architecture

> Architecture diagram of the GitHub repository carlkho-minerva/omi-hackathon_25mnrv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/carlkho-minerva/omi-hackathon_25mnrv
- Repository: https://github.com/carlkho-minerva/omi-hackathon_25mnrv

## Overview

##### Main Components
- Client Interaction Points:
- Omi Device that captures conversation audio and transcripts.
- End-user’s mobile phone or browser accessing the reflection UI.
- Backend API Services:
- Omi Webhook Collector (Cloud Run) that receives memory creation events.
- Daily Reflection Processor (Cloud Function) that aggregates and processes raw data.
- Data Storage:
- Firestore databases storing raw conversation data (‘raw_memories’) and processed reflection data (‘daily_reflections’).
- External Services:
- OpenAI API for AI-powered analysis of conversation data.
- Cloud Scheduler that triggers the processing job daily.
- (In future iterations) Push Notification Service for sending notifications.

##### File Structure
- The file tree divides the codebase into two main folders—Archive and omi-wrapped.
- The “Archive” folder contains experiments or earlier versions (e.g., memory-testapi, omi-to-notion) that might still illustrate useful patterns like Dockerfiles and Python scripts.
- The “omi-wrapped” folder encapsulates the production-ready application with directories for:
◦ daily-reflection-processor (the Cloud Function).
◦ omi-webhook-collector (the Cloud Run API service with its Dockerfile).
◦ omi-wrapped-frontend (static HTML/CSS/JavaScript that renders the user interface).
◦ docs (detailed documentation including the Firestore schema).
◦ personal-docu (additional documentation or notes).
- Notable configuration files like requirements.txt and Dockerfiles show language and runtime dependencies.

##### Extract Insights from the README
- Key GCP components (Cloud Run; Cloud Functions; Firestore; Cloud Scheduler; Cloud Storage) are highlighted.
- Integration points such as the Omi Memory Creation Webhook and the OpenAI API for processing are explicitly described.

##### Final Advice
- Don’t shy away from breaking down the project into as many individual components as possible. The goal is to capture every significant part of the architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input Layer
    subgraph "Input Layer"
        OmiDevice["Omi Device"]:::input
        UserBrowser["User Browser"]:::input
    end

    %% Processing Layer - GCP Infrastructure
    subgraph "Processing Layer - GCP Infrastructure"
        Webhook["Omi Webhook Collector (Cloud Run)"]:::backend
        CloudScheduler["Cloud Scheduler"]:::backend
        Processor["Daily Reflection Processor (Cloud Function)"]:::backend
        OpenAI["OpenAI API"]:::external
    end

    %% Storage Layer
    subgraph "Storage Layer"
        FirestoreRaw["Firestore 'raw_memories'"]:::storage
        FirestoreAggregated["Firestore 'daily_reflections'"]:::storage
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        Frontend["Frontend (Static Web UI)"]:::frontend
    end

    %% Relationships / Data Flow
    OmiDevice -->|"sends_memory"| Webhook
    Webhook -->|"stores_raw"| FirestoreRaw
    CloudScheduler -->|"triggers"| Processor
    Processor -->|"reads_raw"| FirestoreRaw
    Processor -->|"calls_OpenAI"| OpenAI
    Processor -->|"stores_aggregated"| FirestoreAggregated
    FirestoreAggregated -->|"serves_data"| Frontend
    UserBrowser -->|"views"| Frontend

    %% Click Events
    click Webhook "https://github.com/carlkho-minerva/omi-hackathon_25mnrv/tree/main/omi-wrapped/omi-webhook-collector"
    click Processor "https://github.com/carlkho-minerva/omi-hackathon_25mnrv/tree/main/omi-wrapped/daily-reflection-processor"
    click Frontend "https://github.com/carlkho-minerva/omi-hackathon_25mnrv/tree/main/omi-wrapped/omi-wrapped-frontend"
    click FirestoreAggregated "https://github.com/carlkho-minerva/omi-hackathon_25mnrv/blob/main/omi-wrapped/docs/firestore_schema.md"

    %% Styles
    classDef input fill:#AEDFF7,stroke:#333,stroke-width:2px;
    classDef backend fill:#F7E2AE,stroke:#333,stroke-width:2px;
    classDef storage fill:#F7C5AE,stroke:#333,stroke-width:2px;
    classDef external fill:#C4E0F7,stroke:#333,stroke-width:2px;
    classDef frontend fill:#AEEF99,stroke:#333,stroke-width:2px;
```
