Aurelis

Aurelis Architecture

This section provides comprehensive architectural documentation for Aurelis.

System Architecture

Overview

Core Components

Processing Pipeline

Design Principles

Enterprise-Grade Quality

Aurelis follows enterprise software development principles:

GitHub Models Integration

Built exclusively for GitHub models via Azure AI Inference:

Component Architecture

┌─────────────────────────────────────────────────────────────┐
│                    Aurelis CLI Interface                    │
├─────────────────────────────────────────────────────────────┤
│  Commands: init | config | models | generate | analyze     │
│  Shell: Interactive mode with context preservation         │
└─────────────────────┬───────────────────────────────────────┘
                      │
┌─────────────────────▼───────────────────────────────────────┐
│                 Core Orchestration Layer                   │
├─────────────────────────────────────────────────────────────┤
│  Model Orchestrator: Request routing and processing        │
│  Task Router: Intelligent model selection                  │
│  Cache Manager: Response caching and optimization          │
└─────────────────────┬───────────────────────────────────────┘
                      │
┌─────────────────────▼───────────────────────────────────────┐
│                 GitHub Models Integration                  │
├─────────────────────────────────────────────────────────────┤
│  Azure AI Inference API Client                             │
│  Model Types: Codestral, GPT-4o, Cohere, Llama, Mistral  │
│  Authentication: GitHub Token via Bearer Auth              │
└─────────────────────┬───────────────────────────────────────┘
                      │
┌─────────────────────▼───────────────────────────────────────┐
│                  Supporting Services                       │
├─────────────────────────────────────────────────────────────┤
│  Configuration: YAML + Environment Variables               │
│  Security: Encrypted token storage                         │
│  Logging: Structured logging with correlation IDs          │
│  Error Handling: Custom exceptions with context            │
└─────────────────────────────────────────────────────────────┘

Key Design Decisions

1. GitHub Models Exclusive

Decision: Use only GitHub models via Azure AI Inference Rationale:

2. Async-First Design

Decision: Built on asyncio for all I/O operations Rationale:

3. Configuration-Driven

Decision: YAML configuration with environment overrides Rationale:

4. Modular Architecture

Decision: Clean separation of concerns Rationale:

Security Design

Authentication Flow

1. User sets GITHUB_TOKEN environment variable
2. Aurelis reads token from environment or config
3. Token encrypted and stored in secure storage
4. API requests use Bearer token authentication
5. Token validation and refresh handled automatically

Data Protection

Performance Architecture

Caching Strategy

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Request Hash  │───▶│  Cache Lookup   │───▶│  Model API Call │
│                 │    │                 │    │                 │
│ Prompt + Model  │    │  TTL: 1 hour    │    │  GitHub Models  │
│ + System Prompt │    │  Max: 1000 items│    │  via Azure AI   │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                │
                                ▼
                       ┌─────────────────┐
                       │ Cached Response │
                       │                 │
                       │ Content + Meta  │
                       └─────────────────┘

Rate Limiting

Error Handling Architecture

Exception Hierarchy

AurelisError (Base)
├── ConfigurationError
│   ├── InvalidConfigError
│   └── MissingConfigError
├── ModelError
│   ├── ModelUnavailableError
│   ├── ModelTimeoutError
│   └── ModelQuotaExceededError
├── AuthenticationError
│   ├── InvalidTokenError
│   └── TokenExpiredError
└── ProcessingError
    ├── AnalysisError
    └── GenerationError

Error Recovery

  1. Automatic Retry: Transient failures with exponential backoff
  2. Fallback Models: Primary model failures trigger fallback
  3. Graceful Degradation: Partial functionality on component failure
  4. User Guidance: Clear error messages with resolution steps

Development Environment

Local Development Setup

Local Machine
├── Python 3.8+
├── GitHub Token
├── Project Configuration (.aurelis.yaml)
└── Cache Directory (~/.aurelis/cache)

Monitoring & Observability

Logging Strategy

Metrics Collection

Future Architecture Considerations

Scalability

Advanced Features

See Also