# narendrareddy07/ai-data-processor-api architecture

> Architecture diagram of the GitHub repository narendrareddy07/ai-data-processor-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/narendrareddy07/ai-data-processor-api
- Repository: https://github.com/narendrareddy07/ai-data-processor-api

## Overview

A small FastAPI text-processing service accepts and validates text, cleans it, extracts keywords, and stores records in memory. Clients can list or fetch records, then request cached analysis containing a simple summary and keyword-based insight. The implementation is concentrated in main.py; the README documents the endpoints and behavior, while the source excerpt shows the function calls and state access. The graph omits framework internals and represents the API handlers as the service entry points.

Main entry points: [`main.py`](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py) (Data API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_data_api["Data API<br/>[main.py]"]
  node_input_model["Input Validation<br/>[main.py]"]
  node_ingestion["Create Record<br/>[main.py]"]
  node_retrieval["Data Retrieval<br/>[main.py]"]
  node_analysis_api["Analysis Endpoint<br/>[main.py]"]
end

subgraph group_processing["Text Processing"]
  node_cleaning["Text Cleaning<br/>[main.py]"]
  node_keywords["Keyword Extraction<br/>[main.py]"]
  node_summary["Summary Generation<br/>[main.py]"]
  node_insights["Insight Generation<br/>[main.py]"]
end

subgraph group_state["Record State"]
  node_database[("In-Memory Records<br/>[main.py]")]
end

node_client(("API Client"))

node_client -->|"sends requests"| node_data_api
node_data_api -->|"validates input"| node_input_model
node_data_api -->|"routes create"| node_ingestion
node_data_api -->|"routes reads"| node_retrieval
node_data_api -->|"routes analysis"| node_analysis_api
node_ingestion -->|"cleans text"| node_cleaning
node_ingestion -->|"extracts keywords"| node_keywords
node_ingestion -->|"writes record"| node_database
node_retrieval -->|"reads records"| node_database
node_analysis_api -->|"reads and updates"| node_database
node_analysis_api -->|"generates summary"| node_summary
node_analysis_api -->|"generates insight"| node_insights

click node_data_api "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py"
click node_input_model "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py"
click node_ingestion "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py"
click node_retrieval "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py"
click node_analysis_api "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py"
click node_cleaning "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py"
click node_keywords "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py"
click node_summary "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py"
click node_insights "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py"
click node_database "https://github.com/narendrareddy07/ai-data-processor-api/blob/main/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_data_api,node_input_model,node_ingestion,node_retrieval,node_analysis_api,node_client toneBlue
class node_cleaning,node_keywords,node_summary,node_insights toneAmber
class node_database toneMint
```

## Components

### API

- [Data API](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`
- [Input Validation](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`
- [Create Record](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`
- [Data Retrieval](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`
- [Analysis Endpoint](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`

### Text Processing

- [Text Cleaning](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`
- [Keyword Extraction](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`
- [Summary Generation](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`
- [Insight Generation](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`

### Record State

- [In-Memory Records](https://github.com/narendrareddy07/ai-data-processor-api/blob/main/main.py): `main.py`

### Other components

- **API Client**

## Connections

- API Client → Data API: sends requests (evidence: `README.md`)
- Data API → Input Validation: validates input (evidence: `main.py`)
- Data API → Create Record: routes create (evidence: `main.py`)
- Data API → Data Retrieval: routes reads (evidence: `main.py`)
- Data API → Analysis Endpoint: routes analysis (evidence: `main.py`)
- Create Record → Text Cleaning: cleans text (evidence: `main.py`)
- Create Record → Keyword Extraction: extracts keywords (evidence: `main.py`)
- Create Record → In-Memory Records: writes record (evidence: `main.py`)
- Data Retrieval → In-Memory Records: reads records (evidence: `main.py`)
- Analysis Endpoint → In-Memory Records: reads and updates (evidence: `main.py`)
- Analysis Endpoint → Summary Generation: generates summary (evidence: `main.py`)
- Analysis Endpoint → Insight Generation: generates insight (evidence: `main.py`)
