# sampreethg/-intelligent-university-knowledge-assistant architecture

> Architecture diagram of the GitHub repository sampreethg/-intelligent-university-knowledge-assistant, 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/sampreethg/-intelligent-university-knowledge-assistant
- Repository: https://github.com/sampreethg/-intelligent-university-knowledge-assistant

## Overview

UniMind is a Streamlit-based academic knowledge assistant. Its main workflow accepts institutional documents, parses and chunks them, indexes their embeddings alongside SQLite metadata, then retrieves relevant passages to generate citation-grounded answers with local Ollama inference. The graph also includes document inspection, answer telemetry/export, and optional remote demonstration. The README documents the overall flow; sampled code confirms parsing, chunking, storage, and grounded generation behavior, but does not show every query-path call site.

Main entry points: [`app.py`](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/app.py) (Streamlit Portal), [`vector_store.py`](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/vector_store.py) (Similarity Retrieval), [`llm.py`](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/llm.py) (Grounded Prompting), [`ingestion.py`](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/ingestion.py) (Document Parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Experience"]
  node_portal["Streamlit Portal<br/>[app.py]"]
  node_inspector["Chunk Inspector<br/>[app.py]"]
  node_answer_ui["Citations &amp; Export<br/>[app.py]"]
  node_tunnel{{"Cloudflare Tunnel"}}
end

subgraph group_ingestion["Document Ingestion"]
  node_parser["Document Parser<br/>[ingestion.py]"]
  node_chunker["Overlap Chunking<br/>[chunking.py]"]
end

subgraph group_knowledge["Knowledge Retrieval"]
  node_embedder["Text Embeddings<br/>[vector_store.py]"]
  node_faiss[("FAISS Vector Index<br/>[vector_store.py]")]
  node_sqlite[("SQLite Metadata<br/>[database.py]")]
  node_retriever["Similarity Retrieval<br/>[vector_store.py]"]
end

subgraph group_answering["Grounded Answering"]
  node_prompt["Grounded Prompting<br/>[llm.py]"]
  node_ollama{{"Local Ollama"}}
end

node_user(("Student or Faculty"))

node_user -->|"uploads or asks"| node_portal
node_portal -->|"parses uploads"| node_parser
node_parser -->|"returns pages"| node_chunker
node_portal -->|"chunks pages"| node_chunker
node_portal -->|"indexes chunks"| node_embedder
node_embedder -->|"adds vectors"| node_faiss
node_embedder -->|"records chunks"| node_sqlite
node_portal -->|"searches query"| node_retriever
node_retriever -->|"embeds query"| node_embedder
node_retriever -->|"searches vectors"| node_faiss
node_retriever -->|"loads metadata"| node_sqlite
node_portal -->|"requests answer"| node_prompt
node_prompt -->|"streams inference"| node_ollama
node_retriever -->|"provides passages"| node_prompt
node_prompt -.->|"streams cited answer"| node_answer_ui
node_portal -->|"opens chunks"| node_inspector
node_user -->|"views or exports"| node_answer_ui
node_user -.->|"shares remotely"| node_tunnel

click node_portal "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/app.py"
click node_inspector "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/app.py"
click node_answer_ui "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/app.py"
click node_parser "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/ingestion.py"
click node_chunker "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/chunking.py"
click node_embedder "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/vector_store.py"
click node_faiss "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/vector_store.py"
click node_sqlite "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/database.py"
click node_retriever "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/vector_store.py"
click node_prompt "https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/llm.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_portal,node_inspector,node_answer_ui,node_tunnel toneBlue
class node_parser,node_chunker toneAmber
class node_embedder,node_faiss,node_sqlite,node_retriever toneMint
class node_prompt,node_ollama toneRose
class node_user toneIndigo
```

## Components

### User Experience

- [Streamlit Portal](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/app.py): `app.py`
- [Chunk Inspector](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/app.py): `app.py`
- [Citations & Export](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/app.py): `app.py`
- **Cloudflare Tunnel**

### Document Ingestion

- [Document Parser](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/ingestion.py): `ingestion.py`
- [Overlap Chunking](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/chunking.py): `chunking.py`

### Knowledge Retrieval

- [Text Embeddings](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/vector_store.py): `vector_store.py`
- [FAISS Vector Index](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/vector_store.py): `vector_store.py`
- [SQLite Metadata](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/database.py): `database.py`
- [Similarity Retrieval](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/vector_store.py): `vector_store.py`

### Grounded Answering

- [Grounded Prompting](https://github.com/sampreethg/-intelligent-university-knowledge-assistant/blob/main/llm.py): `llm.py`
- **Local Ollama**

### Other components

- **Student or Faculty**

## Connections

- Student or Faculty → Streamlit Portal: uploads or asks (evidence: `README.md`)
- Streamlit Portal → Document Parser: parses uploads (evidence: `README.md`)
- Document Parser → Overlap Chunking: returns pages (evidence: `app.py`)
- Streamlit Portal → Overlap Chunking: chunks pages (evidence: `app.py`)
- Streamlit Portal → Text Embeddings: indexes chunks (evidence: `README.md`)
- Text Embeddings → FAISS Vector Index: adds vectors (evidence: `vector_store.py`)
- Text Embeddings → SQLite Metadata: records chunks (evidence: `vector_store.py`)
- Streamlit Portal → Similarity Retrieval: searches query (evidence: `README.md`)
- Similarity Retrieval → Text Embeddings: embeds query (evidence: `vector_store.py`)
- Similarity Retrieval → FAISS Vector Index: searches vectors (evidence: `vector_store.py`)
- Similarity Retrieval → SQLite Metadata: loads metadata (evidence: `vector_store.py`)
- Streamlit Portal → Grounded Prompting: requests answer (evidence: `README.md`)
- Grounded Prompting → Local Ollama: streams inference (evidence: `llm.py`)
- Similarity Retrieval → Grounded Prompting: provides passages (evidence: `README.md`)
- Grounded Prompting → Citations & Export: streams cited answer (evidence: `app.py`)
- Streamlit Portal → Chunk Inspector: opens chunks (evidence: `README.md`)
- Student or Faculty → Citations & Export: views or exports (evidence: `README.md`)
- Student or Faculty → Cloudflare Tunnel: shares remotely (evidence: `README.md`)
