# manirajsrikoti-alt/flash-ai architecture

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

- Interactive diagram: https://gitdiagram.com/manirajsrikoti-alt/flash-ai
- Repository: https://github.com/manirajsrikoti-alt/flash-ai

## Overview

FLASH is a macOS voice assistant that turns microphone or typed input into safety-gated local actions, with Bedrock planning and conversation as a fallback. Its principal workflow runs from continuous speech capture and transcription through routing to local execution or cloud planning; task context and the floating UI support multi-turn interaction. README capabilities supplement the sampled source for plan and integration details, so those documented relationships are cited to the README.

Main entry points: [`backend/flash_cli.py`](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_cli.py) (CLI orchestrator), [`backend/flash_plan_bridge.py`](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_plan_bridge.py) (Plan safety bridge), [`backend/flash_voice_continuous.py`](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_voice_continuous.py) (Continuous transcription), [`backend/flash_router.py`](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_router.py) (Rule and safety router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_cli["CLI orchestrator<br/>[flash_cli.py]"]
  node_popup["Floating pill"]
end

subgraph group_understanding["Speech and routing"]
  node_transcriber["Continuous transcription"]
  node_transcript_nlp["Transcript cleanup<br/>[flash_nlp.py]"]
  node_router["Rule and safety router<br/>[flash_router.py]"]
  node_classifier["Local intent classifier"]
end

subgraph group_execution["Action execution"]
  node_local_executor["Local action executor<br/>[flash_executor.py]"]
  node_plan_executor["Plan step executor"]
end

subgraph group_intelligence["Planning and context"]
  node_planner["AI planner"]
  node_plan_bridge["Plan safety bridge"]
  node_bedrock_brain["Bedrock conversation<br/>[flash_aws_brain.py]"]
  node_task_context["Task context<br/>[flash_context.py]"]
end

node_user(("User"))
node_microphone(("Microphone"))
node_macos(("macOS apps and actions"))
node_bedrock(("Amazon Bedrock"))

node_user -->|"enters commands"| node_cli
node_microphone -->|"streams audio"| node_transcriber
node_transcriber -->|"yields transcripts"| node_cli
node_cli -.->|"cleans speech"| node_transcript_nlp
node_cli -->|"routes input"| node_router
node_router -->|"classifies fallback"| node_classifier
node_cli -->|"supplies classifier"| node_classifier
node_cli -->|"executes local actions"| node_local_executor
node_local_executor -->|"dispatches actions"| node_macos
node_cli -->|"requests plans"| node_planner
node_cli -->|"asks fallback questions"| node_bedrock_brain
node_bedrock_brain -->|"sends conversation"| node_bedrock
node_plan_bridge -->|"requests plan"| node_planner
node_cli -->|"validates plans"| node_plan_bridge
node_plan_bridge -->|"executes validated steps"| node_plan_executor
node_plan_executor -.->|"performs plan actions"| node_macos
node_cli -->|"tracks task state"| node_task_context
node_cli -->|"updates display"| node_popup
node_user -->|"views feedback"| node_popup

click node_cli "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_cli.py"
click node_popup "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_voice_popup.py"
click node_transcriber "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_voice_continuous.py"
click node_transcript_nlp "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_nlp.py"
click node_router "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_router.py"
click node_classifier "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_laya_classifier.py"
click node_local_executor "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_executor.py"
click node_plan_executor "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_plan_executor.py"
click node_planner "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_ai_planner.py"
click node_plan_bridge "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_plan_bridge.py"
click node_bedrock_brain "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_aws_brain.py"
click node_task_context "https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_context.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_popup,node_user toneBlue
class node_transcriber,node_transcript_nlp,node_router,node_classifier toneAmber
class node_local_executor,node_plan_executor toneMint
class node_planner,node_plan_bridge,node_bedrock_brain,node_task_context toneRose
class node_microphone,node_macos,node_bedrock toneIndigo
```

## Components

### User interaction

- [CLI orchestrator](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_cli.py): `backend/flash_cli.py`
- [Floating pill](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_voice_popup.py): `backend/flash_voice_popup.py`

### Speech and routing

- [Continuous transcription](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_voice_continuous.py): `backend/flash_voice_continuous.py`
- [Transcript cleanup](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_nlp.py): `backend/flash_nlp.py`
- [Rule and safety router](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_router.py): `backend/flash_router.py`
- [Local intent classifier](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_laya_classifier.py): `backend/flash_laya_classifier.py`

### Action execution

- [Local action executor](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_executor.py): `backend/flash_executor.py`
- [Plan step executor](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_plan_executor.py): `backend/flash_plan_executor.py`

### Planning and context

- [AI planner](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_ai_planner.py): `backend/flash_ai_planner.py`
- [Plan safety bridge](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_plan_bridge.py): `backend/flash_plan_bridge.py`
- [Bedrock conversation](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_aws_brain.py): `backend/flash_aws_brain.py`
- [Task context](https://github.com/manirajsrikoti-alt/flash-ai/blob/main/backend/flash_context.py): `backend/flash_context.py`

### Other components

- **User**
- **Microphone**
- **macOS apps and actions**
- **Amazon Bedrock**

## Connections

- User → CLI orchestrator: enters commands (evidence: `README.md`)
- Microphone → Continuous transcription: streams audio (evidence: `README.md`)
- Continuous transcription → CLI orchestrator: yields transcripts (evidence: `backend/flash_cli.py`)
- CLI orchestrator → Transcript cleanup: cleans speech
- CLI orchestrator → Rule and safety router: routes input (evidence: `backend/flash_cli.py`)
- Rule and safety router → Local intent classifier: classifies fallback (evidence: `README.md`)
- CLI orchestrator → Local intent classifier: supplies classifier (evidence: `backend/flash_cli.py`)
- CLI orchestrator → Local action executor: executes local actions (evidence: `backend/flash_cli.py`)
- Local action executor → macOS apps and actions: dispatches actions (evidence: `backend/flash_executor.py`)
- CLI orchestrator → AI planner: requests plans (evidence: `backend/flash_cli.py`)
- CLI orchestrator → Bedrock conversation: asks fallback questions (evidence: `backend/flash_cli.py`)
- Bedrock conversation → Amazon Bedrock: sends conversation (evidence: `backend/flash_aws_brain.py`)
- Plan safety bridge → AI planner: requests plan (evidence: `backend/flash_plan_bridge.py`)
- CLI orchestrator → Plan safety bridge: validates plans (evidence: `backend/flash_cli.py`)
- Plan safety bridge → Plan step executor: executes validated steps (evidence: `backend/flash_plan_bridge.py`)
- Plan step executor → macOS apps and actions: performs plan actions
- CLI orchestrator → Task context: tracks task state (evidence: `backend/flash_cli.py`)
- CLI orchestrator → Floating pill: updates display (evidence: `backend/flash_cli.py`)
- User → Floating pill: views feedback (evidence: `README.md`)
