# harikrishna-9133/campusconnect-support-agent architecture

> Architecture diagram of the GitHub repository harikrishna-9133/campusconnect-support-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harikrishna-9133/campusconnect-support-agent
- Repository: https://github.com/harikrishna-9133/campusconnect-support-agent

## Overview

CampusConnect is a customer-support chatbot with Flask and Streamlit interfaces. Users submit a question; the agent consults the Groq model, which can request FAQ or policy lookup, ticket creation, or escalation tools, and the interface presents the response. Conversation context is maintained during interaction, while tickets and escalation records persist in SQLite. The README documents both interfaces and the major support capabilities. Edges reflect the provided source excerpts or README; the database is created at runtime, and no email or human-notification integration is shown.

Main entry points: [`agent.py`](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/agent.py) (Agent loop), [`app.py`](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/app.py) (Flask API), [`static/script.js`](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/static/script.js) (Browser chat), [`streamlit_app.py`](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/streamlit_app.py) (Streamlit chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Chat interfaces"]
  node_browser["Browser chat<br/>[script.js]"]
  node_flask["Flask API<br/>[app.py]"]
  node_streamlit["Streamlit chat<br/>[streamlit_app.py]"]
  node_template["Chat page<br/>[index.html]"]
end

subgraph group_agent["Agent orchestration"]
  node_agent_core["Agent loop<br/>[agent.py]"]
  node_memory["Conversation memory<br/>[memory.py]"]
  node_schemas["Tool schemas<br/>[schemas.py]"]
end

subgraph group_support["Support operations"]
  node_tool_dispatch["Tool dispatch<br/>[agent.py]"]
  node_faq_search["FAQ search<br/>[tools.py]"]
  node_policy_lookup["Policy lookup<br/>[tools.py]"]
  node_ticket_creation["Ticket creation<br/>[tools.py]"]
  node_human_escalation["Human escalation<br/>[tools.py]"]
end

subgraph group_data["Content and persistence"]
  node_faqs["FAQ content"]
  node_policies["Policy content<br/>[policies.json]"]
  node_sqlite[("Support database")]
end

node_user(("Support user"))
node_groq["Groq inference"]

node_user -->|"enters question"| node_browser
node_browser -->|"posts chat"| node_flask
node_flask -->|"renders page"| node_template
node_flask -->|"processes message"| node_agent_core
node_user -->|"enters question"| node_streamlit
node_streamlit -->|"processes message"| node_agent_core
node_agent_core -->|"requests completion"| node_groq
node_agent_core -->|"reads and updates"| node_memory
node_agent_core -->|"supplies tool schemas"| node_schemas
node_agent_core -->|"handles tool calls"| node_tool_dispatch
node_tool_dispatch -->|"dispatches search"| node_faq_search
node_tool_dispatch -->|"dispatches lookup"| node_policy_lookup
node_tool_dispatch -->|"dispatches creation"| node_ticket_creation
node_tool_dispatch -->|"dispatches escalation"| node_human_escalation
node_faq_search -->|"reads"| node_faqs
node_policy_lookup -->|"reads"| node_policies
node_ticket_creation -->|"writes ticket"| node_sqlite
node_human_escalation -->|"checks and records"| node_sqlite

click node_browser "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/static/script.js"
click node_flask "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/app.py"
click node_streamlit "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/streamlit_app.py"
click node_template "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/templates/index.html"
click node_agent_core "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/agent.py"
click node_memory "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/memory.py"
click node_schemas "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/schemas.py"
click node_tool_dispatch "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/agent.py"
click node_faq_search "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/tools.py"
click node_policy_lookup "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/tools.py"
click node_ticket_creation "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/tools.py"
click node_human_escalation "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/tools.py"
click node_faqs "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/data/knowledge_base.json"
click node_policies "https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/data/policies.json"
click node_sqlite "https://github.com/harikrishna-9133/campusconnect-support-agent/tree/main/data"

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_browser,node_flask,node_streamlit,node_template,node_user toneBlue
class node_agent_core,node_memory,node_schemas toneAmber
class node_tool_dispatch,node_faq_search,node_policy_lookup,node_ticket_creation,node_human_escalation toneMint
class node_faqs,node_policies,node_sqlite toneRose
class node_groq toneIndigo
```

## Components

### Chat interfaces

- [Browser chat](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/static/script.js): `static/script.js`
- [Flask API](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/app.py): `app.py`
- [Streamlit chat](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/streamlit_app.py): `streamlit_app.py`
- [Chat page](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/templates/index.html): `templates/index.html`

### Agent orchestration

- [Agent loop](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/agent.py): `agent.py`
- [Conversation memory](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/memory.py): `memory.py`
- [Tool schemas](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/schemas.py): `schemas.py`

### Support operations

- [Tool dispatch](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/agent.py): `agent.py`
- [FAQ search](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/tools.py): `tools.py`
- [Policy lookup](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/tools.py): `tools.py`
- [Ticket creation](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/tools.py): `tools.py`
- [Human escalation](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/tools.py): `tools.py`

### Content and persistence

- [FAQ content](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/data/knowledge_base.json): `data/knowledge_base.json`
- [Policy content](https://github.com/harikrishna-9133/campusconnect-support-agent/blob/main/data/policies.json): `data/policies.json`
- [Support database](https://github.com/harikrishna-9133/campusconnect-support-agent/tree/main/data): `data`

### Other components

- **Support user**
- **Groq inference**

## Connections

- Support user → Browser chat: enters question (evidence: `static/script.js`)
- Browser chat → Flask API: posts chat (evidence: `static/script.js`)
- Flask API → Chat page: renders page (evidence: `app.py`)
- Flask API → Agent loop: processes message (evidence: `app.py`)
- Support user → Streamlit chat: enters question (evidence: `README.md`)
- Streamlit chat → Agent loop: processes message (evidence: `streamlit_app.py`)
- Agent loop → Groq inference: requests completion (evidence: `agent.py`)
- Agent loop → Conversation memory: reads and updates (evidence: `agent.py`)
- Agent loop → Tool schemas: supplies tool schemas (evidence: `agent.py`)
- Agent loop → Tool dispatch: handles tool calls (evidence: `agent.py`)
- Tool dispatch → FAQ search: dispatches search (evidence: `agent.py`)
- Tool dispatch → Policy lookup: dispatches lookup (evidence: `agent.py`)
- Tool dispatch → Ticket creation: dispatches creation (evidence: `agent.py`)
- Tool dispatch → Human escalation: dispatches escalation (evidence: `agent.py`)
- FAQ search → FAQ content: reads (evidence: `tools.py`)
- Policy lookup → Policy content: reads (evidence: `tools.py`)
- Ticket creation → Support database: writes ticket (evidence: `tools.py`)
- Human escalation → Support database: checks and records (evidence: `tools.py`)
