# pacenak/sol-full architecture

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

- Interactive diagram: https://gitdiagram.com/pacenak/sol-full
- Repository: https://github.com/pacenak/sol-full

## Overview

SOL is a self-hosted, multi-sector AI hub with a central runtime and an administrative Command control plane for pairing and managing Outposts. The principal flow is user authentication, sector-scoped chat and agent work, optional retrieval or research, then persistence of sessions and other state. The graph also preserves documented capabilities such as MCP, skills, policies, and fleet management. Several backend subsystems are represented from README and SOURCE INDEX evidence rather than inspected implementation; their internal call paths are therefore not asserted.

Main entry points: [`app.py`](https://github.com/pacenak/sol-full/blob/main/app.py) (FastAPI Runtime), [`routes/hub_routes.py`](https://github.com/pacenak/sol-full/blob/main/routes/hub_routes.py) (Command API), [`routes/chat_helpers.py`](https://github.com/pacenak/sol-full/blob/main/routes/chat_helpers.py) (Chat and Agents), [`core/auth.py`](https://github.com/pacenak/sol-full/blob/main/core/auth.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["AI Runtime"]
  node_app["FastAPI Runtime<br/>[app.py]"]
  node_chat["Chat and Agents<br/>[chat_helpers.py]"]
  node_skills["Skills API<br/>[skills_routes.py]"]
  node_sectors["Sector Workspaces<br/>[branches.py]"]
  node_presets["Persona Presets<br/>[preset_manager.py]"]
end

subgraph group_state["Identity and State"]
  node_sessions["Session Manager<br/>[session_manager.py]"]
  node_database[("Application Database<br/>[database.py]")]
  node_auth["Authentication<br/>[auth.py]"]
  node_middleware["Request Authorization<br/>[middleware.py]"]
  node_authroutes["Auth Routes<br/>[auth_routes.py]"]
  node_settings["Settings and Features<br/>[settings.py]"]
  node_shared["Shared Sector Data<br/>[shared_data.py]"]
  node_atomic["Atomic File I/O<br/>[atomic_io.py]"]
  node_authhelpers["Auth Helpers<br/>[auth_helpers.py]"]
end

subgraph group_command["SOL Command"]
  node_commandroutes["Command API<br/>[hub_routes.py]"]
  node_pairing["Outpost Pairing<br/>[pairing.py]"]
  node_policies["Sector Policies<br/>[policies.py]"]
  node_packs["Branch Packs<br/>[packs.py]"]
  node_fleet["Fleet Models<br/>[fleet_models.py]"]
  node_immune["Immune System<br/>[immune_system.py]"]
end

subgraph group_integrations["Knowledge and Integrations"]
  node_rag["Vector RAG<br/>[rag_vector.py]"]
  node_ragroutes["Embedding Management"]
  node_research["Deep Research"]
  node_mcp["MCP Integrations<br/>[mcp_manager.py]"]
end

node_user(("User"))
node_outpost(("Paired Outpost"))

node_user -->|"uses"| node_app
node_app -->|"serves"| node_authroutes
node_app -->|"configures"| node_middleware
node_middleware -->|"checks identity"| node_auth
node_authroutes -.->|"manages accounts"| node_auth
node_app -.->|"serves chat"| node_chat
node_chat -.->|"persists sessions"| node_sessions
node_sessions -->|"reads and writes"| node_database
node_chat -.->|"retrieves context"| node_rag
node_chat -.->|"starts research"| node_research
node_chat -.->|"uses tools"| node_mcp
node_app -.->|"provides workspaces"| node_sectors
node_sectors -.->|"scopes shared data"| node_shared
node_app -->|"uses configuration"| node_settings
node_settings -->|"persists settings"| node_atomic
node_app -->|"serves Command"| node_commandroutes
node_commandroutes -->|"handles pairing"| node_pairing
node_commandroutes -->|"manages policies"| node_policies
node_commandroutes -->|"manages packs"| node_packs
node_commandroutes -->|"manages fleet models"| node_fleet
node_commandroutes -.->|"manages defenses"| node_immune
node_outpost -->|"requests pairing"| node_pairing
node_outpost -->|"syncs packs"| node_commandroutes
node_app -.->|"serves embeddings"| node_ragroutes
node_app -.->|"serves skills"| node_skills
node_auth -->|"uses account store"| node_database
node_chat -.->|"uses personas"| node_presets
node_app -.->|"uses authorization helpers"| node_authhelpers

click node_app "https://github.com/pacenak/sol-full/blob/main/app.py"
click node_chat "https://github.com/pacenak/sol-full/blob/main/routes/chat_helpers.py"
click node_skills "https://github.com/pacenak/sol-full/blob/main/routes/skills_routes.py"
click node_sessions "https://github.com/pacenak/sol-full/blob/main/core/session_manager.py"
click node_database "https://github.com/pacenak/sol-full/blob/main/core/database.py"
click node_auth "https://github.com/pacenak/sol-full/blob/main/core/auth.py"
click node_middleware "https://github.com/pacenak/sol-full/blob/main/core/middleware.py"
click node_authroutes "https://github.com/pacenak/sol-full/blob/main/routes/auth_routes.py"
click node_settings "https://github.com/pacenak/sol-full/blob/main/src/settings.py"
click node_shared "https://github.com/pacenak/sol-full/blob/main/src/shared_data.py"
click node_sectors "https://github.com/pacenak/sol-full/blob/main/src/branches.py"
click node_rag "https://github.com/pacenak/sol-full/blob/main/src/rag_vector.py"
click node_ragroutes "https://github.com/pacenak/sol-full/blob/main/routes/embedding_routes.py"
click node_research "https://github.com/pacenak/sol-full/blob/main/services/research/research_handler.py"
click node_mcp "https://github.com/pacenak/sol-full/blob/main/src/mcp_manager.py"
click node_commandroutes "https://github.com/pacenak/sol-full/blob/main/routes/hub_routes.py"
click node_pairing "https://github.com/pacenak/sol-full/blob/main/hub/pairing.py"
click node_policies "https://github.com/pacenak/sol-full/blob/main/hub/policies.py"
click node_packs "https://github.com/pacenak/sol-full/blob/main/hub/packs.py"
click node_fleet "https://github.com/pacenak/sol-full/blob/main/hub/fleet_models.py"
click node_immune "https://github.com/pacenak/sol-full/blob/main/hub/immune_system.py"
click node_atomic "https://github.com/pacenak/sol-full/blob/main/core/atomic_io.py"
click node_authhelpers "https://github.com/pacenak/sol-full/blob/main/src/auth_helpers.py"
click node_presets "https://github.com/pacenak/sol-full/blob/main/src/preset_manager.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_app,node_chat,node_skills,node_sectors,node_presets,node_user toneBlue
class node_sessions,node_database,node_auth,node_middleware,node_authroutes,node_settings,node_shared,node_atomic,node_authhelpers toneAmber
class node_commandroutes,node_pairing,node_policies,node_packs,node_fleet,node_immune toneMint
class node_rag,node_ragroutes,node_research,node_mcp toneRose
class node_outpost toneIndigo
```

## Components

### AI Runtime

- [FastAPI Runtime](https://github.com/pacenak/sol-full/blob/main/app.py): `app.py`
- [Chat and Agents](https://github.com/pacenak/sol-full/blob/main/routes/chat_helpers.py): `routes/chat_helpers.py`
- [Skills API](https://github.com/pacenak/sol-full/blob/main/routes/skills_routes.py): `routes/skills_routes.py`
- [Sector Workspaces](https://github.com/pacenak/sol-full/blob/main/src/branches.py): `src/branches.py`
- [Persona Presets](https://github.com/pacenak/sol-full/blob/main/src/preset_manager.py): `src/preset_manager.py`

### Identity and State

- [Session Manager](https://github.com/pacenak/sol-full/blob/main/core/session_manager.py): `core/session_manager.py`
- [Application Database](https://github.com/pacenak/sol-full/blob/main/core/database.py): `core/database.py`
- [Authentication](https://github.com/pacenak/sol-full/blob/main/core/auth.py): `core/auth.py`
- [Request Authorization](https://github.com/pacenak/sol-full/blob/main/core/middleware.py): `core/middleware.py`
- [Auth Routes](https://github.com/pacenak/sol-full/blob/main/routes/auth_routes.py): `routes/auth_routes.py`
- [Settings and Features](https://github.com/pacenak/sol-full/blob/main/src/settings.py): `src/settings.py`
- [Shared Sector Data](https://github.com/pacenak/sol-full/blob/main/src/shared_data.py): `src/shared_data.py`
- [Atomic File I/O](https://github.com/pacenak/sol-full/blob/main/core/atomic_io.py): `core/atomic_io.py`
- [Auth Helpers](https://github.com/pacenak/sol-full/blob/main/src/auth_helpers.py): `src/auth_helpers.py`

### SOL Command

- [Command API](https://github.com/pacenak/sol-full/blob/main/routes/hub_routes.py): `routes/hub_routes.py`
- [Outpost Pairing](https://github.com/pacenak/sol-full/blob/main/hub/pairing.py): `hub/pairing.py`
- [Sector Policies](https://github.com/pacenak/sol-full/blob/main/hub/policies.py): `hub/policies.py`
- [Branch Packs](https://github.com/pacenak/sol-full/blob/main/hub/packs.py): `hub/packs.py`
- [Fleet Models](https://github.com/pacenak/sol-full/blob/main/hub/fleet_models.py): `hub/fleet_models.py`
- [Immune System](https://github.com/pacenak/sol-full/blob/main/hub/immune_system.py): `hub/immune_system.py`

### Knowledge and Integrations

- [Vector RAG](https://github.com/pacenak/sol-full/blob/main/src/rag_vector.py): `src/rag_vector.py`
- [Embedding Management](https://github.com/pacenak/sol-full/blob/main/routes/embedding_routes.py): `routes/embedding_routes.py`
- [Deep Research](https://github.com/pacenak/sol-full/blob/main/services/research/research_handler.py): `services/research/research_handler.py`
- [MCP Integrations](https://github.com/pacenak/sol-full/blob/main/src/mcp_manager.py): `src/mcp_manager.py`

### Other components

- **User**
- **Paired Outpost**

## Connections

- User → FastAPI Runtime: uses (evidence: `README.md`)
- FastAPI Runtime → Auth Routes: serves (evidence: `app.py`)
- FastAPI Runtime → Request Authorization: configures (evidence: `app.py`)
- Request Authorization → Authentication: checks identity (evidence: `core/middleware.py`)
- Auth Routes → Authentication: manages accounts
- FastAPI Runtime → Chat and Agents: serves chat
- Chat and Agents → Session Manager: persists sessions
- Session Manager → Application Database: reads and writes (evidence: `core/session_manager.py`)
- Chat and Agents → Vector RAG: retrieves context
- Chat and Agents → Deep Research: starts research
- Chat and Agents → MCP Integrations: uses tools
- FastAPI Runtime → Sector Workspaces: provides workspaces
- Sector Workspaces → Shared Sector Data: scopes shared data
- FastAPI Runtime → Settings and Features: uses configuration (evidence: `src/settings.py`)
- Settings and Features → Atomic File I/O: persists settings (evidence: `src/settings.py`)
- FastAPI Runtime → Command API: serves Command (evidence: `README.md`)
- Command API → Outpost Pairing: handles pairing (evidence: `routes/hub_routes.py`)
- Command API → Sector Policies: manages policies (evidence: `routes/hub_routes.py`)
- Command API → Branch Packs: manages packs (evidence: `routes/hub_routes.py`)
- Command API → Fleet Models: manages fleet models (evidence: `routes/hub_routes.py`)
- Command API → Immune System: manages defenses (evidence: `routes/hub_routes.py`)
- Paired Outpost → Outpost Pairing: requests pairing (evidence: `README.md`)
- Paired Outpost → Command API: syncs packs (evidence: `README.md`)
- FastAPI Runtime → Embedding Management: serves embeddings
- FastAPI Runtime → Skills API: serves skills (evidence: `app.py`)
- Authentication → Application Database: uses account store (evidence: `core/auth.py`)
- Chat and Agents → Persona Presets: uses personas
- FastAPI Runtime → Auth Helpers: uses authorization helpers (evidence: `app.py`)
