# jjjjstiyyyy/apixis architecture

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

- Interactive diagram: https://gitdiagram.com/jjjjstiyyyy/apixis
- Repository: https://github.com/jjjjstiyyyy/apixis

## Overview

APIXIS is an asyncio library with two composable runtimes: an event system and a stateful graph orchestrator. The documented graph workflow is to build and compile a graph, invoke it with state, and receive the resulting state; graph nodes can issue commands, run in parallel, stream output, and support interruption and resume. The event runtime provides subscriptions, ordered handlers, backpressure, and a local queue. Relationships use README statements and SOURCE INDEX references; unsampled implementation details are not assumed.

Main entry points: [`source/apixis/core/graph/node_graph.py`](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/node_graph.py) (Graph runtime), [`source/apixis/core/event/factory.py`](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/factory.py) (Event core factory), [`source/apixis/core/event/event_loop.py`](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/event_loop.py) (Event dispatch loop), [`source/apixis/core/graph/context/manager.py`](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/context/manager.py) (Context access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_graph["Graph runtime"]
  node_manager["Graph manager<br/>[graph_manager.py]"]
  node_runtime["Graph runtime<br/>[node_graph.py]"]
  node_nodes["Graph nodes<br/>[node.py]"]
  node_commands["Commands and state<br/>[base.py]"]
  node_context["Invocation context<br/>[graph_context.py]"]
  node_context_api["Context access<br/>[manager.py]"]
  node_stream["Stream writer<br/>[stream_writer.py]"]
  node_namespace["Graph namespaces<br/>[namespace.py]"]
  node_interrupt["Interrupt and resume"]
  node_block["Interrupt block<br/>[block.py]"]
end

subgraph group_events["Event runtime"]
  node_event_factory["Event core factory<br/>[factory.py]"]
  node_event_pipe["Local event queue<br/>[event_pipe.py]"]
  node_event_loop["Event dispatch loop<br/>[event_loop.py]"]
  node_event_registry["Event registry<br/>[event_registry.py]"]
  node_handler_registry["Handler registry"]
  node_handlers["Handlers and subscriptions<br/>[base.py]"]
  node_subscription["Subscription API<br/>[subscription.py]"]
end

subgraph group_support["Shared support"]
  node_config["Runtime configuration<br/>[core_config.py]"]
  node_logger["Logging<br/>[logger.py]"]
  node_exceptions["Runtime exceptions<br/>[exception.py]"]
  node_ids["ID generation<br/>[id_generator.py]"]
end

node_user(("Asyncio application"))

node_user -->|"builds graph"| node_manager
node_manager -->|"compiles graph"| node_runtime
node_user -->|"invokes graph"| node_runtime
node_runtime -->|"executes nodes"| node_nodes
node_nodes -->|"returns commands"| node_commands
node_runtime -->|"applies updates"| node_commands
node_runtime -->|"binds invocation"| node_context
node_context_api -->|"reads context"| node_context
node_context_api -->|"gets writer"| node_stream
node_context_api -->|"resolves namespace"| node_namespace
node_runtime -->|"binds node context"| node_context_api
node_runtime -->|"claims namespace"| node_namespace
node_runtime -->|"handles interruptions"| node_interrupt
node_interrupt -->|"creates block"| node_block
node_interrupt -->|"gets event pipe"| node_event_factory
node_runtime -->|"posts dispatch"| node_event_factory
node_event_factory -->|"constructs core"| node_event_pipe
node_event_factory -->|"constructs core"| node_event_loop
node_event_factory -->|"constructs core"| node_event_registry
node_event_factory -->|"constructs core"| node_handler_registry
node_event_loop -->|"consumes events"| node_event_pipe
node_event_loop -->|"selects handlers"| node_handler_registry
node_event_loop -->|"resolves events"| node_event_registry
node_handler_registry -->|"matches event names"| node_event_registry
node_handlers -->|"logs execution"| node_logger
node_subscription -->|"gets event core"| node_event_factory
node_event_pipe -->|"reads settings"| node_config
node_logger -->|"reads settings"| node_config
node_runtime -->|"generates IDs"| node_ids
node_runtime -->|"raises runtime errors"| node_exceptions
node_handler_registry -->|"raises registration errors"| node_exceptions

click node_manager "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/graph_manager.py"
click node_runtime "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/node_graph.py"
click node_nodes "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/node.py"
click node_commands "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/base.py"
click node_context "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/context/graph_context.py"
click node_context_api "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/context/manager.py"
click node_stream "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/context/stream_writer.py"
click node_namespace "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/utils/namespace.py"
click node_interrupt "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/interrupter/graph_interrupter.py"
click node_block "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/interrupter/block.py"
click node_event_factory "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/factory.py"
click node_event_pipe "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/event_pipe.py"
click node_event_loop "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/event_loop.py"
click node_event_registry "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/event_registry.py"
click node_handler_registry "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/handler_registry.py"
click node_handlers "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/base.py"
click node_subscription "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/subscription.py"
click node_config "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/config/core_config.py"
click node_logger "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/utils/logger.py"
click node_exceptions "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/utils/exception.py"
click node_ids "https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/utils/id_generator.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_manager,node_runtime,node_nodes,node_commands,node_context,node_context_api,node_stream,node_namespace,node_interrupt,node_block toneBlue
class node_event_factory,node_event_pipe,node_event_loop,node_event_registry,node_handler_registry,node_handlers,node_subscription toneAmber
class node_config,node_logger,node_exceptions,node_ids toneMint
class node_user toneIndigo
```

## Components

### Graph runtime

- [Graph manager](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/graph_manager.py): `source/apixis/core/graph/graph_manager.py`
- [Graph runtime](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/node_graph.py): `source/apixis/core/graph/node_graph.py`
- [Graph nodes](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/node.py): `source/apixis/core/graph/node.py`
- [Commands and state](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/base.py): `source/apixis/core/graph/base.py`
- [Invocation context](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/context/graph_context.py): `source/apixis/core/graph/context/graph_context.py`
- [Context access](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/context/manager.py): `source/apixis/core/graph/context/manager.py`
- [Stream writer](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/context/stream_writer.py): `source/apixis/core/graph/context/stream_writer.py`
- [Graph namespaces](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/utils/namespace.py): `source/apixis/core/graph/utils/namespace.py`
- [Interrupt and resume](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/interrupter/graph_interrupter.py): `source/apixis/core/graph/interrupter/graph_interrupter.py`
- [Interrupt block](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/graph/interrupter/block.py): `source/apixis/core/graph/interrupter/block.py`

### Event runtime

- [Event core factory](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/factory.py): `source/apixis/core/event/factory.py`
- [Local event queue](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/event_pipe.py): `source/apixis/core/event/event_pipe.py`
- [Event dispatch loop](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/event_loop.py): `source/apixis/core/event/event_loop.py`
- [Event registry](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/event_registry.py): `source/apixis/core/event/event_registry.py`
- [Handler registry](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/handler_registry.py): `source/apixis/core/event/handler_registry.py`
- [Handlers and subscriptions](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/base.py): `source/apixis/core/event/base.py`
- [Subscription API](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/event/subscription.py): `source/apixis/core/event/subscription.py`

### Shared support

- [Runtime configuration](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/config/core_config.py): `source/apixis/core/config/core_config.py`
- [Logging](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/utils/logger.py): `source/apixis/core/utils/logger.py`
- [Runtime exceptions](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/utils/exception.py): `source/apixis/core/utils/exception.py`
- [ID generation](https://github.com/jjjjstiyyyy/apixis/blob/master/source/apixis/core/utils/id_generator.py): `source/apixis/core/utils/id_generator.py`

### Other components

- **Asyncio application**

## Connections

- Asyncio application → Graph manager: builds graph (evidence: `README.md`)
- Graph manager → Graph runtime: compiles graph (evidence: `source/apixis/core/graph/graph_manager.py`)
- Asyncio application → Graph runtime: invokes graph (evidence: `README.md`)
- Graph runtime → Graph nodes: executes nodes (evidence: `source/apixis/core/graph/node_graph.py`)
- Graph nodes → Commands and state: returns commands (evidence: `source/apixis/core/graph/node.py`)
- Graph runtime → Commands and state: applies updates (evidence: `source/apixis/core/graph/node_graph.py`)
- Graph runtime → Invocation context: binds invocation (evidence: `source/apixis/core/graph/node_graph.py`)
- Context access → Invocation context: reads context (evidence: `source/apixis/core/graph/context/manager.py`)
- Context access → Stream writer: gets writer (evidence: `source/apixis/core/graph/context/manager.py`)
- Context access → Graph namespaces: resolves namespace (evidence: `source/apixis/core/graph/context/manager.py`)
- Graph runtime → Context access: binds node context (evidence: `source/apixis/core/graph/node_graph.py`)
- Graph runtime → Graph namespaces: claims namespace (evidence: `source/apixis/core/graph/utils/namespace.py`)
- Graph runtime → Interrupt and resume: handles interruptions (evidence: `source/apixis/core/graph/node_graph.py`)
- Interrupt and resume → Interrupt block: creates block (evidence: `source/apixis/core/graph/interrupter/graph_interrupter.py`)
- Interrupt and resume → Event core factory: gets event pipe (evidence: `source/apixis/core/graph/interrupter/graph_interrupter.py`)
- Graph runtime → Event core factory: posts dispatch (evidence: `source/apixis/core/graph/node_graph.py`)
- Event core factory → Local event queue: constructs core (evidence: `source/apixis/core/event/factory.py`)
- Event core factory → Event dispatch loop: constructs core (evidence: `source/apixis/core/event/factory.py`)
- Event core factory → Event registry: constructs core (evidence: `source/apixis/core/event/factory.py`)
- Event core factory → Handler registry: constructs core (evidence: `source/apixis/core/event/factory.py`)
- Event dispatch loop → Local event queue: consumes events (evidence: `source/apixis/core/event/event_loop.py`)
- Event dispatch loop → Handler registry: selects handlers (evidence: `source/apixis/core/event/event_loop.py`)
- Event dispatch loop → Event registry: resolves events (evidence: `source/apixis/core/event/event_loop.py`)
- Handler registry → Event registry: matches event names (evidence: `source/apixis/core/event/handler_registry.py`)
- Handlers and subscriptions → Logging: logs execution (evidence: `source/apixis/core/event/base.py`)
- Subscription API → Event core factory: gets event core (evidence: `source/apixis/core/event/subscription.py`)
- Local event queue → Runtime configuration: reads settings
- Logging → Runtime configuration: reads settings (evidence: `source/apixis/core/utils/logger.py`)
- Graph runtime → ID generation: generates IDs (evidence: `source/apixis/core/graph/node_graph.py`)
- Graph runtime → Runtime exceptions: raises runtime errors (evidence: `source/apixis/core/graph/node_graph.py`)
- Handler registry → Runtime exceptions: raises registration errors (evidence: `source/apixis/core/event/handler_registry.py`)
