# gantermist/alice-skill architecture

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

- Interactive diagram: https://gitdiagram.com/gantermist/alice-skill
- Repository: https://github.com/gantermist/alice-skill

## Overview

This is a FastAPI service for a Yandex Alice skill. The visible user workflow is an Alice webhook request that checks account linking, initializes persona state for a new session, and loads persona data from Yandex Disk. The source also contains separate persona and intent LLM helpers, disk listing/search helpers, and a persona-load endpoint. The README provides no capability detail, and the excerpt omits most webhook routing, so connections beyond the shown calls are not inferred.

Main entry points: [`main.py`](https://github.com/gantermist/alice-skill/blob/main/main.py) (Alice webhook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Request handling"]
  node_webhook["Alice webhook<br/>[main.py]"]
  node_sessions[("Session state<br/>[main.py]")]
  node_persona_load["Persona load endpoint<br/>[main.py]"]
  node_intent_gpt["Intent detection<br/>[main.py]"]
end

subgraph group_state["Persona state"]
  node_persona_init["Persona initialization<br/>[main.py]"]
  node_persona_read["Persona reader<br/>[main.py]"]
  node_persona_write["Persona writer<br/>[main.py]"]
  node_persona_gpt["Persona extraction<br/>[main.py]"]
  node_disk_helpers["Disk list and search<br/>[main.py]"]
end

subgraph group_integrations["External integrations"]
  node_yandex_disk[("Yandex Disk")]
  node_yandex_llm["Yandex Foundation Models"]
end

node_alice(("Alice user"))

node_alice -->|"sends request"| node_webhook
node_webhook -->|"initializes new session"| node_persona_init
node_webhook -->|"loads persona"| node_persona_read
node_webhook -->|"stores session"| node_sessions
node_persona_init -->|"checks file"| node_yandex_disk
node_persona_init -->|"creates missing file"| node_persona_write
node_persona_read -->|"downloads persona"| node_yandex_disk
node_persona_write -->|"uploads persona"| node_yandex_disk
node_persona_gpt -->|"requests completion"| node_yandex_llm
node_intent_gpt -->|"requests completion"| node_yandex_llm
node_persona_load -->|"downloads persona"| node_yandex_disk
node_disk_helpers -->|"lists and searches"| node_yandex_disk

click node_webhook "https://github.com/gantermist/alice-skill/blob/main/main.py"
click node_sessions "https://github.com/gantermist/alice-skill/blob/main/main.py"
click node_persona_init "https://github.com/gantermist/alice-skill/blob/main/main.py"
click node_persona_read "https://github.com/gantermist/alice-skill/blob/main/main.py"
click node_persona_write "https://github.com/gantermist/alice-skill/blob/main/main.py"
click node_persona_gpt "https://github.com/gantermist/alice-skill/blob/main/main.py"
click node_persona_load "https://github.com/gantermist/alice-skill/blob/main/main.py"
click node_intent_gpt "https://github.com/gantermist/alice-skill/blob/main/main.py"
click node_disk_helpers "https://github.com/gantermist/alice-skill/blob/main/main.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_webhook,node_sessions,node_persona_load,node_intent_gpt,node_alice toneBlue
class node_persona_init,node_persona_read,node_persona_write,node_persona_gpt,node_disk_helpers toneAmber
class node_yandex_disk,node_yandex_llm toneMint
```

## Components

### Request handling

- [Alice webhook](https://github.com/gantermist/alice-skill/blob/main/main.py): `main.py`
- [Session state](https://github.com/gantermist/alice-skill/blob/main/main.py): `main.py`
- [Persona load endpoint](https://github.com/gantermist/alice-skill/blob/main/main.py): `main.py`
- [Intent detection](https://github.com/gantermist/alice-skill/blob/main/main.py): `main.py`

### Persona state

- [Persona initialization](https://github.com/gantermist/alice-skill/blob/main/main.py): `main.py`
- [Persona reader](https://github.com/gantermist/alice-skill/blob/main/main.py): `main.py`
- [Persona writer](https://github.com/gantermist/alice-skill/blob/main/main.py): `main.py`
- [Persona extraction](https://github.com/gantermist/alice-skill/blob/main/main.py): `main.py`
- [Disk list and search](https://github.com/gantermist/alice-skill/blob/main/main.py): `main.py`

### External integrations

- **Yandex Disk**
- **Yandex Foundation Models**

### Other components

- **Alice user**

## Connections

- Alice user → Alice webhook: sends request (evidence: `main.py`)
- Alice webhook → Persona initialization: initializes new session (evidence: `main.py`)
- Alice webhook → Persona reader: loads persona (evidence: `main.py`)
- Alice webhook → Session state: stores session (evidence: `main.py`)
- Persona initialization → Yandex Disk: checks file (evidence: `main.py`)
- Persona initialization → Persona writer: creates missing file (evidence: `main.py`)
- Persona reader → Yandex Disk: downloads persona (evidence: `main.py`)
- Persona writer → Yandex Disk: uploads persona (evidence: `main.py`)
- Persona extraction → Yandex Foundation Models: requests completion (evidence: `main.py`)
- Intent detection → Yandex Foundation Models: requests completion (evidence: `main.py`)
- Persona load endpoint → Yandex Disk: downloads persona (evidence: `main.py`)
- Disk list and search → Yandex Disk: lists and searches (evidence: `main.py`)
