# d-suraj/personal-assistant-llm architecture

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

- Interactive diagram: https://gitdiagram.com/d-suraj/personal-assistant-llm
- Repository: https://github.com/d-suraj/personal-assistant-llm

## Overview

WorkMind is a Streamlit knowledge-base assistant. Users create projects, upload files or index local folders, and the app stores file metadata while chunking and embedding content into a searchable vector store. They can inspect semantic matches directly or ask questions, which combine retrieved chunks with chat history before calling OpenRouter. The README also documents batch deletion and configuration views. The excerpts show the main indexing and query wiring; some dashboard and deletion relationships are supported only by the README.

Main entry points: [`app.py`](https://github.com/d-suraj/personal-assistant-llm/blob/main/app.py) (Streamlit app), [`embeddings.py`](https://github.com/d-suraj/personal-assistant-llm/blob/main/embeddings.py) (Embedding client), [`database.py`](https://github.com/d-suraj/personal-assistant-llm/blob/main/database.py) (Project metadata), [`vector_store.py`](https://github.com/d-suraj/personal-assistant-llm/blob/main/vector_store.py) (Vector index)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["App and workflows"]
  node_ui["Streamlit app<br/>[app.py]"]
  node_config["Settings<br/>[config.py]"]
end

subgraph group_indexing["Content indexing"]
  node_files["File discovery and reading<br/>[text_utils.py]"]
  node_chunker["Semantic chunker<br/>[chunking.py]"]
end

subgraph group_storage["Persistence and retrieval"]
  node_metadata[("Project metadata<br/>[database.py]")]
  node_vectors[("Vector index<br/>[vector_store.py]")]
end

subgraph group_models["Model services"]
  node_embedder["Embedding client<br/>[embeddings.py]"]
  node_chat["Contextual answering"]
end

node_user(("User"))
node_openrouter{{"OpenRouter API"}}

node_user -->|"uses"| node_ui
node_ui -->|"loads settings"| node_config
node_ui -->|"manages projects"| node_metadata
node_ui -->|"discovers files"| node_files
node_ui -->|"saves file metadata"| node_metadata
node_ui -->|"chunks documents"| node_chunker
node_chunker -->|"embeds units"| node_embedder
node_ui -->|"embeds chunks"| node_embedder
node_ui -->|"indexes chunks"| node_vectors
node_user -->|"asks questions"| node_ui
node_ui -->|"embeds query"| node_embedder
node_ui -->|"searches matches"| node_vectors
node_ui -->|"requests answer"| node_chat
node_chat -->|"calls chat API"| node_openrouter
node_embedder -->|"requests embeddings"| node_openrouter
node_user -->|"deletes files"| node_ui
node_ui -->|"deletes indexed chunks"| node_vectors
node_ui -->|"deletes file records"| node_metadata

click node_ui "https://github.com/d-suraj/personal-assistant-llm/blob/main/app.py"
click node_config "https://github.com/d-suraj/personal-assistant-llm/blob/main/config.py"
click node_files "https://github.com/d-suraj/personal-assistant-llm/blob/main/text_utils.py"
click node_chunker "https://github.com/d-suraj/personal-assistant-llm/blob/main/chunking.py"
click node_embedder "https://github.com/d-suraj/personal-assistant-llm/blob/main/embeddings.py"
click node_metadata "https://github.com/d-suraj/personal-assistant-llm/blob/main/database.py"
click node_vectors "https://github.com/d-suraj/personal-assistant-llm/blob/main/vector_store.py"
click node_chat "https://github.com/d-suraj/personal-assistant-llm/blob/main/openrouter_client.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_ui,node_config,node_user toneBlue
class node_files,node_chunker toneAmber
class node_metadata,node_vectors,node_openrouter toneMint
class node_embedder,node_chat toneRose
```

## Components

### App and workflows

- [Streamlit app](https://github.com/d-suraj/personal-assistant-llm/blob/main/app.py): `app.py`
- [Settings](https://github.com/d-suraj/personal-assistant-llm/blob/main/config.py): `config.py`

### Content indexing

- [File discovery and reading](https://github.com/d-suraj/personal-assistant-llm/blob/main/text_utils.py): `text_utils.py`
- [Semantic chunker](https://github.com/d-suraj/personal-assistant-llm/blob/main/chunking.py): `chunking.py`

### Persistence and retrieval

- [Project metadata](https://github.com/d-suraj/personal-assistant-llm/blob/main/database.py): `database.py`
- [Vector index](https://github.com/d-suraj/personal-assistant-llm/blob/main/vector_store.py): `vector_store.py`

### Model services

- [Embedding client](https://github.com/d-suraj/personal-assistant-llm/blob/main/embeddings.py): `embeddings.py`
- [Contextual answering](https://github.com/d-suraj/personal-assistant-llm/blob/main/openrouter_client.py): `openrouter_client.py`

### Other components

- **User**
- **OpenRouter API**

## Connections

- User → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → Settings: loads settings (evidence: `app.py`)
- Streamlit app → Project metadata: manages projects (evidence: `app.py`)
- Streamlit app → File discovery and reading: discovers files (evidence: `app.py`)
- Streamlit app → Project metadata: saves file metadata (evidence: `app.py`)
- Streamlit app → Semantic chunker: chunks documents (evidence: `app.py`)
- Semantic chunker → Embedding client: embeds units (evidence: `chunking.py`)
- Streamlit app → Embedding client: embeds chunks (evidence: `app.py`)
- Streamlit app → Vector index: indexes chunks (evidence: `app.py`)
- User → Streamlit app: asks questions (evidence: `README.md`)
- Streamlit app → Embedding client: embeds query (evidence: `app.py`)
- Streamlit app → Vector index: searches matches (evidence: `app.py`)
- Streamlit app → Contextual answering: requests answer (evidence: `app.py`)
- Contextual answering → OpenRouter API: calls chat API (evidence: `openrouter_client.py`)
- Embedding client → OpenRouter API: requests embeddings (evidence: `embeddings.py`)
- User → Streamlit app: deletes files (evidence: `README.md`)
- Streamlit app → Vector index: deletes indexed chunks (evidence: `README.md`)
- Streamlit app → Project metadata: deletes file records (evidence: `README.md`)
