# uditawasthi404/ka_iros architecture

> Architecture diagram of the GitHub repository uditawasthi404/ka_iros, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/uditawasthi404/ka_iros
- Repository: https://github.com/uditawasthi404/ka_iros

## Overview

Kairos is a personal memory product: people capture notes and media, then search saved material or ask questions about it. The mobile app is the primary experience, with a web client and authenticated NestJS API. The backend also supports Recall screen memory, projects, insights, notifications, and Pro entitlements. The graph preserves these documented product areas; where their implementation or wiring was not sampled, paths point to existing subsystem directories and uncertain relationships are omitted. Internal capture and retrieval details are shown only where source excerpts support them.

Main entry points: [`backend/src`](https://github.com/uditawasthi404/ka_iros/tree/main/backend/src) (NestJS API), [`backend/src/prisma/prisma.service.ts`](https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/prisma/prisma.service.ts) (Postgres database), [`backend/src/observations/observations.controller.ts`](https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/observations/observations.controller.ts) (Observation intake), [`backend/src/search/search.service.ts`](https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/search/search.service.ts) (Hybrid search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client experiences"]
  node_mobile["Mobile app"]
  node_web["Web app"]
  node_searchui["Search and library<br/>[search.tsx]"]
end

subgraph group_capture["Capture and Recall"]
  node_captureui["Capture UI<br/>[capture.tsx]"]
  node_oscapture["OS capture tools"]
  node_observations["Observation intake"]
  node_processing["Observation processing"]
  node_recall["Recall screen memory"]
  node_recallapi["Recall API"]
end

subgraph group_memory["Memory services"]
  node_search["Hybrid search<br/>[search.service.ts]"]
  node_embeddings["Embeddings"]
  node_ask["Ask and RAG<br/>[ask.service.ts]"]
  node_projects["Projects"]
  node_insights["Insights and topics"]
  node_storage["File storage"]
end

subgraph group_platform["Account and platform"]
  node_api["NestJS API"]
  node_database[("Postgres database<br/>[prisma.service.ts]")]
  node_auth["Authentication"]
  node_entitlements["Pro entitlements"]
  node_notifications["Notifications"]
end

node_person(("Person"))
node_revenuecat["RevenueCat"]

node_person -->|"uses"| node_mobile
node_person -->|"uses"| node_web
node_mobile -->|"uses API"| node_api
node_web -->|"uses API"| node_api
node_person -->|"captures with"| node_captureui
node_oscapture -->|"opens capture"| node_mobile
node_captureui -->|"submits capture"| node_observations
node_observations -->|"delegates"| node_processing
node_person -->|"enables Recall"| node_recall
node_recall -.->|"uploads memories"| node_recallapi
node_person -->|"searches"| node_searchui
node_searchui -->|"queries"| node_api
node_search -->|"embeds query"| node_embeddings
node_search -->|"reads records"| node_database
node_embeddings -->|"writes vectors"| node_database
node_person -->|"asks questions"| node_ask
node_ask -.->|"retrieves context"| node_search
node_projects -.->|"manages projects"| node_database
node_insights -.->|"reads memory data"| node_database
node_observations -.->|"stores files"| node_storage
node_person -->|"signs in"| node_auth
node_api -->|"protects routes"| node_auth
node_person -->|"checks Pro access"| node_entitlements
node_entitlements -->|"syncs purchases"| node_revenuecat
node_notifications -.->|"sends updates"| node_person

click node_mobile "https://github.com/uditawasthi404/ka_iros/tree/main/apps/mobile/app"
click node_web "https://github.com/uditawasthi404/ka_iros/tree/main/apps/web/app"
click node_api "https://github.com/uditawasthi404/ka_iros/tree/main/backend/src"
click node_captureui "https://github.com/uditawasthi404/ka_iros/blob/main/apps/mobile/app/(app)/(tabs)/capture.tsx"
click node_oscapture "https://github.com/uditawasthi404/ka_iros/tree/main/apps/mobile/modules/kairos-os"
click node_observations "https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/observations/observations.controller.ts"
click node_processing "https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/observations"
click node_recall "https://github.com/uditawasthi404/ka_iros/tree/main/apps/mobile/modules/kairos-recall"
click node_recallapi "https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/recall"
click node_searchui "https://github.com/uditawasthi404/ka_iros/blob/main/apps/mobile/app/(app)/search.tsx"
click node_search "https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/search/search.service.ts"
click node_embeddings "https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/embeddings/chunk-embedding.service.ts"
click node_ask "https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/ask/ask.service.ts"
click node_projects "https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/projects/projects.controller.ts"
click node_insights "https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/insights"
click node_storage "https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/storage"
click node_database "https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/prisma/prisma.service.ts"
click node_auth "https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/auth"
click node_entitlements "https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/entitlements"
click node_notifications "https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/notifications"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mobile,node_web,node_searchui toneBlue
class node_captureui,node_oscapture,node_observations,node_processing,node_recall,node_recallapi toneAmber
class node_search,node_embeddings,node_ask,node_projects,node_insights,node_storage toneMint
class node_api,node_database,node_auth,node_entitlements,node_notifications toneRose
class node_person,node_revenuecat toneIndigo
```

## Components

### Client experiences

- [Mobile app](https://github.com/uditawasthi404/ka_iros/tree/main/apps/mobile/app): `apps/mobile/app`
- [Web app](https://github.com/uditawasthi404/ka_iros/tree/main/apps/web/app): `apps/web/app`
- [Search and library](https://github.com/uditawasthi404/ka_iros/blob/main/apps/mobile/app/(app)/search.tsx): `apps/mobile/app/(app)/search.tsx`

### Capture and Recall

- [Capture UI](https://github.com/uditawasthi404/ka_iros/blob/main/apps/mobile/app/(app)/(tabs)/capture.tsx): `apps/mobile/app/(app)/(tabs)/capture.tsx`
- [OS capture tools](https://github.com/uditawasthi404/ka_iros/tree/main/apps/mobile/modules/kairos-os): `apps/mobile/modules/kairos-os`
- [Observation intake](https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/observations/observations.controller.ts): `backend/src/observations/observations.controller.ts`
- [Observation processing](https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/observations): `backend/src/observations`
- [Recall screen memory](https://github.com/uditawasthi404/ka_iros/tree/main/apps/mobile/modules/kairos-recall): `apps/mobile/modules/kairos-recall`
- [Recall API](https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/recall): `backend/src/recall`

### Memory services

- [Hybrid search](https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/search/search.service.ts): `backend/src/search/search.service.ts`
- [Embeddings](https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/embeddings/chunk-embedding.service.ts): `backend/src/embeddings/chunk-embedding.service.ts`
- [Ask and RAG](https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/ask/ask.service.ts): `backend/src/ask/ask.service.ts`
- [Projects](https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/projects/projects.controller.ts): `backend/src/projects/projects.controller.ts`
- [Insights and topics](https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/insights): `backend/src/insights`
- [File storage](https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/storage): `backend/src/storage`

### Account and platform

- [NestJS API](https://github.com/uditawasthi404/ka_iros/tree/main/backend/src): `backend/src`
- [Postgres database](https://github.com/uditawasthi404/ka_iros/blob/main/backend/src/prisma/prisma.service.ts): `backend/src/prisma/prisma.service.ts`
- [Authentication](https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/auth): `backend/src/auth`
- [Pro entitlements](https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/entitlements): `backend/src/entitlements`
- [Notifications](https://github.com/uditawasthi404/ka_iros/tree/main/backend/src/notifications): `backend/src/notifications`

### Other components

- **Person**
- **RevenueCat**

## Connections

- Person → Mobile app: uses (evidence: `README.md`)
- Person → Web app: uses (evidence: `README.md`)
- Mobile app → NestJS API: uses API (evidence: `README.md`)
- Web app → NestJS API: uses API (evidence: `README.md`)
- Person → Capture UI: captures with (evidence: `README.md`)
- OS capture tools → Mobile app: opens capture (evidence: `apps/mobile/modules/kairos-os/android/src/main/java/expo/modules/kairosos/KairosImeService.kt`)
- Capture UI → Observation intake: submits capture (evidence: `README.md`)
- Observation intake → Observation processing: delegates (evidence: `backend/src/observations/observations.controller.ts`)
- Person → Recall screen memory: enables Recall (evidence: `README.md`)
- Recall screen memory → Recall API: uploads memories
- Person → Search and library: searches (evidence: `README.md`)
- Search and library → NestJS API: queries (evidence: `README.md`)
- Hybrid search → Embeddings: embeds query (evidence: `backend/src/search/search.service.ts`)
- Hybrid search → Postgres database: reads records (evidence: `backend/src/search/search.service.ts`)
- Embeddings → Postgres database: writes vectors (evidence: `backend/src/embeddings/chunk-embedding.service.ts`)
- Person → Ask and RAG: asks questions (evidence: `README.md`)
- Ask and RAG → Hybrid search: retrieves context
- Projects → Postgres database: manages projects
- Insights and topics → Postgres database: reads memory data
- Observation intake → File storage: stores files
- Person → Authentication: signs in (evidence: `README.md`)
- NestJS API → Authentication: protects routes (evidence: `backend/src/observations/observations.controller.ts`)
- Person → Pro entitlements: checks Pro access (evidence: `README.md`)
- Pro entitlements → RevenueCat: syncs purchases (evidence: `README.md`)
- Notifications → Person: sends updates
