# Project export: Alzyra

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 12.0
- Tagline: AI-Powered Memory Reconstruction for Alzheimer's Patients
- Devpost: https://devpost.com/software/alzyra
- GitHub: https://github.com/MANVITH7/Alzyra
- Video: https://www.youtube.com/embed/XbgBHU4YgVI?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 3 GitHub contributor(s) — k3vnos (3 commits), unknown (2 commits), MANVITH7 (1 commits)

## Devpost submission (written by the team)

### Inspiration

The inspiration behind Alzyra came from a deeply personal place — my grandmother has been struggling with memory loss and often forgets daily events or familiar faces. Watching her confusion and frustration made us realize how isolating and painful this experience can be, not just for patients but also for their families. Our team wanted to create something with real social impact, something that could help people like her hold onto their memories, stay independent longer, and bring peace of mind to caregivers. That’s how Alzyra – an AI-powered memory reconstruction companion – was born. What It Does Alzyra helps people with early-to-moderate Alzheimer’s and dementia actively reconstruct memories instead of just being reminded of them. Through AI-guided conversations, the app gently asks guided questions — like “Do you remember if you were indoors or outdoors?” — and uses contextual cues from the user’s phone (photos, location, and calendar events) to help them recall experiences naturally. It also features a caregiver portal that provides insights into memory patterns, medication adherence, and emotional trends. In short, Alzyra is a compassionate digital companion that helps preserve identity, strengthen memory, and support caregivers. How We Built It We combined advanced AI with human-centered design to make Alzyra both smart and empathetic. Core technologies used: LiveKit + Vapi AI for real-time, natural voice interactions Claude / OpenAI for contextual understanding and emotional tone adaptation Device integrations with photos, GPS, and calendar for memory cues Dual interface system: Patient mode — large touch targets, minimal cognitive load Caregiver mode — analytics dashboard with memory strength and behavioral insights Privacy-first architecture ensures all personal data is encrypted and consent-driven. Challenges We Ran Into Designing for cognitive decline while keeping the experience empowering, not infantilizing Balancing empathy and accuracy — making the AI sound compassionate, not robotic Managing privacy for sensitive memory and health data Translating neuroscience principles like spaced repetition into AI dialogue patterns Voice response latency and adaptation for older users with slower reaction times Accomplishments That We’re Proud Of Built a functional prototype capable of guiding real-time recall conversations Developed a context-aware AI model that adapts to user memory patterns Created a dual-portal system linking patient interaction with caregiver insights Received positive feedback from early testers and caregivers Stayed true to our mission — technology with social and emotional purpose What We Learned Effective memory care technology must empower recall, not automate it Designing for dementia requires empathy, patience, and iteration Cross-disciplinary collaboration between AI, neuroscience, and UX is crucial Emotional tone is as vital as accuracy — trust builds engagement Compassion-driven technology can truly enhance quality of life What’s Next for Alzyra Launch pilot studies with Alzheimer’s and dementia care clinics Expand memory reconstruction models to support multiple languages and cultures Integrate wearables and biometrics for advanced cognitive tracking Partner with healthcare organizations and insurers to scale accessibility Continue developing Alzyra into the world’s most trusted AI companion for memory health

## README (from the GitHub repository)

🧠 Remory — AI-Powered Context Reconstruction for Memory Loss
Guiding light through memory loss.

## Detected evidence (automated analysis)

Indexed codebase: 22 recognized source files, 141 KB.
- Express (technology) — detected in the code
- JavaScript (language) — detected in the code
- React (technology) — detected in the code
- OpenAI (technology) — claimed on Devpost, not found in the code
- AI coding agent: Claude Code — evidence: config files committed to the repository; commit authorship or trailers

## Codebase structure (from repository index)

### Files (30 of 30)

```
.claude/settings.local.json
README.md
remory/.env.example
remory/.gitignore
remory/ANDROID_STUDIO_SETUP.md
remory/App.js
remory/app.json
remory/babel.config.js
remory/clear-cache.bat
remory/components/CaretakerDashboard.js
remory/components/CaretakerInfoPage.js
remory/components/ClaudeConversationModal.js
remory/components/EmailVerificationPage.js
remory/components/LoginPage.js
remory/components/PatientDashboard.js
remory/components/SignupPage.js
remory/components/VoiceAgentModal.js
remory/contexts/AuthContext.js
remory/contexts/LiveKitContext.js
remory/eas.json
remory/index.js
remory/metro.config.js
remory/package.json
remory/server/package.json
remory/server/tokenServer.js
remory/services/claudeService.js
remory/services/livekitService.js
remory/services/livekitTokenGenerator.js
remory/services/voiceAssistantService.js
remory/shim.js
```

### Dependencies

- remory/package.json: @livekit/react-native@^2.9.3, @livekit/react-native-webrtc@^137.0.2, @react-native-async-storage/async-storage@^2.2.0, @react-native-community/cli@^20.0.2, @react-native-community/cli-platform-android@^20.0.2, @react-navigation/native@^7.1.18, @react-navigation/stack@^7.5.0, babel-preset-expo@^54.0.6, expo@~54.0.20, expo-av@~16.0.7, expo-dev-client@~6.0.16, expo-linear-gradient@~15.0.7, expo-status-bar@~3.0.8, livekit-client@^2.15.13, react@19.1.0, react-native@0.81.5, react-native-dotenv@^3.4.11, react-native-gesture-handler@~2.28.0, react-native-paper@^5.14.5, react-native-reanimated@~4.1.1, react-native-safe-area-context@~5.6.0, react-native-screens@~4.16.0, react-native-vector-icons@^10.3.0, react-native-worklets-core@^1.6.2
- remory/server/package.json: dotenv@^16.3.1, express@^4.18.2, livekit-server-sdk@^2.9.0, nodemon@^3.0.1

### Recent commits (newest first)

- Merge pull request #3 from MANVITH7/oauth
- Remove AWS Cognito, VAPI, and unused agent folders; simplify to LiveKit-only voice
- adding vapi and livekit stuff
- agent new
- failing agent
- livekitgit add .git add .
- Merge pull request #1 from MANVITH7/oauth
- adding aws oauth files
- Incomplete Frontend
- Initial React Native Template
- Pushed README file

## Key source files (fetched from GitHub, selected and truncated for size)

### remory/ANDROID_STUDIO_SETUP.md

```markdown
# Android Studio Setup Guide for Remory

This guide will help you set up Android Studio and create an emulator to test the VAPI voice integration.

## Step 1: Download Android Studio

### Download Link
**https://developer.android.com/studio**

1. Click the **"Download Android Studio"** button
2. Accept the terms and conditions
3. Download will start (file size: ~1GB)
4. File name: `android-studio-2024.x.x.x-windows.exe`

## Step 2: Install Android Studio

### Installation Process

1. **Run the installer** (`android-studio-*.exe`)
2. Click **"Next"** on the welcome screen
3. **Select components to install**:
   - ✅ Android Studio
   - ✅ Android Virtual Device (AVD) - **IMPORTANT: Make sure this is checked!**
4. Click **"Next"**
5. Choose installation location (default is fine: `C:\Program Files\Android\Android Studio`)
6. Click **"Install"**
7. Wait for installation to complete (5-10 minutes)
8. Click **"Finish"**

### First Launch Setup

1. Android Studio will launch automatically
2. **"Import Android Studio Settings"** dialog:
   - Select: **"Do not import settings"**
   - Click **"OK"**

3. **Android Studio Setup Wizard**:
   - Click **"Next"** on the welcome screen

4. **Install Type**:
   - Select: **"Standard"** (recommended)
   - Click **"Next"**

5. **Select UI Theme**:
   - Choose your preferred theme (Light or Dark)
   - Click **"Next"**

6. **Verify Settings**:
   - You should see:
     - ✅ Android SDK
     - ✅ Android SDK Platform
     - ✅ Android Virtual Device
     - ✅ Performance (Intel HAXM) - for Windows
   - Click **"Next"**

7. **License Agreement**:
   - Click **"Accept"** for all licenses
   - Click **"Finish"**

8. **Downloading Components**:
   - This will download ~2-3GB of files
   - Wait 10-20 minutes depending on your internet speed
   - Click **"Finish"** when complete

## Step 3: Set Up Environment Variables

### Add ANDROID_HOME

1. Press `Win + R` to open Run dialog
2. Type: `sysdm.cpl` and press Enter
3. Click **"Advanced"** tab
4. Click **"Environment Variables"** button

### User Variables

1. Click **"New"** under "User variables"
2. **Variable name**: `ANDROID_HOME`
3. **Variable value**: `C:\Users\Kamalesh\AppData\Local\Android\Sdk`
   - (This is the default SDK location)
4. Click **"OK"**

### Update PATH Variable

1. Find **"Path"** in "User variables"
2. Select it and click **"Edit"**
3. Click **"New"** and add these entries:
   - `%ANDROID_HOME%\platform-tools`
   - `%ANDROID_HOME%\emulator`
   - `%ANDROID_HOME%\tools`
   - `%ANDROID_HOME%\tools\bin`
4. Click **"OK"** on all dialogs

### Verify Installation

Open a **NEW** Command Prompt (important - must be new to load new env vars):

```bash
# Check ADB
adb --version

# Should show something like:
# Android Debug Bridge version 1.0.41

# Check emulator
emulator -version

# Should show emulator version info
```

## Step 4: Create Android Virtual Device (AVD)

### Launch Device Manager

1. Open Android Studio
2. Click **"More Actions"** dropdown (or three d
[truncated — 4504 more characters]
```

### remory/package.json

```
{
  "name": "remory",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "react-native start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "expo": "expo start"
  },
  "dependencies": {
    "@livekit/react-native": "^2.9.3",
    "@livekit/react-native-webrtc": "^137.0.2",
    "@react-native-async-storage/async-storage": "^2.2.0",
    "@react-navigation/native": "^7.1.18",
    "@react-navigation/stack": "^7.5.0",
    "expo": "~54.0.20",
    "expo-av": "~16.0.7",
    "expo-dev-client": "~6.0.16",
    "expo-linear-gradient": "~15.0.7",
    "expo-status-bar": "~3.0.8",
    "livekit-client": "^2.15.13",
    "react": "19.1.0",
    "react-native": "0.81.5",
    "react-native-dotenv": "^3.4.11",
    "react-native-gesture-handler": "~2.28.0",
    "react-native-paper": "^5.14.5",
    "react-native-reanimated": "~4.1.1",
    "react-native-safe-area-context": "~5.6.0",
    "react-native-screens": "~4.16.0",
    "react-native-vector-icons": "^10.3.0",
    "react-native-worklets-core": "^1.6.2"
  },
  "private": true,
  "devDependencies": {
    "@react-native-community/cli": "^20.0.2",
    "@react-native-community/cli-platform-android": "^20.0.2",
    "babel-preset-expo": "^54.0.6"
  }
}

```

### remory/server/package.json

```
{
  "name": "remory-token-server",
  "version": "1.0.0",
  "description": "LiveKit token generation server for Remory",
  "main": "tokenServer.js",
  "scripts": {
    "start": "node tokenServer.js",
    "dev": "nodemon tokenServer.js"
  },
  "dependencies": {
    "express": "^4.18.2",
    "livekit-server-sdk": "^2.9.0",
    "dotenv": "^16.3.1"
  },
  "devDependencies": {
    "nodemon": "^3.0.1"
  }
}

```

### remory/index.js

```javascript
// IMPORTANT: This must be the VERY FIRST import to provide crypto support for AWS Cognito
import './shim';

import { registerRootComponent } from 'expo';

import App from './App';

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App);

```

### remory/App.js

```javascript
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { StatusBar } from 'expo-status-bar';
import { SafeAreaProvider } from 'react-native-safe-area-context';

// Import components
import SignupPage from './components/SignupPage.js';
import CaretakerInfoPage from './components/CaretakerInfoPage.js';
import LoginPage from './components/LoginPage.js';
import PatientDashboard from './components/PatientDashboard.js';
import CaretakerDashboard from './components/CaretakerDashboard.js';
import EmailVerificationPage from './components/EmailVerificationPage.js';

// Import AuthProvider and LiveKitProvider
import { AuthProvider } from './contexts/AuthContext.js';
import { LiveKitProvider } from './contexts/LiveKitContext.js';

const Stack = createStackNavigator();

export default function App() {
  return (
    <AuthProvider>
      <LiveKitProvider>
        <SafeAreaProvider>
          <NavigationContainer>
            <StatusBar style="auto" />
            <Stack.Navigator
            initialRouteName="Login"
            screenOptions={{
              headerStyle: {
                backgroundColor: '#5A7D9A',
              },
              headerTintColor: '#FFFFFF',
              headerTitleStyle: {
                fontWeight: 'bold',
                fontSize: 18,
              },
            }}
          >
            <Stack.Screen
              name="Login"
              component={LoginPage}
              options={{ title: 'Welcome Back' }}
            />
            <Stack.Screen
              name="Signup"
              component={SignupPage}
              options={{ title: 'Create Your Account' }}
            />
            <Stack.Screen
              name="EmailVerification"
              component={EmailVerificationPage}
              options={{ title: 'Verify Email' }}
            />
            <Stack.Screen
              name="CaretakerInfo"
              component={CaretakerInfoPage}
              options={{ title: 'Caretaker Information' }}
            />
            <Stack.Screen
              name="PatientDashboard"
              component={PatientDashboard}
              options={{ title: 'My Dashboard', headerShown: false }}
            />
            <Stack.Screen
              name="CaretakerDashboard"
              component={CaretakerDashboard}
              options={{ title: 'Caretaker Dashboard', headerShown: false }}
            />
          </Stack.Navigator>
        </NavigationContainer>
      </SafeAreaProvider>
      </LiveKitProvider>
    </AuthProvider>
  );
}


```

### remory/shim.js

```javascript
// Polyfills for React Native
// This file is intentionally minimal now that AWS dependencies are removed

```

### remory/metro.config.js

```javascript
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');

/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);

module.exports = config;

```

### remory/babel.config.js

```javascript
module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      ['module:react-native-dotenv', {
        moduleName: '@env',
        path: '.env',
        blacklist: null,
        whitelist: null,
        safe: false,
        allowUndefined: true
      }]
    ]
  };
};

```

### remory/server/tokenServer.js

```javascript
const express = require('express');
const { AccessToken } = require('livekit-server-sdk');
require('dotenv').config({ path: '../.env' });

const app = express();
app.use(express.json());

const PORT = process.env.TOKEN_SERVER_PORT || 3001;

// Middleware to log requests
app.use((req, res, next) => {
  console.log(`${new Date().toISOString()} - ${req.method} ${req.path}`);
  next();
});

/**
 * Generate LiveKit access token for a participant
 * POST /api/livekit/token
 * Body: { roomName: string, participantName: string, participantMetadata?: string }
 */
app.post('/api/livekit/token', async (req, res) => {
  try {
    const { roomName, participantName, participantMetadata } = req.body;

    // Validate required fields
    if (!roomName || !participantName) {
      return res.status(400).json({
        error: 'Missing required fields',
        required: ['roomName', 'participantName'],
      });
    }

    // Check if LiveKit credentials are configured
    const apiKey = process.env.LIVEKIT_API_KEY;
    const apiSecret = process.env.LIVEKIT_API_SECRET;

    if (!apiKey || !apiSecret) {
      console.error('LiveKit credentials not configured');
      return res.status(500).json({
        error: 'Server configuration error: LiveKit credentials missing',
      });
    }

    // Create access token
    const token = new AccessToken(apiKey, apiSecret, {
      identity: participantName,
      metadata: participantMetadata || '',
    });

    // Grant permissions
    token.addGrant({
      room: roomName,
      roomJoin: true,
      canPublish: true,
      canSubscribe: true,
      canPublishData: true,
    });

    // Generate JWT
    const jwt = await token.toJwt();

    console.log(`Generated token for ${participantName} in room ${roomName}`);

    res.json({
      token: jwt,
      url: process.env.LIVEKIT_URL,
      roomName,
      participantName,
    });
  } catch (error) {
    console.error('Error generating token:', error);
    res.status(500).json({
      error: 'Failed to generate token',
      message: error.message,
    });
  }
});

/**
 * Health check endpoint
 */
app.get('/api/health', (req, res) => {
  res.json({
    status: 'ok',
    timestamp: new Date().toISOString(),
    livekitConfigured: !!(process.env.LIVEKIT_API_KEY && process.env.LIVEKIT_API_SECRET),
  });
});

// Start server
app.listen(PORT, () => {
  console.log('=== LiveKit Token Server ===');
  console.log(`Server running on port ${PORT}`);
  console.log(`Health check: http://localhost:${PORT}/api/health`);
  console.log(`Token endpoint: http://localhost:${PORT}/api/livekit/token`);
  console.log();

  // Configuration check
  if (!process.env.LIVEKIT_API_KEY || !process.env.LIVEKIT_API_SECRET) {
    console.warn('⚠️  WARNING: LiveKit credentials not configured!');
    console.warn('Please set LIVEKIT_API_KEY and LIVEKIT_API_SECRET in your .env file');
  } else {
    console.log('✅ LiveKit credentials configured');
  }

  if (!process.env.LIVEKIT_URL) {
    console.warn('⚠️  WARNING: LIVEKIT_URL not configured!');
  } else {
    console.log(`✅ LiveKit URL: ${process.env.LIVEKIT_URL}`);
  }
  console.log();
});

module.exports = app;

```

### remory/contexts/AuthContext.js

```javascript
import React, { createContext, useState, useContext, useEffect } from 'react';
import AsyncStorage from '@react-native-async-storage/async-storage';

const AuthContext = createContext({});

export const useAuth = () => {
  const context = useContext(AuthContext);
  if (!context) {
    throw new Error('useAuth must be used within an AuthProvider');
  }
  return context;
};

export const AuthProvider = ({ children }) => {
  const [user, setUser] = useState(null);
  const [loading, setLoading] = useState(true);
  const [isAuthenticated, setIsAuthenticated] = useState(false);

  // Check if user is already logged in on app start
  useEffect(() => {
    checkAuthState();
  }, []);

  const checkAuthState = async () => {
    try {
      setLoading(true);
      const storedUser = await AsyncStorage.getItem('user');

      if (storedUser) {
        const userData = JSON.parse(storedUser);
        setUser(userData);
        setIsAuthenticated(true);
      }
    } catch (error) {
      console.log('No authenticated user found:', error.message);
      setIsAuthenticated(false);
    } finally {
      setLoading(false);
    }
  };

  /**
   * Simple sign in (no actual authentication - demo mode)
   */
  const signIn = async (email, password) => {
    try {
      // Simple demo login - just store the email as user
      const userData = {
        email: email,
        name: email.split('@')[0],
        id: Date.now().toString(),
      };

      await AsyncStorage.setItem('user', JSON.stringify(userData));
      setUser(userData);
      setIsAuthenticated(true);

      return {
        user: userData,
        attributes: userData,
      };
    } catch (error) {
      console.error('Sign in error:', error);
      throw new Error('Failed to sign in');
    }
  };

  /**
   * Simple sign up (no actual authentication - demo mode)
   */
  const signUp = async (email, password, attributes = {}) => {
    try {
      // Simple demo signup - just store the user data
      const userData = {
        email: email,
        name: attributes.name || email.split('@')[0],
        ...attributes,
        id: Date.now().toString(),
      };

      await AsyncStorage.setItem('user', JSON.stringify(userData));
      setUser(userData);
      setIsAuthenticated(true);

      return {
        user: userData,
        userConfirmed: true,
        userSub: userData.id,
      };
    } catch (error) {
      console.error('Sign up error:', error);
      throw new Error('Failed to sign up');
    }
  };

  /**
   * Sign out
   */
  const signOut = async () => {
    try {
      await AsyncStorage.removeItem('user');
      setUser(null);
      setIsAuthenticated(false);
      return true;
    } catch (error) {
      console.error('Sign out error:', error);
      throw new Error('Failed to sign out');
    }
  };

  /**
   * Get user attribute
   */
  const getUserAttribute = (attributeName) => {
    return user ? user[attributeName] : null;
  };

  /**
   * Confirm sign up (no-op in demo mode)
   */
  const confirmSignUp = async (email, code) => {
    // No-op in demo mode
    return { success: true };
  };

  /**
   * Resend confirmation code (no-op in demo mode)
   */
  const resendConfirmationCode = async (email) => {
    // No-op in demo mode
    return { success: true };
  };

  const value = {
    user,
    loading,
    isAuthenticated,
    signIn,
    signUp,
    signOut,
    confirmSignUp,
    resendConfirmationCode,
    getUserAttribute,
  };

  return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
};

export default AuthContext;

```

[13 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]