# harshkaushik2203/talk-to-my-notes architecture

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

- Interactive diagram: https://gitdiagram.com/harshkaushik2203/talk-to-my-notes
- Repository: https://github.com/harshkaushik2203/talk-to-my-notes

## Overview

Talk to My Notes is a personal study-prep RAG assistant: users add notes, then chat with answers grounded in those notes or quiz themselves on a selected topic. The documented workflow loads and chunks notes, embeds them into a persistent vector store, and retrieves them for grounded generation; quiz mode selects a stored chunk before generating and grading a question. The README also describes an evaluation harness for retrieval and answer quality. Edges reflect shown calls or documented architecture; unsampled integrations are not inferred.

Main entry points: [`app.py`](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/app.py) (Streamlit app), [`src/vectorstore.py`](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/vectorstore.py) (Chroma store), [`src/generate.py`](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/generate.py) (Grounded answers), [`src/ingest.py`](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/ingest.py) (Load and chunk)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_app["Streamlit app<br/>[app.py]"]
end

subgraph group_knowledge["Knowledge preparation"]
  node_corpus["Study notes"]
  node_ingest["Load and chunk<br/>[ingest.py]"]
  node_add_notes["Add notes<br/>[vectorstore.py]"]
  node_embed["Embeddings<br/>[vectorstore.py]"]
  node_store[("Chroma store<br/>[vectorstore.py]")]
end

subgraph group_runtime["Retrieval and generation"]
  node_retrieval["Search and sample<br/>[vectorstore.py]"]
  node_answer["Grounded answers<br/>[generate.py]"]
  node_quiz_question["Quiz questions<br/>[generate.py]"]
  node_quiz_grading["Answer feedback<br/>[generate.py]"]
end

subgraph group_quality["Evaluation"]
  node_evaluation["RAG evaluation<br/>[evaluate.py]"]
end

node_student(("Student"))
node_groq{{"Groq LLM"}}

node_student -->|"uses"| node_app
node_app -->|"loads and chunks"| node_ingest
node_ingest -->|"reads notes"| node_corpus
node_app -->|"builds store"| node_store
node_store -->|"chunks documents"| node_ingest
node_store -->|"embeds documents"| node_embed
node_store -->|"persists vectors"| node_store
node_app -->|"adds pasted text"| node_add_notes
node_app -->|"adds uploaded files"| node_add_notes
node_add_notes -->|"chunks text"| node_ingest
node_add_notes -->|"adds documents"| node_store
node_app -->|"asks question"| node_answer
node_answer -->|"searches notes"| node_retrieval
node_retrieval -->|"queries vectors"| node_store
node_answer -->|"generates answer"| node_groq
node_app -->|"gets random chunk"| node_retrieval
node_app -->|"requests question"| node_quiz_question
node_quiz_question -->|"generates question"| node_groq
node_app -->|"submits answer"| node_quiz_grading
node_quiz_grading -->|"grades response"| node_groq
node_evaluation -->|"measures retrieval"| node_retrieval
node_evaluation -->|"evaluates answers"| node_answer
node_evaluation -->|"scores answers"| node_groq

click node_app "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/app.py"
click node_corpus "https://github.com/harshkaushik2203/talk-to-my-notes/tree/main/data"
click node_ingest "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/ingest.py"
click node_add_notes "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/vectorstore.py"
click node_embed "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/vectorstore.py"
click node_store "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/vectorstore.py"
click node_retrieval "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/vectorstore.py"
click node_answer "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/generate.py"
click node_quiz_question "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/generate.py"
click node_quiz_grading "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/generate.py"
click node_evaluation "https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/evaluate.py"

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_app toneBlue
class node_corpus,node_ingest,node_add_notes,node_embed,node_store toneAmber
class node_retrieval,node_answer,node_quiz_question,node_quiz_grading toneMint
class node_evaluation toneRose
class node_student,node_groq toneIndigo
```

## Components

### User experience

- [Streamlit app](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/app.py): `app.py`

### Knowledge preparation

- [Study notes](https://github.com/harshkaushik2203/talk-to-my-notes/tree/main/data): `data`
- [Load and chunk](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/ingest.py): `src/ingest.py`
- [Add notes](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/vectorstore.py): `src/vectorstore.py`
- [Embeddings](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/vectorstore.py): `src/vectorstore.py`
- [Chroma store](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/vectorstore.py): `src/vectorstore.py`

### Retrieval and generation

- [Search and sample](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/vectorstore.py): `src/vectorstore.py`
- [Grounded answers](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/generate.py): `src/generate.py`
- [Quiz questions](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/generate.py): `src/generate.py`
- [Answer feedback](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/generate.py): `src/generate.py`

### Evaluation

- [RAG evaluation](https://github.com/harshkaushik2203/talk-to-my-notes/blob/main/src/evaluate.py): `src/evaluate.py`

### Other components

- **Student**
- **Groq LLM**

## Connections

- Student → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → Load and chunk: loads and chunks (evidence: `app.py`)
- Load and chunk → Study notes: reads notes (evidence: `src/ingest.py`)
- Streamlit app → Chroma store: builds store (evidence: `app.py`)
- Chroma store → Load and chunk: chunks documents (evidence: `src/vectorstore.py`)
- Chroma store → Embeddings: embeds documents (evidence: `README.md`)
- Chroma store → Chroma store: persists vectors (evidence: `src/vectorstore.py`)
- Streamlit app → Add notes: adds pasted text (evidence: `app.py`)
- Streamlit app → Add notes: adds uploaded files (evidence: `app.py`)
- Add notes → Load and chunk: chunks text (evidence: `src/vectorstore.py`)
- Add notes → Chroma store: adds documents (evidence: `src/vectorstore.py`)
- Streamlit app → Grounded answers: asks question (evidence: `app.py`)
- Grounded answers → Search and sample: searches notes (evidence: `src/generate.py`)
- Search and sample → Chroma store: queries vectors (evidence: `src/vectorstore.py`)
- Grounded answers → Groq LLM: generates answer (evidence: `src/generate.py`)
- Streamlit app → Search and sample: gets random chunk (evidence: `app.py`)
- Streamlit app → Quiz questions: requests question (evidence: `app.py`)
- Quiz questions → Groq LLM: generates question (evidence: `src/generate.py`)
- Streamlit app → Answer feedback: submits answer (evidence: `app.py`)
- Answer feedback → Groq LLM: grades response (evidence: `src/generate.py`)
- RAG evaluation → Search and sample: measures retrieval (evidence: `src/evaluate.py`)
- RAG evaluation → Grounded answers: evaluates answers (evidence: `src/evaluate.py`)
- RAG evaluation → Groq LLM: scores answers (evidence: `src/evaluate.py`)
