# mattmezza/humux architecture

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

- Interactive diagram: https://gitdiagram.com/mattmezza/humux
- Repository: https://github.com/mattmezza/humux

## Overview

Humux is a self-hosted personal AI agent that brings messaging, tools, memory, and proactive jobs into one assistant. The main workflow is a user message arriving through Telegram, passing to AgentCore for model-driven reasoning and tool use, then returning as a reply; voice can transcribe incoming audio and synthesize spoken responses. Separate branches cover agent identities and administration, persistent memory, scheduled work, and integrations. Relationships are based on the supplied excerpts, SOURCE INDEX references, and README; unsampled implementation details are not inferred.

Main entry points: [`humux/core/agent.py`](https://github.com/mattmezza/humux/blob/main/humux/core/agent.py) (AgentCore), [`humux/channels/telegram.py`](https://github.com/mattmezza/humux/blob/main/humux/channels/telegram.py) (Telegram channel), [`humux/core/main.py`](https://github.com/mattmezza/humux/blob/main/humux/core/main.py) (Application startup), [`humux/core/scheduler.py`](https://github.com/mattmezza/humux/blob/main/humux/core/scheduler.py) (Scheduler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Channels and API"]
  node_telegram["Telegram channel<br/>[telegram.py]"]
  node_admin["Admin API<br/>[admin.py]"]
  node_voice["Voice pipeline<br/>[pipeline.py]"]
end

subgraph group_runtime["Agent runtime"]
  node_agent["AgentCore<br/>[agent.py]"]
  node_llm["LLM clients<br/>[llm.py]"]
  node_prompt["Prompt builder<br/>[prompt_builder.py]"]
  node_reasoning["Reasoning<br/>[reasoning.py]"]
  node_decomposition["Goal decomposition"]
  node_main["Application startup<br/>[main.py]"]
end

subgraph group_state["Identity and state"]
  node_agents[("Agent identities<br/>[agents.py]")]
  node_config["Configuration<br/>[config.py]"]
  node_config_store[("Config store<br/>[config_store.py]")]
  node_history[("Conversation history<br/>[history.py]")]
  node_memory[("Persistent memory<br/>[memory.py]")]
  node_embeddings["Embeddings<br/>[embeddings.py]"]
end

subgraph group_capabilities["Tools and capabilities"]
  node_skills["Skills engine<br/>[skills.py]"]
  node_tools["Tool registry<br/>[tools.py]"]
  node_browser["Browser automation<br/>[browser.py]"]
  node_artifacts["Web artifacts<br/>[artifacts.py]"]
  node_research["Deep research<br/>[deep_research.py]"]
  node_subagents["Subagents<br/>[subagents.py]"]
  node_calendar["Calendar tools<br/>[calendar_read.py]"]
  node_contacts["Contacts tools<br/>[contacts.py]"]
  node_whatsapp["WhatsApp CLI<br/>[wacli.py]"]
end

subgraph group_operations["Proactive operations"]
  node_scheduler["Scheduler<br/>[scheduler.py]"]
  node_jobs[("Job store<br/>[job_store.py]")]
end

node_user(("User"))
node_voice_service["Whistle STT service<br/>[server.py]"]

node_user -->|"sends message"| node_telegram
node_telegram -->|"dispatches turn"| node_agent
node_telegram -->|"uses voice"| node_voice
node_agent -.->|"sends reply"| node_telegram
node_agent -->|"requests completion"| node_llm
node_agent -.->|"builds prompt"| node_prompt
node_agent -.->|"uses reasoning"| node_reasoning
node_agent -.->|"decomposes goals"| node_decomposition
node_agent -.->|"reads and writes"| node_memory
node_memory -->|"retrieves vectors"| node_embeddings
node_agent -.->|"resolves identity"| node_agents
node_agent -.->|"loads skills"| node_skills
node_agent -->|"offers tools"| node_tools
node_tools -.->|"enables browsing"| node_browser
node_agent -.->|"creates artifacts"| node_artifacts
node_agent -.->|"runs research"| node_research
node_agent -.->|"delegates tasks"| node_subagents
node_scheduler -->|"runs scheduled work"| node_agent
node_scheduler -->|"reads and writes jobs"| node_jobs
node_agent -.->|"records conversation"| node_history
node_main -->|"starts scheduler"| node_scheduler
node_main -->|"starts channel"| node_telegram
node_main -->|"starts API"| node_admin
node_admin -->|"manages settings"| node_config_store
node_main -->|"loads settings"| node_config_store
node_voice -.->|"uses remote STT"| node_voice_service
node_agent -.->|"uses calendar tools"| node_calendar
node_agent -.->|"uses contacts tools"| node_contacts
node_agent -.->|"uses WhatsApp CLI"| node_whatsapp

click node_telegram "https://github.com/mattmezza/humux/blob/main/humux/channels/telegram.py"
click node_admin "https://github.com/mattmezza/humux/blob/main/humux/api/admin.py"
click node_voice "https://github.com/mattmezza/humux/blob/main/humux/voice/pipeline.py"
click node_agent "https://github.com/mattmezza/humux/blob/main/humux/core/agent.py"
click node_llm "https://github.com/mattmezza/humux/blob/main/humux/core/llm.py"
click node_prompt "https://github.com/mattmezza/humux/blob/main/humux/core/prompt_builder.py"
click node_reasoning "https://github.com/mattmezza/humux/blob/main/humux/core/reasoning.py"
click node_decomposition "https://github.com/mattmezza/humux/blob/main/humux/core/goal_decomposition.py"
click node_main "https://github.com/mattmezza/humux/blob/main/humux/core/main.py"
click node_agents "https://github.com/mattmezza/humux/blob/main/humux/core/agents.py"
click node_config "https://github.com/mattmezza/humux/blob/main/humux/core/config.py"
click node_config_store "https://github.com/mattmezza/humux/blob/main/humux/core/config_store.py"
click node_history "https://github.com/mattmezza/humux/blob/main/humux/core/history.py"
click node_memory "https://github.com/mattmezza/humux/blob/main/humux/core/memory.py"
click node_embeddings "https://github.com/mattmezza/humux/blob/main/humux/core/embeddings.py"
click node_skills "https://github.com/mattmezza/humux/blob/main/humux/core/skills.py"
click node_tools "https://github.com/mattmezza/humux/blob/main/humux/core/tools.py"
click node_browser "https://github.com/mattmezza/humux/blob/main/humux/tools/browser.py"
click node_artifacts "https://github.com/mattmezza/humux/blob/main/humux/core/artifacts.py"
click node_research "https://github.com/mattmezza/humux/blob/main/humux/core/deep_research.py"
click node_subagents "https://github.com/mattmezza/humux/blob/main/humux/core/subagents.py"
click node_scheduler "https://github.com/mattmezza/humux/blob/main/humux/core/scheduler.py"
click node_jobs "https://github.com/mattmezza/humux/blob/main/humux/core/job_store.py"
click node_calendar "https://github.com/mattmezza/humux/blob/main/humux/tools/calendar_read.py"
click node_contacts "https://github.com/mattmezza/humux/blob/main/humux/tools/contacts.py"
click node_whatsapp "https://github.com/mattmezza/humux/blob/main/humux/core/wacli.py"
click node_voice_service "https://github.com/mattmezza/humux/blob/main/whistle/server.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_telegram,node_admin,node_voice,node_user toneBlue
class node_agent,node_llm,node_prompt,node_reasoning,node_decomposition,node_main toneAmber
class node_agents,node_config,node_config_store,node_history,node_memory,node_embeddings toneMint
class node_skills,node_tools,node_browser,node_artifacts,node_research,node_subagents,node_calendar,node_contacts,node_whatsapp toneRose
class node_scheduler,node_jobs toneIndigo
class node_voice_service toneTeal
```

## Components

### Channels and API

- [Telegram channel](https://github.com/mattmezza/humux/blob/main/humux/channels/telegram.py): `humux/channels/telegram.py`
- [Admin API](https://github.com/mattmezza/humux/blob/main/humux/api/admin.py): `humux/api/admin.py`
- [Voice pipeline](https://github.com/mattmezza/humux/blob/main/humux/voice/pipeline.py): `humux/voice/pipeline.py`

### Agent runtime

- [AgentCore](https://github.com/mattmezza/humux/blob/main/humux/core/agent.py): `humux/core/agent.py`
- [LLM clients](https://github.com/mattmezza/humux/blob/main/humux/core/llm.py): `humux/core/llm.py`
- [Prompt builder](https://github.com/mattmezza/humux/blob/main/humux/core/prompt_builder.py): `humux/core/prompt_builder.py`
- [Reasoning](https://github.com/mattmezza/humux/blob/main/humux/core/reasoning.py): `humux/core/reasoning.py`
- [Goal decomposition](https://github.com/mattmezza/humux/blob/main/humux/core/goal_decomposition.py): `humux/core/goal_decomposition.py`
- [Application startup](https://github.com/mattmezza/humux/blob/main/humux/core/main.py): `humux/core/main.py`

### Identity and state

- [Agent identities](https://github.com/mattmezza/humux/blob/main/humux/core/agents.py): `humux/core/agents.py`
- [Configuration](https://github.com/mattmezza/humux/blob/main/humux/core/config.py): `humux/core/config.py`
- [Config store](https://github.com/mattmezza/humux/blob/main/humux/core/config_store.py): `humux/core/config_store.py`
- [Conversation history](https://github.com/mattmezza/humux/blob/main/humux/core/history.py): `humux/core/history.py`
- [Persistent memory](https://github.com/mattmezza/humux/blob/main/humux/core/memory.py): `humux/core/memory.py`
- [Embeddings](https://github.com/mattmezza/humux/blob/main/humux/core/embeddings.py): `humux/core/embeddings.py`

### Tools and capabilities

- [Skills engine](https://github.com/mattmezza/humux/blob/main/humux/core/skills.py): `humux/core/skills.py`
- [Tool registry](https://github.com/mattmezza/humux/blob/main/humux/core/tools.py): `humux/core/tools.py`
- [Browser automation](https://github.com/mattmezza/humux/blob/main/humux/tools/browser.py): `humux/tools/browser.py`
- [Web artifacts](https://github.com/mattmezza/humux/blob/main/humux/core/artifacts.py): `humux/core/artifacts.py`
- [Deep research](https://github.com/mattmezza/humux/blob/main/humux/core/deep_research.py): `humux/core/deep_research.py`
- [Subagents](https://github.com/mattmezza/humux/blob/main/humux/core/subagents.py): `humux/core/subagents.py`
- [Calendar tools](https://github.com/mattmezza/humux/blob/main/humux/tools/calendar_read.py): `humux/tools/calendar_read.py`
- [Contacts tools](https://github.com/mattmezza/humux/blob/main/humux/tools/contacts.py): `humux/tools/contacts.py`
- [WhatsApp CLI](https://github.com/mattmezza/humux/blob/main/humux/core/wacli.py): `humux/core/wacli.py`

### Proactive operations

- [Scheduler](https://github.com/mattmezza/humux/blob/main/humux/core/scheduler.py): `humux/core/scheduler.py`
- [Job store](https://github.com/mattmezza/humux/blob/main/humux/core/job_store.py): `humux/core/job_store.py`

### Other components

- **User**
- [Whistle STT service](https://github.com/mattmezza/humux/blob/main/whistle/server.py): `whistle/server.py`

## Connections

- User → Telegram channel: sends message (evidence: `humux/channels/telegram.py`)
- Telegram channel → AgentCore: dispatches turn (evidence: `humux/channels/telegram.py`)
- Telegram channel → Voice pipeline: uses voice (evidence: `humux/channels/telegram.py`)
- AgentCore → Telegram channel: sends reply (evidence: `humux/channels/telegram.py`)
- AgentCore → LLM clients: requests completion (evidence: `humux/core/agent.py`)
- AgentCore → Prompt builder: builds prompt (evidence: `humux/core/agent.py`)
- AgentCore → Reasoning: uses reasoning
- AgentCore → Goal decomposition: decomposes goals (evidence: `humux/core/agent.py`)
- AgentCore → Persistent memory: reads and writes (evidence: `humux/core/agent.py`)
- Persistent memory → Embeddings: retrieves vectors (evidence: `humux/core/memory.py`)
- AgentCore → Agent identities: resolves identity (evidence: `humux/core/agent.py`)
- AgentCore → Skills engine: loads skills (evidence: `humux/core/agent.py`)
- AgentCore → Tool registry: offers tools (evidence: `humux/core/agent.py`)
- Tool registry → Browser automation: enables browsing
- AgentCore → Web artifacts: creates artifacts (evidence: `humux/core/agent.py`)
- AgentCore → Deep research: runs research (evidence: `humux/core/agent.py`)
- AgentCore → Subagents: delegates tasks (evidence: `humux/core/agent.py`)
- Scheduler → AgentCore: runs scheduled work (evidence: `humux/core/scheduler.py`)
- Scheduler → Job store: reads and writes jobs (evidence: `humux/core/scheduler.py`)
- AgentCore → Conversation history: records conversation (evidence: `humux/core/agent.py`)
- Application startup → Scheduler: starts scheduler (evidence: `humux/core/main.py`)
- Application startup → Telegram channel: starts channel (evidence: `humux/core/main.py`)
- Application startup → Admin API: starts API (evidence: `humux/core/main.py`)
- Admin API → Config store: manages settings (evidence: `humux/api/admin.py`)
- Application startup → Config store: loads settings (evidence: `humux/core/main.py`)
- Voice pipeline → Whistle STT service: uses remote STT
- AgentCore → Calendar tools: uses calendar tools
- AgentCore → Contacts tools: uses contacts tools
- AgentCore → WhatsApp CLI: uses WhatsApp CLI
