Skip to content

Services Overview

Services are business-level functionality that your application provides to users. While Components handle infrastructure concerns (databases, workers, scheduling), Services implement specific business capabilities like authentication, payments, or AI integrations.

Services vs Components

Services = What your app does (auth, AI, insights) Components = How your app works (database, workers, API)

Services

Service What you get
AI Conversational agents, RAG, model catalog, TTS and STT (PydanticAI / LangChain across 7 providers) Optional
Auth Persistent sessions with refresh-token rotation, GitHub/Google sign-in, RBAC, multi-tenant Organizations Optional
Blog Markdown publishing with drafts, tags, and an Overseer editor Optional
Comms Transactional email (Resend) + SMS / voice (Twilio) Optional
Documents Content-addressed document store, deduped, with page-addressed extraction Optional
Finance Personal finance aggregation (accounts, transactions, net worth, import) Optional Experimental
Insights Adoption metrics across GitHub, PyPI, Plausible, Reddit Optional
Meetings A bot that joins Google Meet as its own agent: transcript, notes, threads, people, what keeps coming up, joined from its calendar Optional Experimental
Payment Stripe checkout, subscriptions, refunds, disputes Optional
Research Outside posts and threads, collected by saved searches Optional

Architectural Guidance

This page covers which services are available and how to add them to your project. For detailed patterns on how services integrate with components and how to structure your code, see Integration Patterns.

Service Selection

Services are chosen during project creation and automatically include their required components:

# Basic API project (no services)
aegis init my-api

# Interactive mode - must explicitly specify required components
aegis init user-app --services auth --components database
# Required: must include database component that auth service needs

# Non-interactive mode - must explicitly specify all components
aegis init user-app --services auth --components database --no-interactive
# Required: must include database component that auth service needs

# Multiple services with explicit components (future)
aegis init full-app --services auth,ai --components database,worker --no-interactive
# Required: must include all components that services need

Dependency Resolution

Interactive Mode: Services automatically include required components.

Non-Interactive Mode: You must explicitly specify all required components when using --components.

graph LR
    subgraph "User Selection"
        UserChoice["aegis init app<br/>--services auth"]
    end

    subgraph "Auto-Resolution"
        CoreComponents["Backend + Frontend<br/>Always Included"]
        AuthSvc[Auth Service]
        DatabaseComp["Database Component<br/>Auto-added by auth"]
    end

    subgraph "Generated Project"
        AuthAPI["Auth API routes"]
        UserModel["User model"]
        JWT["JWT security"]
        DB[Database]
        API[FastAPI app]
        UI[Flet frontend]
    end

    UserChoice --> CoreComponents
    UserChoice --> AuthSvc
    AuthSvc --> DatabaseComp

    AuthSvc --> AuthAPI
    AuthSvc --> UserModel
    AuthSvc --> JWT
    DatabaseComp --> DB
    CoreComponents --> API
    CoreComponents --> UI

Service Categories

graph TB
    subgraph "Authentication Services"
        AuthJWT["auth<br/>JWT + User Management"]
        AuthOAuth["oauth<br/>Future: Social Login"]
        AuthSAML["saml<br/>Future: Enterprise SSO"]
    end

    subgraph "AI Services"
        AIPydantic["ai<br/>PydanticAI Multi-Provider"]
        AILangChain["ai_langchain<br/>Future: LangChain"]
    end

    subgraph "Notification Services"
        CommsService["comms<br/>Email, SMS, Voice"]
        Push["push<br/>Future: Push Notifications"]
    end

    subgraph "Analytics Services"
        InsightsService["insights<br/>GitHub, PyPI, Plausible, Reddit"]
    end

    subgraph "Content Services"
        BlogService["blog<br/>Markdown Posts + Tags"]
    end

    subgraph "Meeting Services"
        MeetingsService["meetings<br/>Google Meet Bot, Notes, Themes"]
    end

Service Development Patterns

Service Structure

Every service follows one layout, so the file you want is where you expect it whoever wrote the service. Names are positional - the file says what it is, not what it is called:

File Holds Part
health.py what the dashboard shows: HEALTH, its check, registered at startup required
queries.py every read, batched; no business logic required once it reads
jobs.py all background jobs, each *_job in a JOBS list or called required once it has jobs
service.py the facade: the entry point callers reach for optional (advised)
models.py the service's tables optional
schemas.py request and response shapes optional
deps.py the request-scoped wiring optional
tools.py what it hands the AI: its chat tools optional
change_types.py what it hands the change queue: its executors optional
sources.py what it hands research: the sources a plugin registers optional
aggregates.py what it holds, as figures an agent reads: AGGREGATES, each a count or sum by label, never rows optional
overseer.py its own Overseer page: OVERSEER, an OverseerPage (app.core.overseer_pages) naming the page's module and partials by import path, its templates in pages/overseer/<service>/ optional
adapters/ what it talks to: providers, file formats, collectors, kept apart from what it knows (domains/) optional
constants.py, utils.py shared values and helpers optional
settings.py the settings mixin app.core.config's Settings inherits (meetings', or a plugin's through settings_mixins) optional

Its router lives apart, in app/components/backend/api/<name>, and leaves the database to the service. At least one test imports the service.

A service grows into that layout in three steps, and stops at whichever one still fits: a small service keeps its logic in service.py; a larger one puts each subsystem in a package under domains/, and what it talks to (a provider's API, a file format, a source's collector) under adapters/, kept apart from what it knows.

app/services/
├── documents/               # a spine, plus one domain
│   ├── service.py models.py queries.py health.py deps.py
│   └── domains/
│       └── extraction/      # pages.py pdf.py vision.py dispatch.py jobs.py
│
└── finance/                 # several domains, each its own package
    ├── service/ models/ schemas/ health.py jobs.py utils.py
    ├── domains/
    │   ├── ledger/          # each with its own queries.py
    │   ├── planning/
    │   └── detection/
    └── adapters/            # what it talks to: providers/, importers/

Domains are plural nouns with no _service suffix, and their functions take the session first (async def create_budget(db, ...)). Everything a caller outside the service needs reaches it through service.py; the domain packages are how the service is organised, not its public surface.

The __init__.py docstring is the domain map. It is the first thing anyone reads - a person opening the package or a coding agent deciding where a change belongs - so it names each domain and what it owns.

The layout is tested, not just described

Every service is checked against this layout: Overseer > Patterns > Service parts shows the parts each one has and the rules it breaks, and Illiana reviews each pull request against the same rules.

Service Integration Points

graph TB
    subgraph "Service Integration"
        ServiceAPI["Service API Routes<br/>Auth, Payment endpoints"]
        ServiceLogic["Service Business Logic<br/>AuthService, PaymentService"]
        ServiceModels["Service Data Models<br/>User, Transaction"]
        ServiceSecurity["Service Security<br/>JWT, OAuth, API Keys"]
    end

    subgraph "Component Integration"
        Backend["Backend Component<br/>Route Registration"]
        Database["Database Component<br/>Model Registration"]
        Worker["Worker Component<br/>Background Tasks"]
    end

    ServiceAPI --> Backend
    ServiceModels --> Database
    ServiceLogic --> Worker
    ServiceSecurity --> Backend

CLI Commands

List Available Services

aegis services

Shows all available services by category with their dependencies:

AVAILABLE SERVICES
========================================

Authentication Services
----------------------------------------
  auth         - User authentication and authorization with JWT tokens
               Requires components: backend, database

Payment Services
----------------------------------------
  payment      - Payment processing with Stripe (checkout, subscriptions, webhooks)
               Requires components: backend, database

AI & Machine Learning Services
----------------------------------------
  No services available yet.

Create Project with Services

# With specific services - must include required components
aegis init my-app --services auth --components database

# Interactive service selection
aegis init my-app --interactive

# Multiple services (future)
aegis init full-app --services auth,ai --components database,worker

Dashboard Integration

Services automatically appear in the health dashboard alongside components, providing real-time monitoring of your business capabilities. See Overseer for dashboard documentation.


Next Steps:

Was this page helpful?