# yashsinghrawat/athena architecture

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

- Interactive diagram: https://gitdiagram.com/yashsinghrawat/athena
- Repository: https://github.com/yashsinghrawat/athena

## Overview

ATHENA is a text-based longitudinal state analysis tool, not a chatbot or diagnostic system. Its main workflow accepts a journal entry through the CLI, extracts a validated emotional and behavioral snapshot, embeds the text, and stores the entry; CLI commands then retrieve history for baseline comparisons or trajectories. The graph also shows configuration and SQLite persistence as internal layers. Demo data and the separate demo display are peripheral to the documented core workflow. Edges reflect the README and sampled source; unsampled subsystems are not inferred.

Main entry points: [`src/main.py`](https://github.com/yashsinghrawat/athena/blob/main/src/main.py) (Command workflow), [`src/storage.py`](https://github.com/yashsinghrawat/athena/blob/main/src/storage.py) (Storage interface), [`src/config.py`](https://github.com/yashsinghrawat/athena/blob/main/src/config.py) (Runtime settings), [`src/emotion_engine.py`](https://github.com/yashsinghrawat/athena/blob/main/src/emotion_engine.py) (State extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["CLI interface"]
  node_cli["Command workflow<br/>[main.py]"]
end

subgraph group_analysis["State analysis"]
  node_extract["State extraction<br/>[emotion_engine.py]"]
  node_schema["State validation<br/>[schemas.py]"]
  node_embedding["Text embedding"]
  node_temporal["Temporal analysis<br/>[temporal_engine.py]"]
end

subgraph group_persistence["Semantic memory"]
  node_storage["Storage interface<br/>[storage.py]"]
  node_sqlite[("SQLite entries<br/>[storage.py]")]
end

subgraph group_foundation["Core foundation"]
  node_config["Runtime settings<br/>[config.py]"]
end

node_user(("CLI user"))

node_user -->|"submits or queries"| node_cli
node_cli -->|"analyzes text"| node_extract
node_extract -->|"validates state"| node_schema
node_cli -->|"embeds text"| node_embedding
node_cli -->|"saves entry"| node_storage
node_storage -->|"writes entries"| node_sqlite
node_storage -->|"reads history"| node_sqlite
node_cli -->|"retrieves history"| node_storage
node_cli -->|"compares baseline"| node_temporal
node_cli -->|"gets trajectory"| node_temporal
node_extract -->|"uses model settings"| node_config
node_storage -->|"uses database path"| node_config
node_temporal -->|"uses state dimensions"| node_config
node_cli -->|"uses state dimensions"| node_config

click node_cli "https://github.com/yashsinghrawat/athena/blob/main/src/main.py"
click node_extract "https://github.com/yashsinghrawat/athena/blob/main/src/emotion_engine.py"
click node_schema "https://github.com/yashsinghrawat/athena/blob/main/src/schemas.py"
click node_embedding "https://github.com/yashsinghrawat/athena/blob/main/src/embedding_engine.py"
click node_temporal "https://github.com/yashsinghrawat/athena/blob/main/src/temporal_engine.py"
click node_storage "https://github.com/yashsinghrawat/athena/blob/main/src/storage.py"
click node_sqlite "https://github.com/yashsinghrawat/athena/blob/main/src/storage.py"
click node_config "https://github.com/yashsinghrawat/athena/blob/main/src/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_cli,node_user toneBlue
class node_extract,node_schema,node_embedding,node_temporal toneAmber
class node_storage,node_sqlite toneMint
class node_config toneRose
```

## Components

### CLI interface

- [Command workflow](https://github.com/yashsinghrawat/athena/blob/main/src/main.py): `src/main.py`

### State analysis

- [State extraction](https://github.com/yashsinghrawat/athena/blob/main/src/emotion_engine.py): `src/emotion_engine.py`
- [State validation](https://github.com/yashsinghrawat/athena/blob/main/src/schemas.py): `src/schemas.py`
- [Text embedding](https://github.com/yashsinghrawat/athena/blob/main/src/embedding_engine.py): `src/embedding_engine.py`
- [Temporal analysis](https://github.com/yashsinghrawat/athena/blob/main/src/temporal_engine.py): `src/temporal_engine.py`

### Semantic memory

- [Storage interface](https://github.com/yashsinghrawat/athena/blob/main/src/storage.py): `src/storage.py`
- [SQLite entries](https://github.com/yashsinghrawat/athena/blob/main/src/storage.py): `src/storage.py`

### Core foundation

- [Runtime settings](https://github.com/yashsinghrawat/athena/blob/main/src/config.py): `src/config.py`

### Other components

- **CLI user**

## Connections

- CLI user → Command workflow: submits or queries (evidence: `README.md`)
- Command workflow → State extraction: analyzes text (evidence: `src/main.py`)
- State extraction → State validation: validates state (evidence: `src/emotion_engine.py`)
- Command workflow → Text embedding: embeds text (evidence: `src/main.py`)
- Command workflow → Storage interface: saves entry (evidence: `src/main.py`)
- Storage interface → SQLite entries: writes entries (evidence: `src/storage.py`)
- Storage interface → SQLite entries: reads history (evidence: `src/storage.py`)
- Command workflow → Storage interface: retrieves history (evidence: `src/main.py`)
- Command workflow → Temporal analysis: compares baseline (evidence: `src/main.py`)
- Command workflow → Temporal analysis: gets trajectory (evidence: `src/main.py`)
- State extraction → Runtime settings: uses model settings (evidence: `src/emotion_engine.py`)
- Storage interface → Runtime settings: uses database path (evidence: `src/storage.py`)
- Temporal analysis → Runtime settings: uses state dimensions (evidence: `src/temporal_engine.py`)
- Command workflow → Runtime settings: uses state dimensions (evidence: `src/main.py`)
