# hudsonmathew1910/hero-s-ai architecture

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

- Interactive diagram: https://gitdiagram.com/hudsonmathew1910/hero-s-ai
- Repository: https://github.com/hudsonmathew1910/hero-s-ai

## Overview

Heros is a Django AI assistant platform. Its main workflow routes user requests through backend endpoints and intent handling to Baymax, which produces model-backed responses; chat, account, and API-key state are persisted. Separate branches provide file analysis, web search, Infinsight dataset analytics, and Zuno music actions. The README documents these capabilities, while some implementation files—especially Infinsight views and routing—were not sampled, so those links are marked unverified rather than inferred as established calls.

Main entry points: [`backend/views.py`](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/views.py) (Django Endpoints), [`infinsight/Rag.py`](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/Rag.py) (RAG Workflow), [`backend/hero_model.py`](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/hero_model.py) (Baymax Dispatcher), [`backend/halo.py`](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/halo.py) (Halo Orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User Interaction"]
  node_frontend["Web Interface<br/>[app.js]"]
  node_api["Django Endpoints<br/>[views.py]"]
  node_inf_frontend["Analytics Interface<br/>[inf.js]"]
end

subgraph group_assistant["Assistant Processing"]
  node_intent["Intent Detection<br/>[Nlp.py]"]
  node_dispatcher["Baymax Dispatcher<br/>[hero_model.py]"]
  node_fast["Fast Routing<br/>[fast.py]"]
  node_halo["Halo Orchestrator<br/>[halo.py]"]
  node_web_search["Web Search<br/>[web_search.py]"]
  node_query_rewriter["Query Rewriter<br/>[query_rewriter.py]"]
  node_file_processing["File Processing<br/>[handle_file.py]"]
end

subgraph group_state["Accounts And State"]
  node_accounts[("Account And Chat Data<br/>[models.py]")]
  node_key_security["Key Encryption<br/>[encryption.py]"]
  node_usage["Usage Tracking<br/>[usage_tracker.py]"]
end

subgraph group_analytics["Infinsight Analytics"]
  node_inf_views["Analytics Endpoints<br/>[views.py]"]
  node_rag["RAG Workflow<br/>[Rag.py]"]
  node_parsing["Dataset Parsing<br/>[file_parses.py]"]
  node_embedding["Embedding And Retrieval<br/>[Embedding.py]"]
  node_analysis["Dataset Analysis<br/>[analyst_engine.py]"]
  node_inf_llm["Analytics LLM<br/>[Llm.py]"]
  node_inf_sessions[("Analytics Sessions<br/>[models.py]")]
end

subgraph group_apps["Specialized Apps"]
  node_zuno["Zuno Music Assistant<br/>[views.py]"]
end

node_user(("User"))
node_providers["LLM Providers"]
node_vector_store[("Pinecone")]
node_music_service["YouTube Music"]

node_user -.->|"uses"| node_frontend
node_frontend -.->|"requests"| node_api
node_api -->|"routes intent"| node_intent
node_api -->|"dispatches"| node_dispatcher
node_api -->|"invokes"| node_halo
node_api -->|"reads and writes"| node_accounts
node_api -->|"tracks usage"| node_usage
node_dispatcher -->|"uses routing"| node_fast
node_dispatcher -->|"calls models"| node_providers
node_dispatcher -->|"handles files"| node_file_processing
node_dispatcher -->|"searches web"| node_web_search
node_halo -->|"uses search"| node_web_search
node_halo -->|"rewrites queries"| node_query_rewriter
node_accounts -->|"encrypts fields"| node_key_security
node_inf_frontend -.->|"requests analytics"| node_inf_views
node_inf_views -.->|"runs analytics"| node_rag
node_rag -->|"parses files"| node_parsing
node_rag -->|"embeds chunks"| node_embedding
node_rag -->|"queries model"| node_inf_llm
node_rag -->|"runs analysis"| node_analysis
node_embedding -->|"stores and retrieves"| node_vector_store
node_rag -->|"updates sessions"| node_inf_sessions
node_zuno -->|"uses Baymax"| node_providers
node_zuno -->|"searches tracks"| node_music_service

click node_frontend "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/static/js/app.js"
click node_api "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/views.py"
click node_intent "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/Nlp.py"
click node_dispatcher "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/hero_model.py"
click node_fast "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/fast.py"
click node_halo "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/halo.py"
click node_web_search "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/models_task/web_search.py"
click node_query_rewriter "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/models_task/query_rewriter.py"
click node_file_processing "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/handle_file.py"
click node_accounts "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/models.py"
click node_key_security "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/encryption.py"
click node_usage "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/usage_tracker.py"
click node_inf_frontend "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/static/js/inf.js"
click node_inf_views "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/views.py"
click node_rag "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/Rag.py"
click node_parsing "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/file_parses.py"
click node_embedding "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/Embedding.py"
click node_analysis "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/analyst_engine.py"
click node_inf_llm "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/Llm.py"
click node_inf_sessions "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/models.py"
click node_zuno "https://github.com/hudsonmathew1910/hero-s-ai/blob/main/zuno/views.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_frontend,node_api,node_inf_frontend,node_user toneBlue
class node_intent,node_dispatcher,node_fast,node_halo,node_web_search,node_query_rewriter,node_file_processing,node_vector_store toneAmber
class node_accounts,node_key_security,node_usage toneMint
class node_inf_views,node_rag,node_parsing,node_embedding,node_analysis,node_inf_llm,node_inf_sessions toneRose
class node_zuno,node_providers,node_music_service toneIndigo
```

## Components

### User Interaction

- [Web Interface](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/static/js/app.js): `static/js/app.js`
- [Django Endpoints](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/views.py): `backend/views.py`
- [Analytics Interface](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/static/js/inf.js): `static/js/inf.js`

### Assistant Processing

- [Intent Detection](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/Nlp.py): `backend/Nlp.py`
- [Baymax Dispatcher](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/hero_model.py): `backend/hero_model.py`
- [Fast Routing](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/fast.py): `backend/fast.py`
- [Halo Orchestrator](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/halo.py): `backend/halo.py`
- [Web Search](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/models_task/web_search.py): `backend/models_task/web_search.py`
- [Query Rewriter](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/models_task/query_rewriter.py): `backend/models_task/query_rewriter.py`
- [File Processing](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/handle_file.py): `backend/handle_file.py`

### Accounts And State

- [Account And Chat Data](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/models.py): `backend/models.py`
- [Key Encryption](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/encryption.py): `backend/encryption.py`
- [Usage Tracking](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/backend/usage_tracker.py): `backend/usage_tracker.py`

### Infinsight Analytics

- [Analytics Endpoints](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/views.py): `infinsight/views.py`
- [RAG Workflow](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/Rag.py): `infinsight/Rag.py`
- [Dataset Parsing](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/file_parses.py): `infinsight/file_parses.py`
- [Embedding And Retrieval](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/Embedding.py): `infinsight/Embedding.py`
- [Dataset Analysis](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/analyst_engine.py): `infinsight/analyst_engine.py`
- [Analytics LLM](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/Llm.py): `infinsight/Llm.py`
- [Analytics Sessions](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/infinsight/models.py): `infinsight/models.py`

### Specialized Apps

- [Zuno Music Assistant](https://github.com/hudsonmathew1910/hero-s-ai/blob/main/zuno/views.py): `zuno/views.py`

### Other components

- **User**
- **LLM Providers**
- **Pinecone**
- **YouTube Music**

## Connections

- User → Web Interface: uses
- Web Interface → Django Endpoints: requests
- Django Endpoints → Intent Detection: routes intent (evidence: `backend/views.py`)
- Django Endpoints → Baymax Dispatcher: dispatches (evidence: `backend/views.py`)
- Django Endpoints → Halo Orchestrator: invokes (evidence: `backend/views.py`)
- Django Endpoints → Account And Chat Data: reads and writes (evidence: `backend/views.py`)
- Django Endpoints → Usage Tracking: tracks usage (evidence: `backend/views.py`)
- Baymax Dispatcher → Fast Routing: uses routing (evidence: `backend/hero_model.py`)
- Baymax Dispatcher → LLM Providers: calls models
- Baymax Dispatcher → File Processing: handles files (evidence: `backend/hero_model.py`)
- Baymax Dispatcher → Web Search: searches web (evidence: `backend/hero_model.py`)
- Halo Orchestrator → Web Search: uses search (evidence: `backend/halo.py`)
- Halo Orchestrator → Query Rewriter: rewrites queries (evidence: `backend/halo.py`)
- Account And Chat Data → Key Encryption: encrypts fields (evidence: `backend/models.py`)
- Analytics Interface → Analytics Endpoints: requests analytics
- Analytics Endpoints → RAG Workflow: runs analytics
- RAG Workflow → Dataset Parsing: parses files (evidence: `infinsight/Rag.py`)
- RAG Workflow → Embedding And Retrieval: embeds chunks (evidence: `infinsight/Rag.py`)
- RAG Workflow → Analytics LLM: queries model (evidence: `infinsight/Rag.py`)
- RAG Workflow → Dataset Analysis: runs analysis (evidence: `infinsight/Rag.py`)
- Embedding And Retrieval → Pinecone: stores and retrieves (evidence: `infinsight/Embedding.py`)
- RAG Workflow → Analytics Sessions: updates sessions (evidence: `infinsight/Rag.py`)
- Zuno Music Assistant → LLM Providers: uses Baymax (evidence: `zuno/views.py`)
- Zuno Music Assistant → YouTube Music: searches tracks (evidence: `zuno/views.py`)
