# avinavkumar0045/local-admission-agentops architecture

> Architecture diagram of the GitHub repository avinavkumar0045/local-admission-agentops, 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/avinavkumar0045/local-admission-agentops
- Repository: https://github.com/avinavkumar0045/local-admission-agentops

## Overview

AgentOps is a local admission-question RAG application with a parallel observability path. A student asks in Streamlit; FastAPI validates, retrieves evidence from FAISS, generates a grounded answer through local Qwen/Ollama, and returns answer plus sources. Separately, OpenTelemetry spans and a legacy MySQL tracker support trace exploration, metrics, and failure alerting. The ingestion path builds the vector knowledge base. Core runtime calls are evidenced in excerpts; broader Tempo/Grafana and alert wiring is described by the README, while some deployment details are not inspected.

Main entry points: [`src/agent/api.py`](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/api.py) (Query API), [`src/agentops/telemetry.py`](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agentops/telemetry.py) (Telemetry Tracker), [`src/agent/generator.py`](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/generator.py) (Answer Generation), [`src/agent/retriever.py`](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/retriever.py) (Semantic Retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Student Interaction"]
  node_chat_ui["Chat UI<br/>[app.py]"]
end

subgraph group_rag["Admission RAG"]
  node_query_api["Query API<br/>[api.py]"]
  node_retrieval["Semantic Retrieval<br/>[retriever.py]"]
  node_generation["Answer Generation<br/>[generator.py]"]
  node_prompt_rules["Prompt Rules<br/>[prompts.py]"]
  node_grounding["Grounding &amp; Explanation<br/>[api.py]"]
end

subgraph group_knowledge["Knowledge Base"]
  node_embedding["Document Ingestion<br/>[ingest.py]"]
  node_source_docs["Admission Documents"]
  node_vector_store[("FAISS Knowledge Store")]
end

subgraph group_observability["AgentOps Observability"]
  node_settings["Runtime Settings<br/>[config.py]"]
  node_telemetry["Telemetry Tracker<br/>[telemetry.py]"]
end

subgraph group_operations["Trace Operations"]
  node_otel_collector{{"OTel Collector"}}
  node_tempo[("Tempo Traces")]
  node_mysql[("MySQL Metrics")]
  node_grafana["Grafana Explorer"]
  node_webhook["Failure Webhook"]
end

node_student(("Student"))
node_alert_team(("Engineering Team"))

node_student -->|"asks question"| node_chat_ui
node_chat_ui -->|"posts query"| node_query_api
node_query_api -->|"retrieves context"| node_retrieval
node_retrieval -->|"searches index"| node_vector_store
node_query_api -->|"generates answer"| node_generation
node_generation -->|"builds prompt"| node_prompt_rules
node_generation -->|"exports spans"| node_otel_collector
node_generation -->|"records spans"| node_mysql
node_query_api -->|"validates evidence"| node_grounding
node_grounding -->|"returns answer"| node_chat_ui
node_embedding -->|"reads documents"| node_source_docs
node_embedding -->|"writes index"| node_vector_store
node_retrieval -->|"emits spans"| node_telemetry
node_query_api -->|"records lifecycle"| node_telemetry
node_telemetry -->|"exports traces"| node_otel_collector
node_telemetry -->|"writes metrics"| node_mysql
node_otel_collector -.->|"forwards traces"| node_tempo
node_grafana -.->|"explores traces"| node_tempo
node_grafana -.->|"queries metrics"| node_mysql
node_grafana -.->|"routes failures"| node_webhook
node_webhook -.->|"sends alert"| node_alert_team
node_query_api -->|"reads toggle"| node_settings
node_telemetry -->|"loads configuration"| node_settings

click node_chat_ui "https://github.com/avinavkumar0045/local-admission-agentops/blob/main/ui/app.py"
click node_query_api "https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/api.py"
click node_retrieval "https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/retriever.py"
click node_generation "https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/generator.py"
click node_prompt_rules "https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/prompts.py"
click node_grounding "https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/api.py"
click node_embedding "https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/ingest.py"
click node_source_docs "https://github.com/avinavkumar0045/local-admission-agentops/tree/main/data/raw"
click node_vector_store "https://github.com/avinavkumar0045/local-admission-agentops/tree/main/data/vector_store"
click node_settings "https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/config.py"
click node_telemetry "https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agentops/telemetry.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_chat_ui toneBlue
class node_query_api,node_retrieval,node_generation,node_prompt_rules,node_grounding toneAmber
class node_embedding,node_source_docs,node_vector_store toneMint
class node_settings,node_telemetry toneRose
class node_otel_collector,node_tempo,node_mysql,node_grafana,node_webhook,node_student,node_alert_team toneIndigo
```

## Components

### Student Interaction

- [Chat UI](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/ui/app.py): `ui/app.py`

### Admission RAG

- [Query API](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/api.py): `src/agent/api.py`
- [Semantic Retrieval](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/retriever.py): `src/agent/retriever.py`
- [Answer Generation](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/generator.py): `src/agent/generator.py`
- [Prompt Rules](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/prompts.py): `src/agent/prompts.py`
- [Grounding & Explanation](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/api.py): `src/agent/api.py`

### Knowledge Base

- [Document Ingestion](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agent/ingest.py): `src/agent/ingest.py`
- [Admission Documents](https://github.com/avinavkumar0045/local-admission-agentops/tree/main/data/raw): `data/raw`
- [FAISS Knowledge Store](https://github.com/avinavkumar0045/local-admission-agentops/tree/main/data/vector_store): `data/vector_store`

### AgentOps Observability

- [Runtime Settings](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/config.py): `src/config.py`
- [Telemetry Tracker](https://github.com/avinavkumar0045/local-admission-agentops/blob/main/src/agentops/telemetry.py): `src/agentops/telemetry.py`

### Trace Operations

- **OTel Collector**
- **Tempo Traces**
- **MySQL Metrics**
- **Grafana Explorer**
- **Failure Webhook**

### Other components

- **Student**
- **Engineering Team**

## Connections

- Student → Chat UI: asks question (evidence: `README.md`)
- Chat UI → Query API: posts query (evidence: `ui/app.py`)
- Query API → Semantic Retrieval: retrieves context (evidence: `src/agent/api.py`)
- Semantic Retrieval → FAISS Knowledge Store: searches index (evidence: `src/agent/retriever.py`)
- Query API → Answer Generation: generates answer (evidence: `src/agent/api.py`)
- Answer Generation → Prompt Rules: builds prompt (evidence: `src/agent/generator.py`)
- Answer Generation → OTel Collector: exports spans
- Answer Generation → MySQL Metrics: records spans
- Query API → Grounding & Explanation: validates evidence (evidence: `src/agent/api.py`)
- Grounding & Explanation → Chat UI: returns answer (evidence: `src/agent/api.py`)
- Document Ingestion → Admission Documents: reads documents (evidence: `src/agent/ingest.py`)
- Document Ingestion → FAISS Knowledge Store: writes index (evidence: `src/agent/ingest.py`)
- Semantic Retrieval → Telemetry Tracker: emits spans (evidence: `src/agent/retriever.py`)
- Query API → Telemetry Tracker: records lifecycle (evidence: `src/agent/api.py`)
- Telemetry Tracker → OTel Collector: exports traces (evidence: `src/agentops/telemetry.py`)
- Telemetry Tracker → MySQL Metrics: writes metrics (evidence: `src/agentops/telemetry.py`)
- OTel Collector → Tempo Traces: forwards traces (evidence: `README.md`)
- Grafana Explorer → Tempo Traces: explores traces (evidence: `README.md`)
- Grafana Explorer → MySQL Metrics: queries metrics (evidence: `README.md`)
- Grafana Explorer → Failure Webhook: routes failures (evidence: `README.md`)
- Failure Webhook → Engineering Team: sends alert (evidence: `README.md`)
- Query API → Runtime Settings: reads toggle (evidence: `src/agent/api.py`)
- Telemetry Tracker → Runtime Settings: loads configuration (evidence: `src/agentops/telemetry.py`)
