# angelmendoz/sog2-2s26_grupo8 architecture

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

- Interactive diagram: https://gitdiagram.com/angelmendoz/sog2-2s26_grupo8
- Repository: https://github.com/angelmendoz/sog2-2s26_grupo8

## Overview

Practica_1 is a PostgreSQL sales-analysis project with a conversational interface: users ask the local web agent questions, which are handled by analysis tools and returned as structured results or charts. Its analysis stages cover exploration, trends, customer segmentation, correlation, and visual summaries. The sampled code shows MCP tool dispatch and the agent’s native chart-artifact path. The tree also contains a separate RPA project, but its runtime wiring was not excerpted, so its relationships are not inferred here.

Main entry points: [`Practica_1/app/analisis/punto_02.py`](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_02.py) (Exploratory analysis), [`Practica_1/app/mcp_server.py`](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/mcp_server.py) (MCP server), [`Practica_1/app/main.py`](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/main.py) (Agent web app), [`Practica_1/app/ventas_agent/agent.py`](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/ventas_agent/agent.py) (Sales agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interface"]
  node_web["Agent web app<br/>[main.py]"]
  node_agent["Sales agent<br/>[agent.py]"]
  node_mcp["MCP server<br/>[mcp_server.py]"]
  node_sessions[("Session store")]
end

subgraph group_tools["Analysis tools"]
  node_tool02["Exploration tools<br/>[punto_02.py]"]
  node_tool03["Trend tools<br/>[punto_03.py]"]
  node_tool04["Segmentation tools<br/>[punto_04.py]"]
  node_tool05["Correlation tools<br/>[punto_05.py]"]
  node_tool06["Finding tools<br/>[punto_06.py]"]
end

subgraph group_analysis["Sales analysis"]
  node_config["Shared config<br/>[config.py]"]
  node_explore["Exploratory analysis<br/>[punto_02.py]"]
  node_trends["Trend analysis<br/>[punto_03.py]"]
  node_segments["Customer segments<br/>[punto_04.py]"]
  node_correlations["Correlation analysis<br/>[punto_05.py]"]
  node_visuals["Finding visuals<br/>[punto_06.py]"]
end

node_user(("Analyst"))
node_postgres[("PostgreSQL")]

node_user -->|"asks"| node_web
node_web -->|"serves"| node_agent
node_web -->|"stores sessions"| node_sessions
node_agent -->|"uses tools"| node_tool02
node_agent -->|"uses tools"| node_tool06
node_mcp -->|"dispatches"| node_tool02
node_mcp -->|"dispatches"| node_tool03
node_mcp -->|"dispatches"| node_tool04
node_mcp -->|"dispatches"| node_tool05
node_mcp -->|"dispatches"| node_tool06
node_tool02 -->|"calls"| node_explore
node_tool03 -->|"calls"| node_trends
node_tool04 -->|"calls"| node_segments
node_tool05 -->|"calls"| node_correlations
node_tool06 -->|"reads findings"| node_visuals
node_tool03 -->|"loads data"| node_explore
node_tool04 -->|"loads data"| node_explore
node_tool05 -->|"loads data"| node_explore
node_visuals -->|"uses distributions"| node_explore
node_visuals -->|"uses correlations"| node_correlations
node_explore -->|"queries"| node_postgres
node_web -->|"loads settings"| node_config

click node_web "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/main.py"
click node_agent "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/ventas_agent/agent.py"
click node_mcp "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/mcp_server.py"
click node_tool02 "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_02.py"
click node_tool03 "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_03.py"
click node_tool04 "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_04.py"
click node_tool05 "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_05.py"
click node_tool06 "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_06.py"
click node_config "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/config.py"
click node_explore "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_02.py"
click node_trends "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_03.py"
click node_segments "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_04.py"
click node_correlations "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_05.py"
click node_visuals "https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_06.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_web,node_agent,node_mcp,node_sessions toneBlue
class node_tool02,node_tool03,node_tool04,node_tool05,node_tool06,node_postgres toneAmber
class node_config,node_explore,node_trends,node_segments,node_correlations,node_visuals toneMint
class node_user toneIndigo
```

## Components

### User interface

- [Agent web app](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/main.py): `Practica_1/app/main.py`
- [Sales agent](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/ventas_agent/agent.py): `Practica_1/app/ventas_agent/agent.py`
- [MCP server](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/mcp_server.py): `Practica_1/app/mcp_server.py`
- **Session store**

### Analysis tools

- [Exploration tools](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_02.py): `Practica_1/app/herramientas/punto_02.py`
- [Trend tools](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_03.py): `Practica_1/app/herramientas/punto_03.py`
- [Segmentation tools](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_04.py): `Practica_1/app/herramientas/punto_04.py`
- [Correlation tools](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_05.py): `Practica_1/app/herramientas/punto_05.py`
- [Finding tools](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/herramientas/punto_06.py): `Practica_1/app/herramientas/punto_06.py`

### Sales analysis

- [Shared config](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/config.py): `Practica_1/app/config.py`
- [Exploratory analysis](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_02.py): `Practica_1/app/analisis/punto_02.py`
- [Trend analysis](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_03.py): `Practica_1/app/analisis/punto_03.py`
- [Customer segments](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_04.py): `Practica_1/app/analisis/punto_04.py`
- [Correlation analysis](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_05.py): `Practica_1/app/analisis/punto_05.py`
- [Finding visuals](https://github.com/angelmendoz/sog2-2s26_grupo8/blob/main/Practica_1/app/analisis/punto_06.py): `Practica_1/app/analisis/punto_06.py`

### Other components

- **Analyst**
- **PostgreSQL**

## Connections

- Analyst → Agent web app: asks (evidence: `Practica_1/app/main.py`)
- Agent web app → Sales agent: serves (evidence: `Practica_1/app/main.py`)
- Agent web app → Session store: stores sessions (evidence: `Practica_1/app/main.py`)
- Sales agent → Exploration tools: uses tools (evidence: `Practica_1/app/ventas_agent/agent.py`)
- Sales agent → Finding tools: uses tools (evidence: `Practica_1/app/ventas_agent/agent.py`)
- MCP server → Exploration tools: dispatches (evidence: `Practica_1/app/mcp_server.py`)
- MCP server → Trend tools: dispatches (evidence: `Practica_1/app/mcp_server.py`)
- MCP server → Segmentation tools: dispatches (evidence: `Practica_1/app/mcp_server.py`)
- MCP server → Correlation tools: dispatches (evidence: `Practica_1/app/mcp_server.py`)
- MCP server → Finding tools: dispatches (evidence: `Practica_1/app/mcp_server.py`)
- Exploration tools → Exploratory analysis: calls (evidence: `Practica_1/app/herramientas/punto_02.py`)
- Trend tools → Trend analysis: calls (evidence: `Practica_1/app/herramientas/punto_03.py`)
- Segmentation tools → Customer segments: calls (evidence: `Practica_1/app/herramientas/punto_04.py`)
- Correlation tools → Correlation analysis: calls (evidence: `Practica_1/app/herramientas/punto_05.py`)
- Finding tools → Finding visuals: reads findings (evidence: `Practica_1/app/herramientas/punto_06.py`)
- Trend tools → Exploratory analysis: loads data (evidence: `Practica_1/app/herramientas/punto_03.py`)
- Segmentation tools → Exploratory analysis: loads data (evidence: `Practica_1/app/herramientas/punto_04.py`)
- Correlation tools → Exploratory analysis: loads data (evidence: `Practica_1/app/herramientas/punto_05.py`)
- Finding visuals → Exploratory analysis: uses distributions (evidence: `Practica_1/app/analisis/punto_06.py`)
- Finding visuals → Correlation analysis: uses correlations (evidence: `Practica_1/app/analisis/punto_06.py`)
- Exploratory analysis → PostgreSQL: queries (evidence: `Practica_1/app/analisis/punto_02.py`)
- Agent web app → Shared config: loads settings (evidence: `Practica_1/app/main.py`)
