# shivamsharko/aftermind architecture

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

- Interactive diagram: https://gitdiagram.com/shivamsharko/aftermind
- Repository: https://github.com/shivamsharko/aftermind

## Overview

Aftermind is an iOS personal-context notetaker: users record conversations, turn transcripts into typed, evidence-backed memories, then review, explore, and ask grounded questions about those memories. Capture orchestrates recording, transcription, extraction, and local persistence; chat retrieves structured items before generating cited answers. The graph also includes demo seeding, semantic scoring, reminders, and settings. README statements and indexed references support the main links; unsampled implementation details are not expanded beyond documented capabilities.

Main entry points: [`Aftermind/Views/CaptureView.swift`](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/CaptureView.swift) (Capture screen), [`Aftermind/Views/RootView.swift`](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/RootView.swift) (Tab navigation), [`Aftermind/Services/DemoSeedService.swift`](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/DemoSeedService.swift) (Demo seeding), [`Aftermind/Models/DatabaseModels.swift`](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Models/DatabaseModels.swift) (Local memory store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and extraction"]
  node_capture_view["Capture screen<br/>[CaptureView.swift]"]
  node_recording["Audio recording"]
  node_transcription["Transcription"]
  node_extraction["Memory extraction"]
end

subgraph group_memory["Memory and discovery"]
  node_models["Context schema"]
  node_swiftdata[("Local memory store")]
  node_memory_list["Memory library"]
  node_item_detail["Memory details"]
  node_explore["Relationship explorer<br/>[ExploreView.swift]"]
  node_demo_seed["Demo seeding"]
end

subgraph group_chat["Grounded chat"]
  node_chat_view["Chat screen<br/>[ChatView.swift]"]
  node_history["Chat history"]
  node_retrieval["Memory retrieval"]
  node_embeddings["Semantic embeddings"]
  node_answer["Answer generation"]
end

subgraph group_platform["App and platform services"]
  node_app["App startup<br/>[AftermindApp.swift]"]
  node_navigation["Tab navigation<br/>[RootView.swift]"]
  node_llm["Groq LLM client<br/>[LLMClient.swift]"]
  node_config["App configuration<br/>[AppConfig.swift]"]
  node_keychain["Keychain storage"]
  node_notifications["Local reminders"]
  node_reminder_bridge["Reminder actions"]
  node_date_parsing["Date parsing<br/>[DateParsing.swift]"]
end

node_user(("User"))
node_groq{{"Groq API"}}
node_ios_notifications{{"iOS notifications"}}

node_user -->|"opens app"| node_navigation
node_app -->|"launches"| node_navigation
node_navigation -->|"shows tab"| node_capture_view
node_navigation -->|"shows tab"| node_memory_list
node_navigation -->|"shows tab"| node_chat_view
node_navigation -->|"shows tab"| node_explore
node_user -->|"starts capture"| node_capture_view
node_capture_view -->|"controls recording"| node_recording
node_capture_view -->|"submits audio"| node_transcription
node_transcription -->|"transcribes audio"| node_groq
node_capture_view -->|"requests structuring"| node_extraction
node_extraction -->|"extracts memories"| node_llm
node_llm -->|"calls API"| node_groq
node_capture_view -->|"saves session"| node_swiftdata
node_extraction -->|"creates typed items"| node_models
node_memory_list -->|"reads and deletes"| node_swiftdata
node_memory_list -->|"loads demo data"| node_demo_seed
node_demo_seed -->|"inserts demo memories"| node_swiftdata
node_demo_seed -->|"embeds demo items"| node_embeddings
node_demo_seed -->|"schedules reminders"| node_notifications
node_memory_list -->|"opens item"| node_item_detail
node_item_detail -->|"offers reminder actions"| node_reminder_bridge
node_explore -->|"groups stored items"| node_swiftdata
node_chat_view -->|"maintains conversation"| node_history
node_chat_view -->|"requests matches"| node_retrieval
node_retrieval -->|"fetches memories"| node_swiftdata
node_retrieval -->|"scores similarity"| node_embeddings
node_retrieval -->|"provides context"| node_answer
node_answer -->|"requests grounded answer"| node_llm
node_answer -->|"returns cited answer"| node_chat_view
node_config -->|"loads API key"| node_keychain
node_config -->|"requests permission"| node_notifications
node_notifications -->|"schedules alerts"| node_ios_notifications
node_demo_seed -->|"resolves due dates"| node_date_parsing

click node_app "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/App/AftermindApp.swift"
click node_navigation "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/RootView.swift"
click node_capture_view "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/CaptureView.swift"
click node_recording "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/RecordingService.swift"
click node_transcription "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/TranscriptionService.swift"
click node_extraction "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ContextExtractionService.swift"
click node_models "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Models/DatabaseModels.swift"
click node_swiftdata "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Models/DatabaseModels.swift"
click node_memory_list "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/MemoryListView.swift"
click node_item_detail "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/MemoryItemDetailView.swift"
click node_explore "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/ExploreView.swift"
click node_demo_seed "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/DemoSeedService.swift"
click node_chat_view "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/ChatView.swift"
click node_history "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ChatHistoryService.swift"
click node_retrieval "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ChatRetrievalService.swift"
click node_embeddings "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/EmbeddingService.swift"
click node_answer "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ChatAnswerService.swift"
click node_llm "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/LLMClient.swift"
click node_config "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Support/AppConfig.swift"
click node_keychain "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/KeychainHelper.swift"
click node_notifications "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/NotificationService.swift"
click node_reminder_bridge "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ReminderBridge.swift"
click node_date_parsing "https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Support/DateParsing.swift"

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_capture_view,node_recording,node_transcription,node_extraction,node_user toneBlue
class node_models,node_swiftdata,node_memory_list,node_item_detail,node_explore,node_demo_seed toneAmber
class node_chat_view,node_history,node_retrieval,node_embeddings,node_answer,node_groq toneMint
class node_app,node_navigation,node_llm,node_config,node_keychain,node_notifications,node_reminder_bridge,node_date_parsing toneRose
class node_ios_notifications toneIndigo
```

## Components

### Capture and extraction

- [Capture screen](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/CaptureView.swift): `Aftermind/Views/CaptureView.swift`
- [Audio recording](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/RecordingService.swift): `Aftermind/Services/RecordingService.swift`
- [Transcription](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/TranscriptionService.swift): `Aftermind/Services/TranscriptionService.swift`
- [Memory extraction](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ContextExtractionService.swift): `Aftermind/Services/ContextExtractionService.swift`

### Memory and discovery

- [Context schema](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Models/DatabaseModels.swift): `Aftermind/Models/DatabaseModels.swift`
- [Local memory store](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Models/DatabaseModels.swift): `Aftermind/Models/DatabaseModels.swift`
- [Memory library](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/MemoryListView.swift): `Aftermind/Views/MemoryListView.swift`
- [Memory details](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/MemoryItemDetailView.swift): `Aftermind/Views/MemoryItemDetailView.swift`
- [Relationship explorer](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/ExploreView.swift): `Aftermind/Views/ExploreView.swift`
- [Demo seeding](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/DemoSeedService.swift): `Aftermind/Services/DemoSeedService.swift`

### Grounded chat

- [Chat screen](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/ChatView.swift): `Aftermind/Views/ChatView.swift`
- [Chat history](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ChatHistoryService.swift): `Aftermind/Services/ChatHistoryService.swift`
- [Memory retrieval](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ChatRetrievalService.swift): `Aftermind/Services/ChatRetrievalService.swift`
- [Semantic embeddings](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/EmbeddingService.swift): `Aftermind/Services/EmbeddingService.swift`
- [Answer generation](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ChatAnswerService.swift): `Aftermind/Services/ChatAnswerService.swift`

### App and platform services

- [App startup](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/App/AftermindApp.swift): `Aftermind/App/AftermindApp.swift`
- [Tab navigation](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Views/RootView.swift): `Aftermind/Views/RootView.swift`
- [Groq LLM client](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/LLMClient.swift): `Aftermind/Services/LLMClient.swift`
- [App configuration](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Support/AppConfig.swift): `Aftermind/Support/AppConfig.swift`
- [Keychain storage](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/KeychainHelper.swift): `Aftermind/Services/KeychainHelper.swift`
- [Local reminders](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/NotificationService.swift): `Aftermind/Services/NotificationService.swift`
- [Reminder actions](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Services/ReminderBridge.swift): `Aftermind/Services/ReminderBridge.swift`
- [Date parsing](https://github.com/shivamsharko/aftermind/blob/main/Aftermind/Support/DateParsing.swift): `Aftermind/Support/DateParsing.swift`

### Other components

- **User**
- **Groq API**
- **iOS notifications**

## Connections

- User → Tab navigation: opens app (evidence: `Aftermind/Views/RootView.swift`)
- App startup → Tab navigation: launches (evidence: `Aftermind/App/AftermindApp.swift`)
- Tab navigation → Capture screen: shows tab (evidence: `Aftermind/Views/RootView.swift`)
- Tab navigation → Memory library: shows tab (evidence: `Aftermind/Views/RootView.swift`)
- Tab navigation → Chat screen: shows tab (evidence: `Aftermind/Views/RootView.swift`)
- Tab navigation → Relationship explorer: shows tab (evidence: `Aftermind/Views/RootView.swift`)
- User → Capture screen: starts capture (evidence: `README.md`)
- Capture screen → Audio recording: controls recording (evidence: `Aftermind/Views/CaptureView.swift`)
- Capture screen → Transcription: submits audio (evidence: `README.md`)
- Transcription → Groq API: transcribes audio (evidence: `README.md`)
- Capture screen → Memory extraction: requests structuring (evidence: `README.md`)
- Memory extraction → Groq LLM client: extracts memories (evidence: `Aftermind/Services/ContextExtractionService.swift`)
- Groq LLM client → Groq API: calls API (evidence: `Aftermind/Services/LLMClient.swift`)
- Capture screen → Local memory store: saves session (evidence: `README.md`)
- Memory extraction → Context schema: creates typed items (evidence: `README.md`)
- Memory library → Local memory store: reads and deletes (evidence: `Aftermind/Views/MemoryListView.swift`)
- Memory library → Demo seeding: loads demo data (evidence: `Aftermind/Views/MemoryListView.swift`)
- Demo seeding → Local memory store: inserts demo memories (evidence: `Aftermind/Services/DemoSeedService.swift`)
- Demo seeding → Semantic embeddings: embeds demo items (evidence: `Aftermind/Services/DemoSeedService.swift`)
- Demo seeding → Local reminders: schedules reminders (evidence: `Aftermind/Services/DemoSeedService.swift`)
- Memory library → Memory details: opens item (evidence: `Aftermind/Views/MemoryListView.swift`)
- Memory details → Reminder actions: offers reminder actions (evidence: `Aftermind/Views/MemoryItemDetailView.swift`)
- Relationship explorer → Local memory store: groups stored items (evidence: `Aftermind/Views/ExploreView.swift`)
- Chat screen → Chat history: maintains conversation (evidence: `Aftermind/Views/ChatView.swift`)
- Chat screen → Memory retrieval: requests matches (evidence: `Aftermind/Views/ChatView.swift`)
- Memory retrieval → Local memory store: fetches memories (evidence: `README.md`)
- Memory retrieval → Semantic embeddings: scores similarity (evidence: `Aftermind/Services/ChatRetrievalService.swift`)
- Memory retrieval → Answer generation: provides context (evidence: `README.md`)
- Answer generation → Groq LLM client: requests grounded answer (evidence: `Aftermind/Services/ChatAnswerService.swift`)
- Answer generation → Chat screen: returns cited answer (evidence: `README.md`)
- App configuration → Keychain storage: loads API key (evidence: `Aftermind/Support/AppConfig.swift`)
- App configuration → Local reminders: requests permission (evidence: `Aftermind/Support/AppConfig.swift`)
- Local reminders → iOS notifications: schedules alerts (evidence: `Aftermind/Services/NotificationService.swift`)
- Demo seeding → Date parsing: resolves due dates (evidence: `Aftermind/Services/DemoSeedService.swift`)
