# rfromr/seniormoment architecture

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

- Interactive diagram: https://gitdiagram.com/rfromr/seniormoment
- Repository: https://github.com/rfromr/seniormoment

## Overview

SeniorMoment is a console app that answers questions from a user’s Markdown or text notes, cites retrieved passages, and declines when the notes do not support an answer. Its main workflow loads and chunks documents, indexes embeddings, then retrieves relevant passages for Gemini-grounded answers. When it cannot answer, the user may teach it; a proposed note is shown for explicit approval before saving. The excerpts establish the core wiring and approval design; optional local AI operation is documented but its implementation is not shown.

Main entry points: [`src/SeniorMoment/Program.cs`](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Program.cs) (Question loop), [`src/SeniorMoment/NoteTaker.cs`](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/NoteTaker.cs) (Note proposals), [`src/SeniorMoment/Answerer.cs`](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Answerer.cs) (Retrieval and answers), [`src/SeniorMoment/VectorIndex.cs`](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/VectorIndex.cs) (Vector index)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Console interaction"]
  node_program["Question loop<br/>[Program.cs]"]
end

subgraph group_knowledge["Knowledge preparation"]
  node_loader["Document loading<br/>[DocumentLoader.cs]"]
  node_chunker["Passage chunking<br/>[Chunker.cs]"]
  node_index[("Vector index<br/>[VectorIndex.cs]")]
  node_notefiles["Notes on disk"]
end

subgraph group_answering["Grounded answering"]
  node_answerer["Retrieval and answers<br/>[Answerer.cs]"]
end

subgraph group_learning["Learning and AI"]
  node_gemini["Gemini client setup<br/>[Gemini.cs]"]
  node_notetaker["Note proposals<br/>[NoteTaker.cs]"]
end

node_user(("User"))
node_geminiservice{{"Google Gemini"}}

node_user -->|"asks questions"| node_program
node_program -->|"loads corpus"| node_loader
node_program -->|"chunks documents"| node_chunker
node_program -->|"builds index"| node_index
node_program -->|"creates clients"| node_gemini
node_program -->|"routes questions"| node_answerer
node_answerer -->|"searches passages"| node_index
node_answerer -->|"returns cited answer"| node_user
node_program -->|"offers learning"| node_notetaker
node_user -->|"approves proposal"| node_notetaker
node_notetaker -->|"saves approved note"| node_notefiles
node_notetaker -->|"adds learned chunks"| node_index
node_gemini -->|"sends AI requests"| node_geminiservice

click node_program "https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Program.cs"
click node_loader "https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/DocumentLoader.cs"
click node_chunker "https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Chunker.cs"
click node_index "https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/VectorIndex.cs"
click node_answerer "https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Answerer.cs"
click node_gemini "https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Gemini.cs"
click node_notetaker "https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/NoteTaker.cs"

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_program,node_user toneBlue
class node_loader,node_chunker,node_index,node_notefiles toneAmber
class node_answerer toneMint
class node_gemini,node_notetaker toneRose
class node_geminiservice toneIndigo
```

## Components

### Console interaction

- [Question loop](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Program.cs): `src/SeniorMoment/Program.cs`

### Knowledge preparation

- [Document loading](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/DocumentLoader.cs): `src/SeniorMoment/DocumentLoader.cs`
- [Passage chunking](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Chunker.cs): `src/SeniorMoment/Chunker.cs`
- [Vector index](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/VectorIndex.cs): `src/SeniorMoment/VectorIndex.cs`
- **Notes on disk**

### Grounded answering

- [Retrieval and answers](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Answerer.cs): `src/SeniorMoment/Answerer.cs`

### Learning and AI

- [Gemini client setup](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/Gemini.cs): `src/SeniorMoment/Gemini.cs`
- [Note proposals](https://github.com/rfromr/seniormoment/blob/master/src/SeniorMoment/NoteTaker.cs): `src/SeniorMoment/NoteTaker.cs`

### Other components

- **User**
- **Google Gemini**

## Connections

- User → Question loop: asks questions (evidence: `README.md`)
- Question loop → Document loading: loads corpus (evidence: `src/SeniorMoment/Program.cs`)
- Question loop → Passage chunking: chunks documents (evidence: `src/SeniorMoment/Program.cs`)
- Question loop → Vector index: builds index (evidence: `src/SeniorMoment/Program.cs`)
- Question loop → Gemini client setup: creates clients (evidence: `src/SeniorMoment/Program.cs`)
- Question loop → Retrieval and answers: routes questions (evidence: `src/SeniorMoment/Program.cs`)
- Retrieval and answers → Vector index: searches passages (evidence: `src/SeniorMoment/Answerer.cs`)
- Retrieval and answers → User: returns cited answer (evidence: `src/SeniorMoment/Answerer.cs`)
- Question loop → Note proposals: offers learning (evidence: `src/SeniorMoment/Program.cs`)
- User → Note proposals: approves proposal
- Note proposals → Notes on disk: saves approved note (evidence: `README.md`)
- Note proposals → Vector index: adds learned chunks (evidence: `src/SeniorMoment/NoteTaker.cs`)
- Gemini client setup → Google Gemini: sends AI requests (evidence: `src/SeniorMoment/Gemini.cs`)
