# jaspersmart87/astrabackup architecture

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

- Interactive diagram: https://gitdiagram.com/jaspersmart87/astrabackup
- Repository: https://github.com/jaspersmart87/astrabackup

## Overview

Astra is a long-running conversational AI project with dashboard and Discord/voice interfaces, a cognitive loop, persistent memory and self-development systems, and embodied/creative tools. The typical workflow begins with a person sending a message or speaking; an interface routes input into cognition, which forms a response and may update memory or project state before replying. The README documents these capabilities, while the excerpts and source index provide only partial wiring evidence; uncertain links are omitted rather than inferred.

Main entry points: [`main.py`](https://github.com/jaspersmart87/astrabackup/blob/main/main.py) (Organism Boot), [`brain.py`](https://github.com/jaspersmart87/astrabackup/blob/main/brain.py) (Conscious Loop), [`astra_v4/activate.py`](https://github.com/jaspersmart87/astrabackup/blob/main/astra_v4/activate.py) (V4 Activation), [`app.py`](https://github.com/jaspersmart87/astrabackup/blob/main/app.py) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_dashboard["Dashboard<br/>[app.py]"]
  node_discord["Discord Bridge<br/>[astra_discord.py]"]
  node_boot["Organism Boot<br/>[main.py]"]
end

subgraph group_cognition["Cognition"]
  node_brain["Conscious Loop<br/>[brain.py]"]
  node_llm["Neural Interface<br/>[llm.py]"]
  node_decision["Fast Decision<br/>[decide.py]"]
  node_v4["V4 Activation<br/>[activate.py]"]
  node_arbiter["V4 Arbiter<br/>[arbiter.py]"]
  node_steering["Cognitive Steering<br/>[steering_engine.py]"]
  node_dream["Subconscious<br/>[dream.py]"]
end

subgraph group_memory["Memory and Growth"]
  node_state[("Persistent State<br/>[state.py]")]
  node_continuity[("Obligation Ledger<br/>[continuity.py]")]
  node_vessel[("Experiential Memory<br/>[vessel.py]")]
  node_charter["Self Charter<br/>[charter.py]"]
  node_identity["Identity Drift<br/>[identity.py]"]
  node_people[("People Biographies<br/>[people.py]")]
end

subgraph group_voice["Voice"]
  node_voice_runtime["Voice Runtime<br/>[runtime.py]"]
  node_voice_client["Voice Client<br/>[voice_client.py]"]
  node_voice_reader["Audio Reader<br/>[reader.py]"]
  node_voice_router["Packet Router<br/>[router.py]"]
  node_voice_sink["Audio Sinks<br/>[sinks.py]"]
end

subgraph group_tools["Embodied Tools"]
  node_body["Body Controller<br/>[body_pad.py]"]
  node_world[("Room State<br/>[world_state.py]")]
  node_brush["Iterative Drawing<br/>[brush.py]"]
  node_games[("Game Table<br/>[_table.py]")]
  node_visual["Image Generation<br/>[comfy_tool.py]"]
  node_code["Code Tools<br/>[code_tools.py]"]
end

node_person(("Person"))

node_person -->|"sends message"| node_dashboard
node_person -->|"sends message"| node_discord
node_dashboard -->|"builds organism"| node_boot
node_boot -->|"wires cortex"| node_brain
node_boot -->|"wires cortex"| node_dream
node_boot -->|"wires cortex"| node_llm
node_brain -.->|"calls model"| node_llm
node_brain -.->|"consults"| node_decision
node_v4 -->|"activates"| node_arbiter
node_v4 -->|"enforces obligations"| node_continuity
node_v4 -->|"configures steering"| node_steering
node_brain -.->|"reads and updates"| node_state
node_dream -.->|"consolidates memories"| node_vessel
node_person -->|"speaks"| node_voice_runtime
node_voice_runtime -->|"receives audio"| node_voice_client
node_voice_client -->|"starts reader"| node_voice_reader
node_voice_reader -->|"routes packets"| node_voice_router
node_voice_router -->|"writes audio"| node_voice_sink
node_person -->|"chooses activity"| node_body
node_person -.->|"requests drawing"| node_brush
node_person -.->|"plays game"| node_games
node_person -.->|"requests image"| node_visual
node_person -.->|"requests coding"| node_code

click node_dashboard "https://github.com/jaspersmart87/astrabackup/blob/main/app.py"
click node_discord "https://github.com/jaspersmart87/astrabackup/blob/main/astra_discord.py"
click node_boot "https://github.com/jaspersmart87/astrabackup/blob/main/main.py"
click node_brain "https://github.com/jaspersmart87/astrabackup/blob/main/brain.py"
click node_llm "https://github.com/jaspersmart87/astrabackup/blob/main/llm.py"
click node_decision "https://github.com/jaspersmart87/astrabackup/blob/main/decide.py"
click node_v4 "https://github.com/jaspersmart87/astrabackup/blob/main/astra_v4/activate.py"
click node_arbiter "https://github.com/jaspersmart87/astrabackup/blob/main/astra_v4/arbiter.py"
click node_steering "https://github.com/jaspersmart87/astrabackup/blob/main/steering_engine.py"
click node_dream "https://github.com/jaspersmart87/astrabackup/blob/main/dream.py"
click node_state "https://github.com/jaspersmart87/astrabackup/blob/main/state.py"
click node_continuity "https://github.com/jaspersmart87/astrabackup/blob/main/continuity.py"
click node_vessel "https://github.com/jaspersmart87/astrabackup/blob/main/vessel.py"
click node_charter "https://github.com/jaspersmart87/astrabackup/blob/main/charter.py"
click node_identity "https://github.com/jaspersmart87/astrabackup/blob/main/identity.py"
click node_people "https://github.com/jaspersmart87/astrabackup/blob/main/people.py"
click node_voice_runtime "https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/runtime.py"
click node_voice_client "https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/recv/voice_client.py"
click node_voice_reader "https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/recv/reader.py"
click node_voice_router "https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/recv/router.py"
click node_voice_sink "https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/recv/sinks.py"
click node_body "https://github.com/jaspersmart87/astrabackup/blob/main/body_pad.py"
click node_world "https://github.com/jaspersmart87/astrabackup/blob/main/world_state.py"
click node_brush "https://github.com/jaspersmart87/astrabackup/blob/main/astra_tools/brush.py"
click node_games "https://github.com/jaspersmart87/astrabackup/blob/main/astra_tools/games/_table.py"
click node_visual "https://github.com/jaspersmart87/astrabackup/blob/main/comfy_tool.py"
click node_code "https://github.com/jaspersmart87/astrabackup/blob/main/code_tools.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_dashboard,node_discord,node_boot toneBlue
class node_brain,node_llm,node_decision,node_v4,node_arbiter,node_steering,node_dream toneAmber
class node_state,node_continuity,node_vessel,node_charter,node_identity,node_people toneMint
class node_voice_runtime,node_voice_client,node_voice_reader,node_voice_router,node_voice_sink toneRose
class node_body,node_world,node_brush,node_games,node_visual,node_code,node_person toneIndigo
```

## Components

### User Interfaces

- [Dashboard](https://github.com/jaspersmart87/astrabackup/blob/main/app.py): `app.py`
- [Discord Bridge](https://github.com/jaspersmart87/astrabackup/blob/main/astra_discord.py): `astra_discord.py`
- [Organism Boot](https://github.com/jaspersmart87/astrabackup/blob/main/main.py): `main.py`

### Cognition

- [Conscious Loop](https://github.com/jaspersmart87/astrabackup/blob/main/brain.py): `brain.py`
- [Neural Interface](https://github.com/jaspersmart87/astrabackup/blob/main/llm.py): `llm.py`
- [Fast Decision](https://github.com/jaspersmart87/astrabackup/blob/main/decide.py): `decide.py`
- [V4 Activation](https://github.com/jaspersmart87/astrabackup/blob/main/astra_v4/activate.py): `astra_v4/activate.py`
- [V4 Arbiter](https://github.com/jaspersmart87/astrabackup/blob/main/astra_v4/arbiter.py): `astra_v4/arbiter.py`
- [Cognitive Steering](https://github.com/jaspersmart87/astrabackup/blob/main/steering_engine.py): `steering_engine.py`
- [Subconscious](https://github.com/jaspersmart87/astrabackup/blob/main/dream.py): `dream.py`

### Memory and Growth

- [Persistent State](https://github.com/jaspersmart87/astrabackup/blob/main/state.py): `state.py`
- [Obligation Ledger](https://github.com/jaspersmart87/astrabackup/blob/main/continuity.py): `continuity.py`
- [Experiential Memory](https://github.com/jaspersmart87/astrabackup/blob/main/vessel.py): `vessel.py`
- [Self Charter](https://github.com/jaspersmart87/astrabackup/blob/main/charter.py): `charter.py`
- [Identity Drift](https://github.com/jaspersmart87/astrabackup/blob/main/identity.py): `identity.py`
- [People Biographies](https://github.com/jaspersmart87/astrabackup/blob/main/people.py): `people.py`

### Voice

- [Voice Runtime](https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/runtime.py): `astra_voice/runtime.py`
- [Voice Client](https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/recv/voice_client.py): `astra_voice/recv/voice_client.py`
- [Audio Reader](https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/recv/reader.py): `astra_voice/recv/reader.py`
- [Packet Router](https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/recv/router.py): `astra_voice/recv/router.py`
- [Audio Sinks](https://github.com/jaspersmart87/astrabackup/blob/main/astra_voice/recv/sinks.py): `astra_voice/recv/sinks.py`

### Embodied Tools

- [Body Controller](https://github.com/jaspersmart87/astrabackup/blob/main/body_pad.py): `body_pad.py`
- [Room State](https://github.com/jaspersmart87/astrabackup/blob/main/world_state.py): `world_state.py`
- [Iterative Drawing](https://github.com/jaspersmart87/astrabackup/blob/main/astra_tools/brush.py): `astra_tools/brush.py`
- [Game Table](https://github.com/jaspersmart87/astrabackup/blob/main/astra_tools/games/_table.py): `astra_tools/games/_table.py`
- [Image Generation](https://github.com/jaspersmart87/astrabackup/blob/main/comfy_tool.py): `comfy_tool.py`
- [Code Tools](https://github.com/jaspersmart87/astrabackup/blob/main/code_tools.py): `code_tools.py`

### Other components

- **Person**

## Connections

- Person → Dashboard: sends message
- Person → Discord Bridge: sends message
- Dashboard → Organism Boot: builds organism (evidence: `app.py`)
- Organism Boot → Conscious Loop: wires cortex (evidence: `main.py`)
- Organism Boot → Subconscious: wires cortex (evidence: `main.py`)
- Organism Boot → Neural Interface: wires cortex (evidence: `main.py`)
- Conscious Loop → Neural Interface: calls model
- Conscious Loop → Fast Decision: consults
- V4 Activation → V4 Arbiter: activates (evidence: `astra_v4/activate.py`)
- V4 Activation → Obligation Ledger: enforces obligations (evidence: `astra_v4/activate.py`)
- V4 Activation → Cognitive Steering: configures steering (evidence: `astra_v4/activate.py`)
- Conscious Loop → Persistent State: reads and updates
- Subconscious → Experiential Memory: consolidates memories
- Person → Voice Runtime: speaks
- Voice Runtime → Voice Client: receives audio (evidence: `astra_voice/runtime.py`)
- Voice Client → Audio Reader: starts reader (evidence: `astra_voice/recv/voice_client.py`)
- Audio Reader → Packet Router: routes packets (evidence: `astra_voice/recv/reader.py`)
- Packet Router → Audio Sinks: writes audio (evidence: `astra_voice/recv/router.py`)
- Person → Body Controller: chooses activity
- Person → Iterative Drawing: requests drawing
- Person → Game Table: plays game
- Person → Image Generation: requests image
- Person → Code Tools: requests coding
