# naflashdev/cybermind architecture

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

- Interactive diagram: https://gitdiagram.com/naflashdev/cybermind
- Repository: https://github.com/naflashdev/cybermind

## Overview

CyberMind is a cybersecurity intelligence and monitoring platform with a browser dashboard backed by a FastAPI application. Users configure and monitor services, collect and analyze threat information, and query CyberSentinel; the LLM workflow can retrieve indexed context before answering. The graph preserves documented scraping, NLP, code/network analysis, hashing, and worker capabilities. Edges use the excerpts, SOURCE INDEX references, or README; several implementations were not sampled, so uncertain internal calls are omitted.

Main entry points: [`src/main.py`](https://github.com/naflashdev/cybermind/blob/main/src/main.py) (FastAPI App), [`frontend/src/App.tsx`](https://github.com/naflashdev/cybermind/blob/main/frontend/src/App.tsx) (Dashboard App), [`frontend/src/services/api.ts`](https://github.com/naflashdev/cybermind/blob/main/frontend/src/services/api.ts) (HTTP Client), [`src/app/controllers/routes/llm_controller.py`](https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/llm_controller.py) (LLM API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard"]
  node_app["Dashboard App<br/>[App.tsx]"]
  node_api_client["HTTP Client<br/>[api.ts]"]
  node_services_view["Services View<br/>[ServicesView.tsx]"]
  node_llm_view["LLM View<br/>[LLMView.tsx]"]
  node_config_view["Config View<br/>[ConfigView.tsx]"]
  node_docs_view["Docs View<br/>[DocsView.tsx]"]
end

subgraph group_api["API and Workers"]
  node_main["FastAPI App<br/>[main.py]"]
  node_news_api["Scraping API"]
  node_llm_api["LLM API<br/>[llm_controller.py]"]
  node_worker_api["Worker API"]
  node_code_api["Code Analysis API"]
  node_network_api["Network Analysis API"]
  node_hash_api["Hashing API"]
  node_service_runner["Infrastructure Setup<br/>[run_services.py]"]
end

subgraph group_intel["Intelligence Processing"]
  node_scrapers["Scrapers"]
  node_nlp["Text Processing<br/>[text_processor.py]"]
  node_code_scanner["Code Scanner<br/>[scanner.py]"]
  node_network_analysis["Network Analysis"]
  node_hash_service["Hash Service<br/>[hash_service.py]"]
end

subgraph group_data["AI and Storage"]
  node_ingest["Document Ingestion<br/>[ingest.py]"]
  node_llm_client["LLM Client<br/>[llm_client.py]"]
  node_vectorstore[("Chroma Vectorstore<br/>[chroma_client.py]")]
  node_embeddings["Ollama Adapter<br/>[ollama_adapter.py]"]
  node_conversations[("Conversation Store<br/>[conversation_db.py]")]
  node_hash_db[("Hash Store<br/>[db.py]")]
end

node_user(("Operator"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_services_view
node_app -->|"renders"| node_llm_view
node_app -->|"renders"| node_config_view
node_app -->|"renders"| node_docs_view
node_services_view -->|"requests"| node_api_client
node_llm_view -->|"requests"| node_api_client
node_config_view -->|"requests"| node_api_client
node_docs_view -->|"requests"| node_api_client
node_api_client -.->|"calls API"| node_main
node_main -->|"registers routes"| node_news_api
node_main -->|"registers routes"| node_llm_api
node_main -->|"registers routes"| node_worker_api
node_main -->|"registers routes"| node_code_api
node_main -->|"registers routes"| node_network_api
node_main -->|"registers routes"| node_hash_api
node_main -->|"ensures services"| node_service_runner
node_news_api -->|"dispatches scraping"| node_scrapers
node_worker_api -->|"starts workers"| node_news_api
node_worker_api -->|"dispatches ingestion"| node_ingest
node_llm_api -->|"retrieves context"| node_vectorstore
node_llm_api -->|"calls model"| node_llm_client
node_llm_api -->|"persists turns"| node_conversations
node_ingest -->|"indexes documents"| node_vectorstore
node_ingest -->|"generates embeddings"| node_embeddings
node_vectorstore -->|"uses adapter"| node_embeddings
node_hash_api -->|"dispatches hashing"| node_hash_service
node_hash_service -->|"reads and writes"| node_hash_db
node_network_api -->|"dispatches analysis"| node_network_analysis
node_code_api -.->|"dispatches scans"| node_code_scanner
node_news_api -.->|"uses processing"| node_nlp

click node_app "https://github.com/naflashdev/cybermind/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/naflashdev/cybermind/blob/main/frontend/src/services/api.ts"
click node_services_view "https://github.com/naflashdev/cybermind/blob/main/frontend/src/views/ServicesView.tsx"
click node_llm_view "https://github.com/naflashdev/cybermind/blob/main/frontend/src/views/LLMView.tsx"
click node_config_view "https://github.com/naflashdev/cybermind/blob/main/frontend/src/views/ConfigView.tsx"
click node_docs_view "https://github.com/naflashdev/cybermind/blob/main/frontend/src/views/DocsView.tsx"
click node_main "https://github.com/naflashdev/cybermind/blob/main/src/main.py"
click node_news_api "https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/scrapy_news_controller.py"
click node_llm_api "https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/llm_controller.py"
click node_worker_api "https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/worker_controller.py"
click node_code_api "https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/code_analysis_controller.py"
click node_network_api "https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/network_analysis_controller.py"
click node_hash_api "https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/hashed_controller.py"
click node_scrapers "https://github.com/naflashdev/cybermind/tree/main/src/app/services/scraping"
click node_nlp "https://github.com/naflashdev/cybermind/blob/main/src/app/services/spacy/text_processor.py"
click node_code_scanner "https://github.com/naflashdev/cybermind/blob/main/src/app/services/code_analysis/scanner.py"
click node_network_analysis "https://github.com/naflashdev/cybermind/blob/main/src/app/services/network_analysis/network_analysis.py"
click node_hash_service "https://github.com/naflashdev/cybermind/blob/main/src/app/services/hashed/hash_service.py"
click node_ingest "https://github.com/naflashdev/cybermind/blob/main/src/app/services/documents/ingest.py"
click node_llm_client "https://github.com/naflashdev/cybermind/blob/main/src/app/services/llm/llm_client.py"
click node_vectorstore "https://github.com/naflashdev/cybermind/blob/main/src/app/services/vectorstore/chroma_client.py"
click node_embeddings "https://github.com/naflashdev/cybermind/blob/main/src/app/services/vectorstore/ollama_adapter.py"
click node_conversations "https://github.com/naflashdev/cybermind/blob/main/src/app/models/conversation_db.py"
click node_hash_db "https://github.com/naflashdev/cybermind/blob/main/src/app/models/db.py"
click node_service_runner "https://github.com/naflashdev/cybermind/blob/main/src/app/utils/run_services.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_api_client,node_services_view,node_llm_view,node_config_view,node_docs_view toneBlue
class node_main,node_news_api,node_llm_api,node_worker_api,node_code_api,node_network_api,node_hash_api,node_service_runner toneAmber
class node_scrapers,node_nlp,node_code_scanner,node_network_analysis,node_hash_service toneMint
class node_ingest,node_llm_client,node_vectorstore,node_embeddings,node_conversations,node_hash_db toneRose
class node_user toneIndigo
```

## Components

### Dashboard

- [Dashboard App](https://github.com/naflashdev/cybermind/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [HTTP Client](https://github.com/naflashdev/cybermind/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Services View](https://github.com/naflashdev/cybermind/blob/main/frontend/src/views/ServicesView.tsx): `frontend/src/views/ServicesView.tsx`
- [LLM View](https://github.com/naflashdev/cybermind/blob/main/frontend/src/views/LLMView.tsx): `frontend/src/views/LLMView.tsx`
- [Config View](https://github.com/naflashdev/cybermind/blob/main/frontend/src/views/ConfigView.tsx): `frontend/src/views/ConfigView.tsx`
- [Docs View](https://github.com/naflashdev/cybermind/blob/main/frontend/src/views/DocsView.tsx): `frontend/src/views/DocsView.tsx`

### API and Workers

- [FastAPI App](https://github.com/naflashdev/cybermind/blob/main/src/main.py): `src/main.py`
- [Scraping API](https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/scrapy_news_controller.py): `src/app/controllers/routes/scrapy_news_controller.py`
- [LLM API](https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/llm_controller.py): `src/app/controllers/routes/llm_controller.py`
- [Worker API](https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/worker_controller.py): `src/app/controllers/routes/worker_controller.py`
- [Code Analysis API](https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/code_analysis_controller.py): `src/app/controllers/routes/code_analysis_controller.py`
- [Network Analysis API](https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/network_analysis_controller.py): `src/app/controllers/routes/network_analysis_controller.py`
- [Hashing API](https://github.com/naflashdev/cybermind/blob/main/src/app/controllers/routes/hashed_controller.py): `src/app/controllers/routes/hashed_controller.py`
- [Infrastructure Setup](https://github.com/naflashdev/cybermind/blob/main/src/app/utils/run_services.py): `src/app/utils/run_services.py`

### Intelligence Processing

- [Scrapers](https://github.com/naflashdev/cybermind/tree/main/src/app/services/scraping): `src/app/services/scraping`
- [Text Processing](https://github.com/naflashdev/cybermind/blob/main/src/app/services/spacy/text_processor.py): `src/app/services/spacy/text_processor.py`
- [Code Scanner](https://github.com/naflashdev/cybermind/blob/main/src/app/services/code_analysis/scanner.py): `src/app/services/code_analysis/scanner.py`
- [Network Analysis](https://github.com/naflashdev/cybermind/blob/main/src/app/services/network_analysis/network_analysis.py): `src/app/services/network_analysis/network_analysis.py`
- [Hash Service](https://github.com/naflashdev/cybermind/blob/main/src/app/services/hashed/hash_service.py): `src/app/services/hashed/hash_service.py`

### AI and Storage

- [Document Ingestion](https://github.com/naflashdev/cybermind/blob/main/src/app/services/documents/ingest.py): `src/app/services/documents/ingest.py`
- [LLM Client](https://github.com/naflashdev/cybermind/blob/main/src/app/services/llm/llm_client.py): `src/app/services/llm/llm_client.py`
- [Chroma Vectorstore](https://github.com/naflashdev/cybermind/blob/main/src/app/services/vectorstore/chroma_client.py): `src/app/services/vectorstore/chroma_client.py`
- [Ollama Adapter](https://github.com/naflashdev/cybermind/blob/main/src/app/services/vectorstore/ollama_adapter.py): `src/app/services/vectorstore/ollama_adapter.py`
- [Conversation Store](https://github.com/naflashdev/cybermind/blob/main/src/app/models/conversation_db.py): `src/app/models/conversation_db.py`
- [Hash Store](https://github.com/naflashdev/cybermind/blob/main/src/app/models/db.py): `src/app/models/db.py`

### Other components

- **Operator**

## Connections

- Operator → Dashboard App: uses (evidence: `README.md`)
- Dashboard App → Services View: renders (evidence: `frontend/src/App.tsx`)
- Dashboard App → LLM View: renders (evidence: `frontend/src/App.tsx`)
- Dashboard App → Config View: renders (evidence: `frontend/src/App.tsx`)
- Dashboard App → Docs View: renders (evidence: `frontend/src/App.tsx`)
- Services View → HTTP Client: requests (evidence: `frontend/src/views/ServicesView.tsx`)
- LLM View → HTTP Client: requests (evidence: `frontend/src/views/LLMView.tsx`)
- Config View → HTTP Client: requests (evidence: `frontend/src/views/ConfigView.tsx`)
- Docs View → HTTP Client: requests (evidence: `frontend/src/views/DocsView.tsx`)
- HTTP Client → FastAPI App: calls API
- FastAPI App → Scraping API: registers routes (evidence: `src/main.py`)
- FastAPI App → LLM API: registers routes (evidence: `src/main.py`)
- FastAPI App → Worker API: registers routes (evidence: `src/main.py`)
- FastAPI App → Code Analysis API: registers routes (evidence: `src/main.py`)
- FastAPI App → Network Analysis API: registers routes (evidence: `src/main.py`)
- FastAPI App → Hashing API: registers routes (evidence: `src/main.py`)
- FastAPI App → Infrastructure Setup: ensures services (evidence: `src/main.py`)
- Scraping API → Scrapers: dispatches scraping (evidence: `src/app/controllers/routes/scrapy_news_controller.py`)
- Worker API → Scraping API: starts workers (evidence: `src/app/controllers/routes/worker_controller.py`)
- Worker API → Document Ingestion: dispatches ingestion (evidence: `src/app/controllers/routes/worker_controller.py`)
- LLM API → Chroma Vectorstore: retrieves context (evidence: `src/app/controllers/routes/llm_controller.py`)
- LLM API → LLM Client: calls model (evidence: `src/app/controllers/routes/llm_controller.py`)
- LLM API → Conversation Store: persists turns (evidence: `src/app/controllers/routes/llm_controller.py`)
- Document Ingestion → Chroma Vectorstore: indexes documents (evidence: `src/app/services/documents/ingest.py`)
- Document Ingestion → Ollama Adapter: generates embeddings (evidence: `src/app/services/documents/ingest.py`)
- Chroma Vectorstore → Ollama Adapter: uses adapter (evidence: `src/app/services/vectorstore/chroma_client.py`)
- Hashing API → Hash Service: dispatches hashing (evidence: `src/app/controllers/routes/hashed_controller.py`)
- Hash Service → Hash Store: reads and writes (evidence: `src/app/services/hashed/hash_service.py`)
- Network Analysis API → Network Analysis: dispatches analysis (evidence: `src/app/controllers/routes/network_analysis_controller.py`)
- Code Analysis API → Code Scanner: dispatches scans
- Scraping API → Text Processing: uses processing
