# rishithayanidhi/ai_agentic_honeypot_system architecture

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

- Interactive diagram: https://gitdiagram.com/rishithayanidhi/ai_agentic_honeypot_system
- Repository: https://github.com/rishithayanidhi/ai_agentic_honeypot_system

## Overview

This is a FastAPI AI honeypot: incoming scam messages are handled as sessions, assessed for scams, and—when appropriate—answered to sustain a multi-turn engagement. The system also extracts contact/payment intelligence and documents sending completed results to GUVI. The graph preserves those product capabilities, including middleware and LLM integrations. Some main.py sections and subsystem implementations were not sampled, so uncertain wiring is shown only as dashed, unverified links rather than asserted call flow.

Main entry points: [`main.py`](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/main.py) (FastAPI App), [`src/services/ai_agent.py`](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/ai_agent.py) (Engagement Agent), [`src/services/scam_detector.py`](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/scam_detector.py) (Scam Detection), [`config.py`](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/config.py) (Application Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and Security"]
  node_api["FastAPI App<br/>[main.py]"]
  node_middleware["Request Middleware<br/>[__init__.py]"]
  node_settings["Application Settings<br/>[config.py]"]
  node_schemas["API Schemas<br/>[schemas.py]"]
end

subgraph group_conversation["Conversation Runtime"]
  node_sessions["Session Manager<br/>[session_manager.py]"]
  node_sessiondata["Session State<br/>[session.py]"]
  node_agent["Engagement Agent<br/>[ai_agent.py]"]
end

subgraph group_intelligence["Scam Intelligence"]
  node_detector["Scam Detection<br/>[scam_detector.py]"]
  node_extractor["Intelligence Extraction"]
end

subgraph group_integrations["External Integrations"]
  node_callback["GUVI Callback<br/>[guvi_callback.py]"]
end

node_caller(("API Client"))
node_gemini{{"Gemini API"}}
node_anthropic{{"Anthropic API"}}
node_openai{{"OpenAI API"}}
node_guvi{{"GUVI Evaluator"}}

node_caller -->|"sends message"| node_api
node_api -->|"requests detection"| node_detector
node_api -->|"requests reply"| node_agent
node_api -.->|"manages sessions"| node_sessions
node_sessions -->|"stores state"| node_sessiondata
node_api -.->|"extracts intelligence"| node_extractor
node_api -.->|"submits results"| node_callback
node_callback -->|"posts results"| node_guvi
node_detector -.->|"uses provider"| node_gemini
node_detector -.->|"uses provider"| node_anthropic
node_agent -.->|"generates replies"| node_gemini
node_agent -.->|"generates replies"| node_anthropic
node_agent -.->|"optional provider"| node_openai
node_api -.->|"uses middleware"| node_middleware
node_api -.->|"validates requests"| node_schemas
node_detector -->|"reads settings"| node_settings
node_agent -->|"reads settings"| node_settings
node_callback -->|"reads callback config"| node_settings
node_sessions -->|"reads timeout"| node_settings

click node_api "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/main.py"
click node_middleware "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/middleware/__init__.py"
click node_settings "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/config.py"
click node_schemas "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/models/schemas.py"
click node_sessions "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/session_manager.py"
click node_sessiondata "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/models/session.py"
click node_detector "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/scam_detector.py"
click node_extractor "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/utils/intelligence_extractor.py"
click node_agent "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/ai_agent.py"
click node_callback "https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/guvi_callback.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_api,node_middleware,node_settings,node_schemas,node_caller toneBlue
class node_sessions,node_sessiondata,node_agent toneAmber
class node_detector,node_extractor,node_gemini,node_anthropic,node_openai toneMint
class node_callback toneRose
class node_guvi toneIndigo
```

## Components

### API and Security

- [FastAPI App](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/main.py): `main.py`
- [Request Middleware](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/middleware/__init__.py): `src/middleware/__init__.py`
- [Application Settings](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/config.py): `config.py`
- [API Schemas](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/models/schemas.py): `src/models/schemas.py`

### Conversation Runtime

- [Session Manager](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/session_manager.py): `src/services/session_manager.py`
- [Session State](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/models/session.py): `src/models/session.py`
- [Engagement Agent](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/ai_agent.py): `src/services/ai_agent.py`

### Scam Intelligence

- [Scam Detection](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/scam_detector.py): `src/services/scam_detector.py`
- [Intelligence Extraction](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/utils/intelligence_extractor.py): `src/utils/intelligence_extractor.py`

### External Integrations

- [GUVI Callback](https://github.com/rishithayanidhi/ai_agentic_honeypot_system/blob/main/src/services/guvi_callback.py): `src/services/guvi_callback.py`

### Other components

- **API Client**
- **Gemini API**
- **Anthropic API**
- **OpenAI API**
- **GUVI Evaluator**

## Connections

- API Client → FastAPI App: sends message (evidence: `README.md`)
- FastAPI App → Scam Detection: requests detection (evidence: `main.py`)
- FastAPI App → Engagement Agent: requests reply (evidence: `main.py`)
- FastAPI App → Session Manager: manages sessions (evidence: `main.py`)
- Session Manager → Session State: stores state (evidence: `src/services/session_manager.py`)
- FastAPI App → Intelligence Extraction: extracts intelligence (evidence: `main.py`)
- FastAPI App → GUVI Callback: submits results (evidence: `main.py`)
- GUVI Callback → GUVI Evaluator: posts results (evidence: `src/services/guvi_callback.py`)
- Scam Detection → Gemini API: uses provider
- Scam Detection → Anthropic API: uses provider
- Engagement Agent → Gemini API: generates replies
- Engagement Agent → Anthropic API: generates replies
- Engagement Agent → OpenAI API: optional provider
- FastAPI App → Request Middleware: uses middleware (evidence: `main.py`)
- FastAPI App → API Schemas: validates requests (evidence: `main.py`)
- Scam Detection → Application Settings: reads settings (evidence: `src/services/scam_detector.py`)
- Engagement Agent → Application Settings: reads settings (evidence: `src/services/ai_agent.py`)
- GUVI Callback → Application Settings: reads callback config (evidence: `src/services/guvi_callback.py`)
- Session Manager → Application Settings: reads timeout (evidence: `src/services/session_manager.py`)
