# aethergases/aeko-sdk architecture

> Architecture diagram of the GitHub repository aethergases/aeko-sdk, 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/aethergases/aeko-sdk
- Repository: https://github.com/aethergases/aeko-sdk

## Overview

Aeko is an embeddable Python library for GHG inventory analysis and ESG conversation, not a standalone service. Its two public entry points feed a shared agent graph: chat routes questions through specialists and reviews the answer; report analysis produces a structured improvement plan and extracted inventory. Configuration builds and caches agents, while shared logging and event tracking capture run metrics. The README documents the main chat sequence; unsampled report internals and some graph routing details are represented only where the README or source index supports them.

Main entry points: [`aeko/config/messenger.py`](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/messenger.py) (Chat Entry), [`aeko/config/inventory.py`](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/inventory.py) (Inventory Entry), [`aeko/engine/graph/nodes.py`](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/graph/nodes.py) (Graph Nodes), [`aeko/engine/agents/agents.py`](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/agents/agents.py) (Agent Factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public_api["Public API"]
  node_facade["SDK Facade<br/>[__init__.py]"]
  node_configuration["Configuration<br/>[aeko.py]"]
  node_messenger["Chat Entry<br/>[messenger.py]"]
  node_inventory["Inventory Entry<br/>[inventory.py]"]
  node_data_models["Domain Models<br/>[dto.py]"]
  node_text_protocol["Text Parsing<br/>[_text.py]"]
  node_errors["SDK Errors<br/>[exceptions.py]"]
end

subgraph group_agent_engine["Agent Engine"]
  node_runtime["Agent Runtime<br/>[runtime.py]"]
  node_agent_factory["Agent Factory<br/>[agents.py]"]
  node_language_models["Model Setup<br/>[llms.py]"]
  node_graph_builder["Graph Builder<br/>[builder.py]"]
  node_graph_nodes["Graph Nodes<br/>[nodes.py]"]
  node_graph_state["Graph State<br/>[state.py]"]
  node_content_text["Content Normalizer<br/>[_content.py]"]
end

subgraph group_prompt_catalog["Agent Prompts"]
  node_prompt_builder["Prompt Builder<br/>[builder.py]"]
  node_conversation_agents["Chat Agents<br/>[router.py]"]
  node_analysis_agents["Analysis Agents"]
end

subgraph group_shared_runtime["Shared Runtime"]
  node_shared_context["Run Context<br/>[context.py]"]
  node_telemetry["Event Tracking<br/>[event_tracking.py]"]
  node_logging["Logging<br/>[logger.py]"]
end

subgraph group_side_features["Side Features"]
  node_summary["Conversation Summary<br/>[summary.py]"]
  node_summary_prompt["Summary Prompt<br/>[prompt.py]"]
end

node_caller(("Embedding Caller"))

node_caller -->|"uses SDK"| node_facade
node_facade -->|"configures"| node_configuration
node_caller -->|"sends message"| node_messenger
node_caller -->|"submits inventory"| node_inventory
node_messenger -->|"runs chat"| node_runtime
node_inventory -->|"runs report"| node_runtime
node_messenger -->|"uses session models"| node_data_models
node_inventory -->|"builds response"| node_data_models
node_messenger -->|"strips markers"| node_text_protocol
node_inventory -->|"parses sections"| node_text_protocol
node_inventory -->|"raises malformed output"| node_errors
node_configuration -->|"configures runtime"| node_runtime
node_runtime -->|"creates agents"| node_agent_factory
node_agent_factory -->|"creates models"| node_language_models
node_agent_factory -->|"builds prompts"| node_prompt_builder
node_agent_factory -->|"registers chat specs"| node_conversation_agents
node_agent_factory -->|"registers report spec"| node_analysis_agents
node_messenger -->|"enters chat graph"| node_graph_builder
node_inventory -->|"enters report graph"| node_graph_builder
node_graph_builder -->|"registers nodes"| node_graph_nodes
node_graph_nodes -->|"reads and updates"| node_graph_state
node_graph_nodes -->|"normalizes output"| node_content_text
node_graph_nodes -->|"reads handoff markers"| node_text_protocol
node_graph_nodes -->|"routes chat"| node_conversation_agents
node_graph_nodes -->|"runs report specialist"| node_analysis_agents
node_prompt_builder -->|"builds specifications"| node_conversation_agents
node_prompt_builder -->|"builds specifications"| node_analysis_agents
node_messenger -->|"may summarize"| node_summary
node_summary -->|"uses prompt"| node_summary_prompt
node_summary -->|"builds summarizer agent"| node_agent_factory
node_runtime -.->|"binds run context"| node_shared_context
node_shared_context -->|"scopes run metrics"| node_telemetry
node_telemetry -->|"records agent calls"| node_logging
node_messenger -->|"returns run metrics"| node_telemetry
node_inventory -->|"returns run metrics"| node_telemetry

click node_facade "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/__init__.py"
click node_configuration "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/aeko.py"
click node_messenger "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/messenger.py"
click node_inventory "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/inventory.py"
click node_data_models "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/dto.py"
click node_text_protocol "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/_text.py"
click node_errors "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/exceptions.py"
click node_runtime "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/runtime.py"
click node_agent_factory "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/agents/agents.py"
click node_language_models "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/agents/llms.py"
click node_graph_builder "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/graph/builder.py"
click node_graph_nodes "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/graph/nodes.py"
click node_graph_state "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/graph/state.py"
click node_content_text "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/_content.py"
click node_prompt_builder "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/prompts/builder.py"
click node_conversation_agents "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/prompts/router.py"
click node_analysis_agents "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/prompts/continuous_improvement_coordinator.py"
click node_shared_context "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/shared/context.py"
click node_telemetry "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/shared/event_tracking.py"
click node_logging "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/shared/logger.py"
click node_summary "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/side_content/summary.py"
click node_summary_prompt "https://github.com/aethergases/aeko-sdk/blob/develop/aeko/side_content/prompt.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_facade,node_configuration,node_messenger,node_inventory,node_data_models,node_text_protocol,node_errors toneBlue
class node_runtime,node_agent_factory,node_language_models,node_graph_builder,node_graph_nodes,node_graph_state,node_content_text toneAmber
class node_prompt_builder,node_conversation_agents,node_analysis_agents toneMint
class node_shared_context,node_telemetry,node_logging toneRose
class node_summary,node_summary_prompt,node_caller toneIndigo
```

## Components

### Public API

- [SDK Facade](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/__init__.py): `aeko/__init__.py`
- [Configuration](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/aeko.py): `aeko/config/aeko.py`
- [Chat Entry](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/messenger.py): `aeko/config/messenger.py`
- [Inventory Entry](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/inventory.py): `aeko/config/inventory.py`
- [Domain Models](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/dto.py): `aeko/config/dto.py`
- [Text Parsing](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/_text.py): `aeko/config/_text.py`
- [SDK Errors](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/config/exceptions.py): `aeko/config/exceptions.py`

### Agent Engine

- [Agent Runtime](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/runtime.py): `aeko/engine/runtime.py`
- [Agent Factory](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/agents/agents.py): `aeko/engine/agents/agents.py`
- [Model Setup](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/agents/llms.py): `aeko/engine/agents/llms.py`
- [Graph Builder](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/graph/builder.py): `aeko/engine/graph/builder.py`
- [Graph Nodes](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/graph/nodes.py): `aeko/engine/graph/nodes.py`
- [Graph State](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/graph/state.py): `aeko/engine/graph/state.py`
- [Content Normalizer](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/_content.py): `aeko/engine/_content.py`

### Agent Prompts

- [Prompt Builder](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/prompts/builder.py): `aeko/engine/prompts/builder.py`
- [Chat Agents](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/prompts/router.py): `aeko/engine/prompts/router.py`
- [Analysis Agents](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/engine/prompts/continuous_improvement_coordinator.py): `aeko/engine/prompts/continuous_improvement_coordinator.py`

### Shared Runtime

- [Run Context](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/shared/context.py): `aeko/shared/context.py`
- [Event Tracking](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/shared/event_tracking.py): `aeko/shared/event_tracking.py`
- [Logging](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/shared/logger.py): `aeko/shared/logger.py`

### Side Features

- [Conversation Summary](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/side_content/summary.py): `aeko/side_content/summary.py`
- [Summary Prompt](https://github.com/aethergases/aeko-sdk/blob/develop/aeko/side_content/prompt.py): `aeko/side_content/prompt.py`

### Other components

- **Embedding Caller**

## Connections

- Embedding Caller → SDK Facade: uses SDK (evidence: `README.md`)
- SDK Facade → Configuration: configures (evidence: `aeko/__init__.py`)
- Embedding Caller → Chat Entry: sends message (evidence: `README.md`)
- Embedding Caller → Inventory Entry: submits inventory (evidence: `README.md`)
- Chat Entry → Agent Runtime: runs chat (evidence: `aeko/config/messenger.py`)
- Inventory Entry → Agent Runtime: runs report (evidence: `aeko/config/inventory.py`)
- Chat Entry → Domain Models: uses session models (evidence: `aeko/config/messenger.py`)
- Inventory Entry → Domain Models: builds response (evidence: `aeko/config/inventory.py`)
- Chat Entry → Text Parsing: strips markers (evidence: `aeko/config/messenger.py`)
- Inventory Entry → Text Parsing: parses sections (evidence: `aeko/config/inventory.py`)
- Inventory Entry → SDK Errors: raises malformed output (evidence: `aeko/config/inventory.py`)
- Configuration → Agent Runtime: configures runtime (evidence: `aeko/config/aeko.py`)
- Agent Runtime → Agent Factory: creates agents (evidence: `aeko/engine/runtime.py`)
- Agent Factory → Model Setup: creates models (evidence: `aeko/engine/agents/agents.py`)
- Agent Factory → Prompt Builder: builds prompts (evidence: `aeko/engine/agents/agents.py`)
- Agent Factory → Chat Agents: registers chat specs (evidence: `aeko/engine/agents/agents.py`)
- Agent Factory → Analysis Agents: registers report spec (evidence: `aeko/engine/agents/agents.py`)
- Chat Entry → Graph Builder: enters chat graph (evidence: `README.md`)
- Inventory Entry → Graph Builder: enters report graph (evidence: `aeko/config/inventory.py`)
- Graph Builder → Graph Nodes: registers nodes (evidence: `aeko/engine/graph/builder.py`)
- Graph Nodes → Graph State: reads and updates (evidence: `aeko/engine/graph/nodes.py`)
- Graph Nodes → Content Normalizer: normalizes output (evidence: `aeko/engine/graph/nodes.py`)
- Graph Nodes → Text Parsing: reads handoff markers (evidence: `aeko/config/_text.py`)
- Graph Nodes → Chat Agents: routes chat (evidence: `README.md`)
- Graph Nodes → Analysis Agents: runs report specialist (evidence: `aeko/engine/graph/nodes.py`)
- Prompt Builder → Chat Agents: builds specifications (evidence: `aeko/engine/prompts/__init__.py`)
- Prompt Builder → Analysis Agents: builds specifications (evidence: `aeko/engine/prompts/continuous_improvement_coordinator.py`)
- Chat Entry → Conversation Summary: may summarize (evidence: `aeko/config/messenger.py`)
- Conversation Summary → Summary Prompt: uses prompt (evidence: `aeko/side_content/summary.py`)
- Conversation Summary → Agent Factory: builds summarizer agent (evidence: `aeko/side_content/summary.py`)
- Agent Runtime → Run Context: binds run context
- Run Context → Event Tracking: scopes run metrics (evidence: `aeko/shared/event_tracking.py`)
- Event Tracking → Logging: records agent calls (evidence: `aeko/shared/logger.py`)
- Chat Entry → Event Tracking: returns run metrics (evidence: `aeko/config/messenger.py`)
- Inventory Entry → Event Tracking: returns run metrics (evidence: `aeko/config/inventory.py`)
