# fazmin/cve-intel architecture

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

- Interactive diagram: https://gitdiagram.com/fazmin/cve-intel
- Repository: https://github.com/fazmin/cve-intel

## Overview

CVE Intel is a local-first vulnerability and threat-intelligence product exposed through a desktop app, CLI, REST API, and MCP. Users submit a CVE, dependency list, product, or suspicious indicator; the service gathers source data, computes prioritization, and returns evidence-backed results. Separate branches cover threat investigations and local or opt-in cloud AI. The sampled service and adapters show the shared service/tool flow; README statements support additional product workflows. Desktop UI internals and several core implementations were not sampled, so those links are limited to documented relationships.

Main entry points: [`crates/cve-core/src/service.rs`](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/service.rs) (Intel service), [`crates/cve-core/src/clients.rs`](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/clients.rs) (Upstream clients), [`crates/cve-core/src/agent.rs`](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/agent.rs) (Ask agent), [`crates/cve-server/src/rest.rs`](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-server/src/rest.rs) (REST API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_desktop["Desktop app<br/>[main.rs]"]
  node_cli["CLI<br/>[cli.rs]"]
  node_rest["REST API<br/>[rest.rs]"]
  node_mcp["MCP server<br/>[mcp.rs]"]
  node_tools["Tool registry<br/>[tools.rs]"]
end

subgraph group_core["Intelligence service"]
  node_service["Intel service<br/>[service.rs]"]
  node_clients["Upstream clients<br/>[clients.rs]"]
  node_models["Intel data models<br/>[models.rs]"]
end

subgraph group_analysis["Analysis capabilities"]
  node_risk["Risk scoring<br/>[risk.rs]"]
  node_deps["Dependency analysis<br/>[deps.rs]"]
  node_search["Product and KEV search<br/>[search.rs]"]
  node_attack["Threat investigations<br/>[attack.rs]"]
  node_ssvc["SSVC decisions<br/>[ssvc.rs]"]
  node_osv["OSV advisory handling<br/>[osv.rs]"]
end

subgraph group_data["Sources and state"]
  node_sources["Source catalog<br/>[sources.rs]"]
  node_cache[("Response cache<br/>[cache.rs]")]
  node_settings[("Settings storage<br/>[settings_db.rs]")]
  node_keys["API key settings<br/>[keys.rs]"]
end

subgraph group_assistant["AI assistant"]
  node_agent["Ask agent<br/>[agent.rs]"]
  node_llm["Local model runtime<br/>[llm.rs]"]
  node_provider["Cloud providers<br/>[provider.rs]"]
end

node_user(("Analyst or developer"))
node_external_sources{{"Public security sources"}}
node_model_service{{"Model downloads or endpoints"}}

node_user -->|"triages in"| node_desktop
node_user -->|"runs commands"| node_cli
node_user -->|"calls API"| node_rest
node_user -->|"connects agent"| node_mcp
node_desktop -.->|"invokes natively"| node_service
node_cli -.->|"serves requests"| node_service
node_rest -->|"routes requests"| node_service
node_rest -->|"dispatches tools"| node_tools
node_mcp -->|"dispatches tools"| node_tools
node_tools -->|"calls methods"| node_service
node_service -->|"fetches intelligence"| node_clients
node_clients -->|"queries sources"| node_external_sources
node_clients -->|"reads and writes"| node_cache
node_service -->|"scores findings"| node_risk
node_service -->|"analyzes packages"| node_deps
node_service -->|"resolves product search"| node_search
node_service -.->|"checks indicators"| node_attack
node_service -->|"gets decisions"| node_ssvc
node_service -->|"formats advisories"| node_osv
node_clients -.->|"parses records"| node_models
node_service -.->|"reports sources"| node_sources
node_service -.->|"answers questions"| node_agent
node_agent -->|"runs lookups"| node_service
node_agent -.->|"generates answers"| node_llm
node_agent -.->|"uses selected endpoint"| node_provider
node_llm -->|"downloads models"| node_model_service
node_provider -->|"reads configuration"| node_settings
node_keys -->|"stores source keys"| node_settings
node_clients -.->|"uses configured keys"| node_keys

click node_desktop "https://github.com/Fazmin/cve-intel/blob/main/apps/desktop/src-tauri/src/main.rs"
click node_cli "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-server/src/cli.rs"
click node_rest "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-server/src/rest.rs"
click node_mcp "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-server/src/mcp.rs"
click node_tools "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-server/src/tools.rs"
click node_service "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/service.rs"
click node_clients "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/clients.rs"
click node_models "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/models.rs"
click node_risk "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/risk.rs"
click node_deps "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/deps.rs"
click node_search "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/search.rs"
click node_attack "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/attack.rs"
click node_ssvc "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/ssvc.rs"
click node_osv "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/osv.rs"
click node_sources "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/sources.rs"
click node_cache "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/cache.rs"
click node_settings "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/settings_db.rs"
click node_keys "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/keys.rs"
click node_agent "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/agent.rs"
click node_llm "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/llm.rs"
click node_provider "https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/provider.rs"

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_desktop,node_cli,node_rest,node_mcp,node_tools toneBlue
class node_service,node_clients,node_models toneAmber
class node_risk,node_deps,node_search,node_attack,node_ssvc,node_osv toneMint
class node_sources,node_cache,node_settings,node_keys toneRose
class node_agent,node_llm,node_provider,node_user,node_external_sources,node_model_service toneIndigo
```

## Components

### User interfaces

- [Desktop app](https://github.com/Fazmin/cve-intel/blob/main/apps/desktop/src-tauri/src/main.rs): `apps/desktop/src-tauri/src/main.rs`
- [CLI](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-server/src/cli.rs): `crates/cve-server/src/cli.rs`
- [REST API](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-server/src/rest.rs): `crates/cve-server/src/rest.rs`
- [MCP server](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-server/src/mcp.rs): `crates/cve-server/src/mcp.rs`
- [Tool registry](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-server/src/tools.rs): `crates/cve-server/src/tools.rs`

### Intelligence service

- [Intel service](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/service.rs): `crates/cve-core/src/service.rs`
- [Upstream clients](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/clients.rs): `crates/cve-core/src/clients.rs`
- [Intel data models](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/models.rs): `crates/cve-core/src/models.rs`

### Analysis capabilities

- [Risk scoring](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/risk.rs): `crates/cve-core/src/risk.rs`
- [Dependency analysis](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/deps.rs): `crates/cve-core/src/deps.rs`
- [Product and KEV search](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/search.rs): `crates/cve-core/src/search.rs`
- [Threat investigations](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/attack.rs): `crates/cve-core/src/attack.rs`
- [SSVC decisions](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/ssvc.rs): `crates/cve-core/src/ssvc.rs`
- [OSV advisory handling](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/osv.rs): `crates/cve-core/src/osv.rs`

### Sources and state

- [Source catalog](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/sources.rs): `crates/cve-core/src/sources.rs`
- [Response cache](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/cache.rs): `crates/cve-core/src/cache.rs`
- [Settings storage](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/settings_db.rs): `crates/cve-core/src/settings_db.rs`
- [API key settings](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/keys.rs): `crates/cve-core/src/keys.rs`

### AI assistant

- [Ask agent](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/agent.rs): `crates/cve-core/src/agent.rs`
- [Local model runtime](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/llm.rs): `crates/cve-core/src/llm.rs`
- [Cloud providers](https://github.com/Fazmin/cve-intel/blob/main/crates/cve-core/src/provider.rs): `crates/cve-core/src/provider.rs`

### Other components

- **Analyst or developer**
- **Public security sources**
- **Model downloads or endpoints**

## Connections

- Analyst or developer → Desktop app: triages in (evidence: `README.md`)
- Analyst or developer → CLI: runs commands (evidence: `README.md`)
- Analyst or developer → REST API: calls API (evidence: `README.md`)
- Analyst or developer → MCP server: connects agent (evidence: `README.md`)
- Desktop app → Intel service: invokes natively (evidence: `README.md`)
- CLI → Intel service: serves requests (evidence: `crates/cve-server/src/cli.rs`)
- REST API → Intel service: routes requests (evidence: `crates/cve-server/src/rest.rs`)
- REST API → Tool registry: dispatches tools (evidence: `crates/cve-server/src/rest.rs`)
- MCP server → Tool registry: dispatches tools (evidence: `crates/cve-server/src/mcp.rs`)
- Tool registry → Intel service: calls methods (evidence: `crates/cve-server/src/tools.rs`)
- Intel service → Upstream clients: fetches intelligence (evidence: `crates/cve-core/src/service.rs`)
- Upstream clients → Public security sources: queries sources (evidence: `README.md`)
- Upstream clients → Response cache: reads and writes (evidence: `crates/cve-core/src/clients.rs`)
- Intel service → Risk scoring: scores findings (evidence: `crates/cve-core/src/service.rs`)
- Intel service → Dependency analysis: analyzes packages (evidence: `crates/cve-core/src/service.rs`)
- Intel service → Product and KEV search: resolves product search (evidence: `crates/cve-core/src/service.rs`)
- Intel service → Threat investigations: checks indicators
- Intel service → SSVC decisions: gets decisions (evidence: `crates/cve-core/src/service.rs`)
- Intel service → OSV advisory handling: formats advisories (evidence: `crates/cve-core/src/service.rs`)
- Upstream clients → Intel data models: parses records
- Intel service → Source catalog: reports sources (evidence: `README.md`)
- Intel service → Ask agent: answers questions (evidence: `README.md`)
- Ask agent → Intel service: runs lookups (evidence: `crates/cve-core/src/agent.rs`)
- Ask agent → Local model runtime: generates answers (evidence: `crates/cve-core/src/agent.rs`)
- Ask agent → Cloud providers: uses selected endpoint (evidence: `crates/cve-core/src/agent.rs`)
- Local model runtime → Model downloads or endpoints: downloads models (evidence: `crates/cve-core/src/llm.rs`)
- Cloud providers → Settings storage: reads configuration (evidence: `crates/cve-core/src/provider.rs`)
- API key settings → Settings storage: stores source keys (evidence: `crates/cve-core/src/keys.rs`)
- Upstream clients → API key settings: uses configured keys
