# nithinnayakgugloth-creator/agentnithin architecture

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

- Interactive diagram: https://gitdiagram.com/nithinnayakgugloth-creator/agentnithin
- Repository: https://github.com/nithinnayakgugloth-creator/agentnithin

## Overview

agentnithin is a small FastAPI service exposing a restricted Indian weather-and-cinema assistant. A request reaches the `/agent` route, is normalized into agent messages, processed by a Gemini-backed tool-using agent, then reduced to text. The tools provide local movie lookup and temperature conversion, plus weather lookup through Open-Meteo. The graph reflects the single sampled runtime file; external service calls are visible there, while framework-internal routing details are not expanded.

Main entry points: [`app.py`](https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py) (Restricted agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP interface"]
  node_route["Agent route<br/>[app.py]"]
end

subgraph group_agent["Agent workflow"]
  node_input["Input formatter<br/>[app.py]"]
  node_agent_runtime["Restricted agent<br/>[app.py]"]
  node_response["Text extractor<br/>[app.py]"]
end

subgraph group_tools["Assistant tools"]
  node_weather_tool["Weather lookup<br/>[app.py]"]
  node_movie_tool["Movie search<br/>[app.py]"]
  node_temperature_tool["Temperature conversion<br/>[app.py]"]
end

node_user(("API caller"))
node_gemini["Gemini model"]
node_geocoding["Open-Meteo geocoding"]
node_forecast["Open-Meteo forecast"]

node_user -->|"sends request"| node_route
node_route -->|"invokes chain"| node_input
node_input -->|"formats input"| node_agent_runtime
node_agent_runtime -->|"uses model"| node_gemini
node_agent_runtime -->|"dispatches tool"| node_weather_tool
node_agent_runtime -->|"dispatches tool"| node_movie_tool
node_agent_runtime -->|"dispatches tool"| node_temperature_tool
node_agent_runtime -->|"passes output"| node_response
node_weather_tool -->|"requests location"| node_geocoding
node_weather_tool -->|"requests forecast"| node_forecast

click node_route "https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py"
click node_input "https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py"
click node_agent_runtime "https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py"
click node_response "https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py"
click node_weather_tool "https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py"
click node_movie_tool "https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py"
click node_temperature_tool "https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.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_route toneBlue
class node_input,node_agent_runtime,node_response toneAmber
class node_weather_tool,node_movie_tool,node_temperature_tool,node_user toneMint
class node_gemini,node_geocoding,node_forecast toneIndigo
```

## Components

### HTTP interface

- [Agent route](https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py): `app.py`

### Agent workflow

- [Input formatter](https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py): `app.py`
- [Restricted agent](https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py): `app.py`
- [Text extractor](https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py): `app.py`

### Assistant tools

- [Weather lookup](https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py): `app.py`
- [Movie search](https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py): `app.py`
- [Temperature conversion](https://github.com/nithinnayakgugloth-creator/agentnithin/blob/main/app.py): `app.py`

### Other components

- **API caller**
- **Gemini model**
- **Open-Meteo geocoding**
- **Open-Meteo forecast**

## Connections

- API caller → Agent route: sends request (evidence: `app.py`)
- Agent route → Input formatter: invokes chain (evidence: `app.py`)
- Input formatter → Restricted agent: formats input (evidence: `app.py`)
- Restricted agent → Gemini model: uses model (evidence: `app.py`)
- Restricted agent → Weather lookup: dispatches tool (evidence: `app.py`)
- Restricted agent → Movie search: dispatches tool (evidence: `app.py`)
- Restricted agent → Temperature conversion: dispatches tool (evidence: `app.py`)
- Restricted agent → Text extractor: passes output (evidence: `app.py`)
- Weather lookup → Open-Meteo geocoding: requests location (evidence: `app.py`)
- Weather lookup → Open-Meteo forecast: requests forecast (evidence: `app.py`)
