# venkateswarareddy-b/ai-tool-assistant architecture

> Architecture diagram of the GitHub repository venkateswarareddy-b/ai-tool-assistant, 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/venkateswarareddy-b/ai-tool-assistant
- Repository: https://github.com/venkateswarareddy-b/ai-tool-assistant

## Overview

AI Tool Assistant is a React chat interface backed by a FastAPI service. Users submit a question or select a suggested tool; the backend asks Groq to answer or choose a tool, runs the selected tool, and returns an answer with tool results for display. The README documents weather, currency, Wikipedia, calculator, news, and location capabilities. Tool implementations and orchestration share backend/main.py; unsampled details are represented only where documented, and the shown source does not establish storage.

Main entry points: [`backend/main.py`](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py) (Tool registry), [`frontend/src/App.jsx`](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/App.jsx) (Chat app), [`frontend/src/components/Sidebar.jsx`](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/components/Sidebar.jsx) (Tool sidebar), [`frontend/src/components/ToolCard.jsx`](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/components/ToolCard.jsx) (Tool cards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Chat interface"]
  node_app["Chat app<br/>[App.jsx]"]
  node_sidebar["Tool sidebar<br/>[Sidebar.jsx]"]
  node_toolcard["Tool cards<br/>[ToolCard.jsx]"]
  node_chatmessage["Chat messages<br/>[ChatMessage.jsx]"]
end

subgraph group_api["Chat API"]
  node_api["Chat endpoint<br/>[main.py]"]
  node_registry["Tool registry<br/>[main.py]"]
end

subgraph group_tools["Assistant tools"]
  node_weather["Weather lookup<br/>[main.py]"]
  node_currency["Currency conversion<br/>[main.py]"]
  node_wiki["Wikipedia search<br/>[main.py]"]
  node_calculator["Calculator<br/>[main.py]"]
  node_news["News lookup<br/>[main.py]"]
  node_location["Location lookup<br/>[main.py]"]
end

subgraph group_services["External services"]
  node_groq{{"Groq model"}}
  node_openweather{{"OpenWeather"}}
  node_frankfurter{{"Frankfurter"}}
  node_wikipedia_service{{"Wikipedia API"}}
  node_newsapi{{"NewsAPI"}}
  node_nominatim{{"Nominatim"}}
end

node_user(("User"))

node_user -->|"submits question"| node_app
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_toolcard
node_app -->|"renders"| node_chatmessage
node_app -->|"posts message"| node_api
node_api -->|"returns answer"| node_app
node_api -->|"requests response"| node_groq
node_api -->|"dispatches tool calls"| node_registry
node_registry -->|"invokes"| node_weather
node_registry -->|"invokes"| node_currency
node_registry -->|"invokes"| node_wiki
node_registry -->|"invokes"| node_calculator
node_registry -->|"invokes"| node_news
node_registry -->|"invokes"| node_location
node_weather -->|"requests weather"| node_openweather
node_currency -->|"requests rates"| node_frankfurter
node_wiki -->|"searches summary"| node_wikipedia_service
node_news -->|"requests articles"| node_newsapi
node_location -->|"searches place"| node_nominatim

click node_app "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/App.jsx"
click node_sidebar "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/components/Sidebar.jsx"
click node_toolcard "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/components/ToolCard.jsx"
click node_chatmessage "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/components/ChatMessage.jsx"
click node_api "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py"
click node_registry "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py"
click node_weather "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py"
click node_currency "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py"
click node_wiki "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py"
click node_calculator "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py"
click node_news "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py"
click node_location "https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.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_app,node_sidebar,node_toolcard,node_chatmessage,node_user toneBlue
class node_api,node_registry toneAmber
class node_weather,node_currency,node_wiki,node_calculator,node_news,node_location toneMint
class node_groq,node_openweather,node_frankfurter,node_wikipedia_service,node_newsapi,node_nominatim toneRose
```

## Components

### Chat interface

- [Chat app](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Tool sidebar](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`
- [Tool cards](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/components/ToolCard.jsx): `frontend/src/components/ToolCard.jsx`
- [Chat messages](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/frontend/src/components/ChatMessage.jsx): `frontend/src/components/ChatMessage.jsx`

### Chat API

- [Chat endpoint](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py): `backend/main.py`
- [Tool registry](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py): `backend/main.py`

### Assistant tools

- [Weather lookup](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py): `backend/main.py`
- [Currency conversion](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py): `backend/main.py`
- [Wikipedia search](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py): `backend/main.py`
- [Calculator](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py): `backend/main.py`
- [News lookup](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py): `backend/main.py`
- [Location lookup](https://github.com/venkateswarareddy-b/ai-tool-assistant/blob/main/backend/main.py): `backend/main.py`

### External services

- **Groq model**
- **OpenWeather**
- **Frankfurter**
- **Wikipedia API**
- **NewsAPI**
- **Nominatim**

### Other components

- **User**

## Connections

- User → Chat app: submits question (evidence: `frontend/src/App.jsx`)
- Chat app → Tool sidebar: renders (evidence: `frontend/src/App.jsx`)
- Chat app → Tool cards: renders (evidence: `frontend/src/App.jsx`)
- Chat app → Chat messages: renders (evidence: `frontend/src/App.jsx`)
- Chat app → Chat endpoint: posts message (evidence: `frontend/src/App.jsx`)
- Chat endpoint → Chat app: returns answer (evidence: `frontend/src/App.jsx`)
- Chat endpoint → Groq model: requests response (evidence: `backend/main.py`)
- Chat endpoint → Tool registry: dispatches tool calls (evidence: `backend/main.py`)
- Tool registry → Weather lookup: invokes (evidence: `backend/main.py`)
- Tool registry → Currency conversion: invokes (evidence: `backend/main.py`)
- Tool registry → Wikipedia search: invokes (evidence: `backend/main.py`)
- Tool registry → Calculator: invokes (evidence: `backend/main.py`)
- Tool registry → News lookup: invokes (evidence: `backend/main.py`)
- Tool registry → Location lookup: invokes (evidence: `backend/main.py`)
- Weather lookup → OpenWeather: requests weather (evidence: `backend/main.py`)
- Currency conversion → Frankfurter: requests rates (evidence: `backend/main.py`)
- Wikipedia search → Wikipedia API: searches summary (evidence: `backend/main.py`)
- News lookup → NewsAPI: requests articles (evidence: `backend/main.py`)
- Location lookup → Nominatim: searches place (evidence: `backend/main.py`)
