# gagan-kikkeri/astra architecture

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

- Interactive diagram: https://gitdiagram.com/gagan-kikkeri/astra
- Repository: https://github.com/gagan-kikkeri/astra

## Overview

ASTRA Sentinel is an OSINT triage and briefing web application. Its main workflow accepts text or a URL, resolves article content, checks for duplicates, classifies and extracts intelligence, synthesizes a briefing, and stores the dispatch for search and review. The README documents additional RSS ingestion, cross-document synthesis, SITREPs, and localization. The graph includes these capabilities, but unsampled implementation details and some route-level wiring are based on documentation rather than inspected source.

Main entry points: [`app/main.py`](https://github.com/gagan-kikkeri/astra/blob/main/app/main.py) (REST API), [`app/processor.py`](https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py) (Dispatch processing), [`app/database.py`](https://github.com/gagan-kikkeri/astra/blob/main/app/database.py) (Dispatch database), [`app/intelligence.py`](https://github.com/gagan-kikkeri/astra/blob/main/app/intelligence.py) (Briefing synthesis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface and API"]
  node_webui["Agent interface<br/>[index.html]"]
  node_api["REST API<br/>[main.py]"]
  node_schemas["Request schemas<br/>[models.py]"]
end

subgraph group_ingestion["Dispatch ingestion"]
  node_urlresolve["URL resolution<br/>[processor.py]"]
  node_dispatch["Dispatch processing<br/>[processor.py]"]
  node_dedupe["Hash deduplication<br/>[processor.py]"]
  node_classification["Domain triage<br/>[processor.py]"]
  node_entityextract["Entity extraction<br/>[processor.py]"]
  node_feed["RSS feed sync<br/>[processor.py]"]
  node_llmgateway["LLM gateway<br/>[llm_gateway.py]"]
end

subgraph group_intelligence["Analysis and retrieval"]
  node_briefing["Briefing synthesis<br/>[intelligence.py]"]
  node_crossdoc["Cross-document dossiers<br/>[intelligence.py]"]
  node_search["Full-text search<br/>[database.py]"]
  node_translation["Localization<br/>[translator.py]"]
end

subgraph group_platform["Storage and configuration"]
  node_store[("Dispatch database<br/>[database.py]")]
  node_settings["Runtime settings<br/>[config.py]"]
end

node_operator(("Analyst"))
node_publicfeeds["Defense RSS feeds"]
node_llmproviders{{"LLM providers"}}

node_operator -->|"submits dispatch"| node_webui
node_webui -->|"sends requests"| node_api
node_api -.->|"validates input"| node_schemas
node_api -->|"analyzes dispatch"| node_dispatch
node_dispatch -->|"resolves URLs"| node_urlresolve
node_dispatch -->|"checks hash"| node_dedupe
node_dispatch -->|"triages domain"| node_classification
node_dispatch -->|"extracts entities"| node_entityextract
node_dispatch -->|"requests analysis"| node_llmgateway
node_llmgateway -->|"calls providers"| node_llmproviders
node_dispatch -->|"inserts dispatch"| node_store
node_api -->|"syncs feeds"| node_feed
node_feed -.->|"fetches entries"| node_publicfeeds
node_feed -.->|"indexes dispatches"| node_store
node_api -.->|"generates SITREP"| node_briefing
node_api -->|"requests synthesis"| node_crossdoc
node_crossdoc -.->|"retrieves dispatches"| node_store
node_api -->|"searches dispatches"| node_search
node_search -->|"queries index"| node_store
node_api -->|"reads dispatches"| node_store
node_briefing -.->|"retrieves evidence"| node_search
node_api -->|"localizes results"| node_translation
node_briefing -.->|"localizes briefing"| node_translation
node_dispatch -->|"uses settings"| node_settings
node_store -->|"reads database path"| node_settings

click node_webui "https://github.com/gagan-kikkeri/astra/blob/main/app/templates/index.html"
click node_api "https://github.com/gagan-kikkeri/astra/blob/main/app/main.py"
click node_schemas "https://github.com/gagan-kikkeri/astra/blob/main/app/models.py"
click node_urlresolve "https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py"
click node_dispatch "https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py"
click node_dedupe "https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py"
click node_classification "https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py"
click node_entityextract "https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py"
click node_feed "https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py"
click node_llmgateway "https://github.com/gagan-kikkeri/astra/blob/main/app/llm_gateway.py"
click node_briefing "https://github.com/gagan-kikkeri/astra/blob/main/app/intelligence.py"
click node_crossdoc "https://github.com/gagan-kikkeri/astra/blob/main/app/intelligence.py"
click node_search "https://github.com/gagan-kikkeri/astra/blob/main/app/database.py"
click node_translation "https://github.com/gagan-kikkeri/astra/blob/main/app/translator.py"
click node_store "https://github.com/gagan-kikkeri/astra/blob/main/app/database.py"
click node_settings "https://github.com/gagan-kikkeri/astra/blob/main/app/config.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_webui,node_api,node_schemas toneBlue
class node_urlresolve,node_dispatch,node_dedupe,node_classification,node_entityextract,node_feed,node_llmgateway toneAmber
class node_briefing,node_crossdoc,node_search,node_translation toneMint
class node_store,node_settings toneRose
class node_operator,node_publicfeeds,node_llmproviders toneIndigo
```

## Components

### User interface and API

- [Agent interface](https://github.com/gagan-kikkeri/astra/blob/main/app/templates/index.html): `app/templates/index.html`
- [REST API](https://github.com/gagan-kikkeri/astra/blob/main/app/main.py): `app/main.py`
- [Request schemas](https://github.com/gagan-kikkeri/astra/blob/main/app/models.py): `app/models.py`

### Dispatch ingestion

- [URL resolution](https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py): `app/processor.py`
- [Dispatch processing](https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py): `app/processor.py`
- [Hash deduplication](https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py): `app/processor.py`
- [Domain triage](https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py): `app/processor.py`
- [Entity extraction](https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py): `app/processor.py`
- [RSS feed sync](https://github.com/gagan-kikkeri/astra/blob/main/app/processor.py): `app/processor.py`
- [LLM gateway](https://github.com/gagan-kikkeri/astra/blob/main/app/llm_gateway.py): `app/llm_gateway.py`

### Analysis and retrieval

- [Briefing synthesis](https://github.com/gagan-kikkeri/astra/blob/main/app/intelligence.py): `app/intelligence.py`
- [Cross-document dossiers](https://github.com/gagan-kikkeri/astra/blob/main/app/intelligence.py): `app/intelligence.py`
- [Full-text search](https://github.com/gagan-kikkeri/astra/blob/main/app/database.py): `app/database.py`
- [Localization](https://github.com/gagan-kikkeri/astra/blob/main/app/translator.py): `app/translator.py`

### Storage and configuration

- [Dispatch database](https://github.com/gagan-kikkeri/astra/blob/main/app/database.py): `app/database.py`
- [Runtime settings](https://github.com/gagan-kikkeri/astra/blob/main/app/config.py): `app/config.py`

### Other components

- **Analyst**
- **Defense RSS feeds**
- **LLM providers**

## Connections

- Analyst → Agent interface: submits dispatch (evidence: `README.md`)
- Agent interface → REST API: sends requests (evidence: `README.md`)
- REST API → Request schemas: validates input (evidence: `app/main.py`)
- REST API → Dispatch processing: analyzes dispatch (evidence: `app/main.py`)
- Dispatch processing → URL resolution: resolves URLs (evidence: `README.md`)
- Dispatch processing → Hash deduplication: checks hash (evidence: `README.md`)
- Dispatch processing → Domain triage: triages domain (evidence: `README.md`)
- Dispatch processing → Entity extraction: extracts entities (evidence: `README.md`)
- Dispatch processing → LLM gateway: requests analysis (evidence: `app/processor.py`)
- LLM gateway → LLM providers: calls providers (evidence: `app/llm_gateway.py`)
- Dispatch processing → Dispatch database: inserts dispatch (evidence: `app/processor.py`)
- REST API → RSS feed sync: syncs feeds (evidence: `app/main.py`)
- RSS feed sync → Defense RSS feeds: fetches entries
- RSS feed sync → Dispatch database: indexes dispatches (evidence: `app/processor.py`)
- REST API → Briefing synthesis: generates SITREP (evidence: `README.md`)
- REST API → Cross-document dossiers: requests synthesis (evidence: `app/main.py`)
- Cross-document dossiers → Dispatch database: retrieves dispatches (evidence: `app/intelligence.py`)
- REST API → Full-text search: searches dispatches (evidence: `README.md`)
- Full-text search → Dispatch database: queries index (evidence: `app/database.py`)
- REST API → Dispatch database: reads dispatches (evidence: `app/main.py`)
- Briefing synthesis → Full-text search: retrieves evidence (evidence: `app/intelligence.py`)
- REST API → Localization: localizes results (evidence: `app/main.py`)
- Briefing synthesis → Localization: localizes briefing (evidence: `app/intelligence.py`)
- Dispatch processing → Runtime settings: uses settings (evidence: `app/processor.py`)
- Dispatch database → Runtime settings: reads database path (evidence: `app/database.py`)
