# hungvv109/student-laziness-kg-multi-agent architecture

> Architecture diagram of the GitHub repository hungvv109/student-laziness-kg-multi-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hungvv109/student-laziness-kg-multi-agent
- Repository: https://github.com/hungvv109/student-laziness-kg-multi-agent

## Overview

This is a Streamlit school-counseling assistant: a student submits a concern, a LangGraph workflow routes it, and the app returns a conversational or graph-grounded counseling response. The graph distinguishes intent routing, query generation, Neo4j retrieval, and response generation. The sampled source implements these stages together in one file; the README documents the Neo4j graph setup. Future improvements are not represented as existing runtime components.

Main entry points: [`src/graph_agent.py`](https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py) (LangGraph app), [`database/graph_study.cypher`](https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/database/graph_study.cypher) (Graph setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Chat interface"]
  node_chat["Streamlit chat<br/>[graph_agent.py]"]
end

subgraph group_workflow["Agent workflow"]
  node_workflow_app["LangGraph app<br/>[graph_agent.py]"]
  node_router["Intent router<br/>[graph_agent.py]"]
  node_cypher["Cypher generator<br/>[graph_agent.py]"]
  node_executor["Graph executor<br/>[graph_agent.py]"]
  node_counselor["Counselor<br/>[graph_agent.py]"]
end

subgraph group_knowledge["Knowledge services"]
  node_gemini["Google Gemini"]
  node_neo4j[("Neo4j graph")]
  node_graph_setup["Graph setup<br/>[graph_study.cypher]"]
end

node_student(("Student"))

node_student -->|"submits concern"| node_chat
node_chat -->|"invokes workflow"| node_workflow_app
node_workflow_app -->|"dispatches"| node_router
node_router -->|"classifies intent"| node_gemini
node_router -->|"returns intent"| node_workflow_app
node_workflow_app -->|"dispatches GRAPH"| node_cypher
node_workflow_app -->|"dispatches CHAT"| node_counselor
node_cypher -->|"generates query"| node_gemini
node_cypher -->|"returns query"| node_workflow_app
node_workflow_app -->|"dispatches query"| node_executor
node_executor -->|"executes Cypher"| node_neo4j
node_neo4j -->|"returns records"| node_executor
node_executor -->|"returns graph data"| node_workflow_app
node_workflow_app -->|"dispatches graph result"| node_counselor
node_counselor -->|"generates response"| node_gemini
node_counselor -->|"returns response"| node_workflow_app
node_workflow_app -->|"returns result"| node_chat
node_chat -->|"shows response"| node_student
node_graph_setup -->|"creates graph data"| node_neo4j

click node_chat "https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py"
click node_workflow_app "https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py"
click node_router "https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py"
click node_cypher "https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py"
click node_executor "https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py"
click node_counselor "https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py"
click node_graph_setup "https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/database/graph_study.cypher"

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_chat toneBlue
class node_workflow_app,node_router,node_cypher,node_executor,node_counselor toneAmber
class node_gemini,node_neo4j,node_graph_setup toneMint
class node_student toneIndigo
```

## Components

### Chat interface

- [Streamlit chat](https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py): `src/graph_agent.py`

### Agent workflow

- [LangGraph app](https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py): `src/graph_agent.py`
- [Intent router](https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py): `src/graph_agent.py`
- [Cypher generator](https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py): `src/graph_agent.py`
- [Graph executor](https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py): `src/graph_agent.py`
- [Counselor](https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/src/graph_agent.py): `src/graph_agent.py`

### Knowledge services

- **Google Gemini**
- **Neo4j graph**
- [Graph setup](https://github.com/hungvv109/student-laziness-kg-multi-agent/blob/main/database/graph_study.cypher): `database/graph_study.cypher`

### Other components

- **Student**

## Connections

- Student → Streamlit chat: submits concern
- Streamlit chat → LangGraph app: invokes workflow
- LangGraph app → Intent router: dispatches
- Intent router → Google Gemini: classifies intent
- Intent router → LangGraph app: returns intent
- LangGraph app → Cypher generator: dispatches GRAPH
- LangGraph app → Counselor: dispatches CHAT
- Cypher generator → Google Gemini: generates query
- Cypher generator → LangGraph app: returns query
- LangGraph app → Graph executor: dispatches query
- Graph executor → Neo4j graph: executes Cypher
- Neo4j graph → Graph executor: returns records
- Graph executor → LangGraph app: returns graph data
- LangGraph app → Counselor: dispatches graph result
- Counselor → Google Gemini: generates response
- Counselor → LangGraph app: returns response
- LangGraph app → Streamlit chat: returns result
- Streamlit chat → Student: shows response
- Graph setup → Neo4j graph: creates graph data
