AI Support Guide

Architecture

How AI support capabilities fit together.

Dependency graph

Every capability builds on a shared foundation, which provides common models, settings, and logging. Services do not depend on each other — they communicate over HTTP if needed.

Core Foundation
  ├── Triage
  ├── Reply
  ├── QA
  ├── Sentiment
  ├── Pulse
  ├── KB
  ├── Macro
  ├── Data
  └── Template

Services working together

While each service is independent, they form a powerful pipeline when combined:

Ticket arrives → Triage (classify + route)

                Agent receives pre-classified ticket

                Reply (generates draft response)  ←  KB (semantic search for grounding)

                Sentiment (monitors each message in parallel)

                After resolution → QA (scores conversation quality)
                                 → Pulse (aggregates operational metrics)

See The Ticket Lifecycle for a detailed walkthrough with code examples.

Shared domain models

All services share the same domain language through the core library's Pydantic models:

ModelPurpose
TicketSupport ticket with subject, status, priority, channel, tags
CustomerCustomer profile with name, email, tier, metadata
AgentSupport agent with teams, skills, active status
MessageSingle message with author type, body, channel
ConversationThread of messages linked to a ticket

Key enums:

EnumValues
Prioritylow, medium, high, urgent
TicketStatusnew, open, pending, solved, closed
Channelemail, chat, phone, social, web
CustomerTierfree, basic, premium, enterprise
AuthorTypecustomer, agent, system

Shared settings

Every service subclasses SimpliSettings from the core library, which provides:

FieldDefaultEnv var
app_envdevelopmentAPP_ENV
app_host0.0.0.0APP_HOST
app_port8000APP_PORT
app_log_levelinfoAPP_LOG_LEVEL
app_debugfalseAPP_DEBUG

Services add their own fields on top. Settings are automatically loaded from environment variables and .env files.

Shared logging

All services use setup_logging() from the core library, which configures structlog with:

  • Console rendering in development, JSON in production
  • Configurable log level
  • Context variable support for request tracing

Service structure

Every service follows the same layout:

src/<package>/
  __init__.py     # Package version
  app.py          # FastAPI application, models, endpoints
  settings.py     # Settings(SimpliSettings) subclass
  cli.py          # Typer CLI with `serve` and `version` commands
tests/
  test_app.py     # API endpoint tests
  conftest.py     # Shared fixtures

Each service:

  • Exposes a REST API via FastAPI
  • Has a CLI to start the server (simpli-<name> serve)
  • Provides a /health endpoint
  • Uses structlog for structured logging
  • Reads configuration from environment variables / .env files

On this page