# vaishnavi14k/uniassist-ai architecture

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

- Interactive diagram: https://gitdiagram.com/vaishnavi14k/uniassist-ai
- Repository: https://github.com/vaishnavi14k/uniassist-ai

## Overview

UniAssist AI routes student campus questions to relevant departments and returns an AI-generated response, informed by prior queries and campus knowledge. The main workflow runs from the Ask AI page through the REST API and LangGraph orchestration into analysis, similarity search, department lookup, response generation, and persistence. The UI also provides dashboard, health, and knowledge-graph views. README documents capabilities whose route implementations were not sampled; those are shown where paths are supported, without assuming internal call details.

Main entry points: [`backend/app/main.py`](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/main.py) (FastAPI app), [`src/services/api.ts`](https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/services/api.ts) (REST client), [`backend/app/vector/store.py`](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/vector/store.py) (Similarity search), [`backend/app/graph/service.py`](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/graph/service.py) (Department and entity lookup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Student interface"]
  node_app["Page navigation<br/>[App.tsx]"]
  node_ask["Ask AI<br/>[AskAI.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_kgview["Knowledge graph view<br/>[KnowledgeGraph.tsx]"]
  node_client["REST client<br/>[api.ts]"]
  node_healthhook["Health status<br/>[useHealth.ts]"]
end

subgraph group_api["API and orchestration"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_queryroute["Query endpoint<br/>[queries.py]"]
  node_statsroute["Stats endpoints<br/>[stats.py]"]
  node_healthroute["Health endpoint<br/>[health.py]"]
  node_workflow["Query workflow<br/>[workflow.py]"]
end

subgraph group_knowledge["Query intelligence"]
  node_ai["LLM analysis and response<br/>[service.py]"]
  node_tools["MCP data tools<br/>[tools.py]"]
  node_vector[("Similarity search<br/>[store.py]")]
  node_graphservice["Department and entity lookup<br/>[service.py]"]
end

subgraph group_data["Campus data"]
  node_sqlite[("SQLite records<br/>[models.py]")]
  node_config["Runtime configuration<br/>[config.py]"]
  node_seed["Initial data seeding<br/>[seed.py]"]
end

node_student(("Student"))
node_ollama["Ollama"]
node_chromadb[("ChromaDB")]
node_neo4j[("Neo4j")]

node_student -.->|"submits question"| node_ask
node_app -->|"renders"| node_ask
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_kgview
node_ask -->|"submits query"| node_client
node_dashboard -->|"loads stats"| node_client
node_dashboard -->|"uses"| node_healthhook
node_healthhook -->|"checks health"| node_client
node_kgview -->|"loads graph"| node_client
node_client -->|"HTTP requests"| node_fastapi
node_fastapi -->|"registers route"| node_queryroute
node_fastapi -->|"registers route"| node_statsroute
node_fastapi -->|"registers route"| node_healthroute
node_queryroute -->|"runs workflow"| node_workflow
node_workflow -->|"invokes"| node_ai
node_workflow -->|"calls tools"| node_tools
node_ai -->|"invokes model"| node_ollama
node_tools -->|"searches and adds"| node_vector
node_tools -->|"queries graph"| node_graphservice
node_graphservice -->|"runs Cypher"| node_neo4j
node_vector -->|"searches and stores"| node_chromadb
node_tools -->|"persists query"| node_sqlite
node_statsroute -.->|"reads records"| node_sqlite
node_fastapi -->|"seeds startup data"| node_seed
node_seed -->|"seeds vectors"| node_vector
node_seed -->|"seeds records"| node_sqlite
node_fastapi -->|"seeds and closes"| node_graphservice
node_config -->|"configures model"| node_ai
node_config -->|"configures store"| node_vector
node_config -->|"configures connection"| node_graphservice
node_healthroute -.->|"checks availability"| node_ai
node_healthroute -.->|"checks availability"| node_vector
node_healthroute -.->|"checks availability"| node_graphservice

click node_app "https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/App.tsx"
click node_ask "https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/pages/AskAI.tsx"
click node_dashboard "https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/pages/Dashboard.tsx"
click node_kgview "https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/pages/KnowledgeGraph.tsx"
click node_client "https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/services/api.ts"
click node_healthhook "https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/services/useHealth.ts"
click node_fastapi "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/main.py"
click node_queryroute "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/routes/queries.py"
click node_statsroute "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/routes/stats.py"
click node_healthroute "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/routes/health.py"
click node_workflow "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/ai/workflow.py"
click node_ai "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/ai/service.py"
click node_tools "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/mcp/tools.py"
click node_vector "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/vector/store.py"
click node_graphservice "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/graph/service.py"
click node_sqlite "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/models.py"
click node_config "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/config.py"
click node_seed "https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/seed.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,node_ask,node_dashboard,node_kgview,node_client,node_healthhook toneBlue
class node_fastapi,node_queryroute,node_statsroute,node_healthroute,node_workflow,node_chromadb,node_neo4j toneAmber
class node_ai,node_tools,node_vector,node_graphservice toneMint
class node_sqlite,node_config,node_seed toneRose
class node_student,node_ollama toneIndigo
```

## Components

### Student interface

- [Page navigation](https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/App.tsx): `src/App.tsx`
- [Ask AI](https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/pages/AskAI.tsx): `src/pages/AskAI.tsx`
- [Dashboard](https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Knowledge graph view](https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/pages/KnowledgeGraph.tsx): `src/pages/KnowledgeGraph.tsx`
- [REST client](https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/services/api.ts): `src/services/api.ts`
- [Health status](https://github.com/vaishnavi14k/uniassist-ai/blob/main/src/services/useHealth.ts): `src/services/useHealth.ts`

### API and orchestration

- [FastAPI app](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Query endpoint](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/routes/queries.py): `backend/app/routes/queries.py`
- [Stats endpoints](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/routes/stats.py): `backend/app/routes/stats.py`
- [Health endpoint](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/routes/health.py): `backend/app/routes/health.py`
- [Query workflow](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/ai/workflow.py): `backend/app/ai/workflow.py`

### Query intelligence

- [LLM analysis and response](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/ai/service.py): `backend/app/ai/service.py`
- [MCP data tools](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/mcp/tools.py): `backend/app/mcp/tools.py`
- [Similarity search](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/vector/store.py): `backend/app/vector/store.py`
- [Department and entity lookup](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/graph/service.py): `backend/app/graph/service.py`

### Campus data

- [SQLite records](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/models.py): `backend/app/models.py`
- [Runtime configuration](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/config.py): `backend/app/config.py`
- [Initial data seeding](https://github.com/vaishnavi14k/uniassist-ai/blob/main/backend/app/seed.py): `backend/app/seed.py`

### Other components

- **Student**
- **Ollama**
- **ChromaDB**
- **Neo4j**

## Connections

- Student → Ask AI: submits question (evidence: `README.md`)
- Page navigation → Ask AI: renders (evidence: `src/App.tsx`)
- Page navigation → Dashboard: renders (evidence: `src/App.tsx`)
- Page navigation → Knowledge graph view: renders (evidence: `src/App.tsx`)
- Ask AI → REST client: submits query (evidence: `src/pages/AskAI.tsx`)
- Dashboard → REST client: loads stats (evidence: `src/pages/Dashboard.tsx`)
- Dashboard → Health status: uses (evidence: `src/pages/Dashboard.tsx`)
- Health status → REST client: checks health (evidence: `src/services/useHealth.ts`)
- Knowledge graph view → REST client: loads graph (evidence: `src/pages/KnowledgeGraph.tsx`)
- REST client → FastAPI app: HTTP requests (evidence: `README.md`)
- FastAPI app → Query endpoint: registers route (evidence: `backend/app/main.py`)
- FastAPI app → Stats endpoints: registers route (evidence: `backend/app/main.py`)
- FastAPI app → Health endpoint: registers route (evidence: `backend/app/main.py`)
- Query endpoint → Query workflow: runs workflow (evidence: `backend/app/routes/queries.py`)
- Query workflow → LLM analysis and response: invokes (evidence: `backend/app/ai/workflow.py`)
- Query workflow → MCP data tools: calls tools (evidence: `backend/app/ai/workflow.py`)
- LLM analysis and response → Ollama: invokes model (evidence: `backend/app/ai/service.py`)
- MCP data tools → Similarity search: searches and adds (evidence: `backend/app/mcp/tools.py`)
- MCP data tools → Department and entity lookup: queries graph (evidence: `backend/app/mcp/tools.py`)
- Department and entity lookup → Neo4j: runs Cypher (evidence: `backend/app/graph/service.py`)
- Similarity search → ChromaDB: searches and stores (evidence: `backend/app/vector/store.py`)
- MCP data tools → SQLite records: persists query (evidence: `backend/app/mcp/tools.py`)
- Stats endpoints → SQLite records: reads records (evidence: `backend/app/routes/stats.py`)
- FastAPI app → Initial data seeding: seeds startup data (evidence: `backend/app/main.py`)
- Initial data seeding → Similarity search: seeds vectors (evidence: `backend/app/seed.py`)
- Initial data seeding → SQLite records: seeds records (evidence: `backend/app/seed.py`)
- FastAPI app → Department and entity lookup: seeds and closes (evidence: `backend/app/main.py`)
- Runtime configuration → LLM analysis and response: configures model (evidence: `backend/app/ai/service.py`)
- Runtime configuration → Similarity search: configures store (evidence: `backend/app/vector/store.py`)
- Runtime configuration → Department and entity lookup: configures connection (evidence: `backend/app/graph/service.py`)
- Health endpoint → LLM analysis and response: checks availability (evidence: `backend/app/routes/health.py`)
- Health endpoint → Similarity search: checks availability (evidence: `backend/app/routes/health.py`)
- Health endpoint → Department and entity lookup: checks availability (evidence: `backend/app/routes/health.py`)
