STING-CE System Architecture

Executive Summary

STING-CE is a modern, AI-powered platform that manages “Honey Jars”β€”containerized knowledge bases that organizations can create, share, and query. Built with a microservices architecture, it combines intelligent knowledge management with AI capabilities to provide semantic search, automated content analysis, and AI-powered report generation.

System Overview

graph TB
    subgraph "Client Layer"
        UI[React Frontend]
        API[API Clients]
    end
    
    subgraph "Gateway & Auth"
        NGINX[Nginx + Frontend]
        KRATOS[Ory Kratos]
    end
    
    subgraph "Core Application"
        APP[Flask API]
        CHATBOT[Chatbot Service]
        KNOWLEDGE[Knowledge Service]
        MESSAGING[Messaging Service]
    end
    
    subgraph "AI Services"
        EXTERNAL[External AI Service]
        DEMO[Demo AI Service]
        LLM_GW[LLM Gateway Proxy]
        SEARXNG[SearXNG Web Search]
    end
    
    subgraph "Background Workers"
        REPORT[Report Worker]
        QE[QE Bee Worker]
        PROFILE[Profile Sync Worker]
    end
    
    subgraph "Public APIs"
        PUBLIC[Public Bee API]
    end
    
    subgraph "Data Layer"
        PG[(PostgreSQL)]
        CHROMA[(ChromaDB)]
        REDIS[(Redis)]
        VAULT[(Vault)]
    end
    
    subgraph "Utilities"
        UTILS[Utils Container]
        MAILPIT[Mailpit - Dev Only]
    end
    
    UI --> NGINX
    API --> NGINX
    
    NGINX --> KRATOS
    NGINX --> APP
    NGINX --> CHATBOT
    NGINX --> PUBLIC
    
    APP --> PG
    APP --> REDIS
    APP --> VAULT
    
    CHATBOT --> EXTERNAL
    CHATBOT --> KNOWLEDGE
    
    EXTERNAL --> LLM_GW
    EXTERNAL --> SEARXNG
    EXTERNAL --> VAULT
    
    KNOWLEDGE --> CHROMA
    KNOWLEDGE --> PG
    
    REPORT --> EXTERNAL
    REPORT --> PG
    
    QE --> EXTERNAL
    
    MESSAGING --> REDIS
    
    PROFILE --> PG
    PROFILE --> KRATOS

Service Inventory

🟒 Core Services (Required)

These services are required for STING-CE to function:

ServiceContainerPortPurpose
Frontendsting-ce-frontend443React SPA + Nginx reverse proxy
Appsting-ce-app5000Flask API - core business logic
Chatbotsting-ce-chatbot8001Bee chat interface coordination
Knowledgesting-ce-knowledge8002Document processing & RAG
Messagingsting-ce-messaging8003Inter-service messaging
External AIsting-ce-external-ai8004AI orchestration & providers
Kratossting-ce-kratos4433/4434Identity & auth management
PostgreSQLsting-ce-db5432Primary relational database
ChromaDBsting-ce-chroma8000Vector embeddings database
Redissting-ce-redis6379Cache, sessions, job queues
Vaultsting-ce-vault8200Secrets & PII encryption
LLM Gatewaysting-ce-llm-gateway-proxy11434Nginx proxy to LLM providers
Utilssting-ce-utils-Helper scripts, health checks

🟑 Background Workers (Required for Full Functionality)

These workers handle async tasks. STING will run without them but with reduced features:

ServiceContainerPurposeImpact if Missing
Report Workersting-ce-report-workerAsync report generationNo PDF reports
QE Bee Workersting-ce-qe-bee-workerQuality assurance validationNo QA on outputs
Profile Syncsting-ce-profile-sync-workerKratos ↔ App user syncManual user sync

πŸ”΅ Optional Services (Enhanced Features)

These services add capabilities but are not required:

ServiceContainerPortPurposeEnable With
SearXNGsting-ce-searxng8080Self-hosted web searchWEB_SEARCH_ENABLED=true
Demo AIsting-ce-demo-ai8005Demo/fallback AI responsesAlways included
Public Beesting-ce-public-bee8006External chatbot APIFor API-as-a-service

🟣 Development Only

These services only run in development mode:

ServiceContainerProfilePurpose
Mailpitsting-ce-mailpitdev, developmentEmail testing & capture

βšͺ Observability Stack (docker-compose.full.yml)

For production monitoring, use docker-compose.full.yml to add:

ServiceContainerPurpose
Grafanasting-ce-grafanaDashboards and visualization
Lokisting-ce-lokiLog aggregation
Promtailsting-ce-promtailLog collection
Pollen Filtersting-ce-pollen-filterPII sanitization in logs

Note: The observability stack is recommended for production deployments but not required for development or small installations.


Detailed Component Architecture

1. Frontend & Gateway Layer

graph LR
    subgraph "Frontend Container"
        REACT[React SPA]
        NGINX_FE[Nginx Server]
    end
    
    REACT --> NGINX_FE
    NGINX_FE -->|/api/*| APP[Flask API]
    NGINX_FE -->|/api/chat/*| CHATBOT
    NGINX_FE -->|/.ory/*| KRATOS
    NGINX_FE -->|/api/public/*| PUBLIC[Public Bee]
  • React SPA: Material-UI based interface
  • Nginx: Reverse proxy, SSL termination, static file serving
  • Routing: Path-based routing to backend services

2. Authentication Layer

graph TB
    subgraph "Ory Kratos"
        LOGIN[Login Flows]
        REG[Registration]
        PASSKEY[WebAuthn/Passkeys]
        TOTP[TOTP 2FA]
        RECOVERY[Account Recovery]
    end
    
    subgraph "App Integration"
        SESSION[Session Validation]
        API_KEY[API Key Auth]
        RBAC[Role-Based Access]
    end
    
    LOGIN --> SESSION
    PASSKEY --> SESSION
    TOTP --> SESSION
    SESSION --> RBAC
    API_KEY --> RBAC
  • Ory Kratos: Self-hosted identity management
  • Authentication Methods: Password, Passkeys (WebAuthn), TOTP
  • Session Management: Cookie-based with Redis backing
  • API Keys: For programmatic access

3. AI Service Architecture

graph TB
    subgraph "External AI Service"
        ROUTER[Request Router]
        PII[PII Serialization]
        CONTEXT[Context Manager]
        WEB[Web Search Provider]
    end
    
    subgraph "LLM Providers"
        LOCAL[Local Ollama]
        OPENAI[OpenAI API]
        ANTHROPIC[Anthropic API]
        OTHER[Other Providers]
    end
    
    subgraph "Search"
        SEARXNG[SearXNG]
        DDG[DuckDuckGo]
        BRAVE[Brave Search]
        WIKI[Wikipedia]
    end
    
    ROUTER --> PII
    PII --> CONTEXT
    CONTEXT --> LOCAL
    CONTEXT --> OPENAI
    CONTEXT --> ANTHROPIC
    CONTEXT --> OTHER
    
    CONTEXT --> WEB
    WEB --> SEARXNG
    SEARXNG --> DDG
    SEARXNG --> BRAVE
    SEARXNG --> WIKI
  • External AI Service: Central AI orchestration
  • Provider Support: Local (Ollama) + External (OpenAI, Anthropic, etc.)
  • PII Protection: Automatic detection and Vault-based encryption
  • Web Search: SearXNG meta-search for real-time context

4. Knowledge & RAG Pipeline

graph LR
    subgraph "Document Ingestion"
        UPLOAD[File Upload]
        PARSE[Document Parser]
        CHUNK[Text Chunker]
        EMBED[Embedding Generator]
    end
    
    subgraph "Storage"
        CHROMA[(ChromaDB)]
        PG[(PostgreSQL)]
    end
    
    subgraph "Retrieval"
        QUERY[Query Processor]
        SEARCH[Vector Search]
        RERANK[Result Reranking]
    end
    
    UPLOAD --> PARSE
    PARSE --> CHUNK
    CHUNK --> EMBED
    EMBED --> CHROMA
    PARSE --> PG
    
    QUERY --> SEARCH
    SEARCH --> CHROMA
    SEARCH --> RERANK
  • Supported Formats: PDF, DOCX, TXT, Markdown, HTML
  • Chunking: Intelligent text splitting with overlap
  • Embeddings: Local or API-based embedding generation
  • Vector Search: Semantic similarity via ChromaDB

5. Report Generation Pipeline

graph TB
    subgraph "Request Flow"
        USER[User Request]
        CLASSIFY[Request Classifier]
        QUEUE[Redis Queue]
    end
    
    subgraph "Report Worker"
        WORKER[Background Worker]
        TITLE[Title Generator]
        RESEARCH[Web Research]
        GENERATE[Content Generator]
        PDF[PDF Export]
    end
    
    subgraph "Output"
        STORAGE[File Storage]
        NOTIFY[User Notification]
    end
    
    USER --> CLASSIFY
    CLASSIFY -->|>2000 tokens| QUEUE
    QUEUE --> WORKER
    WORKER --> TITLE
    WORKER --> RESEARCH
    RESEARCH --> GENERATE
    GENERATE --> PDF
    PDF --> STORAGE
    STORAGE --> NOTIFY
  • Classification: Automatic chat vs. report detection
  • Async Processing: Redis-backed job queue
  • Web Research: SearXNG integration for current info
  • Export: Professional PDF with STING branding

Data Flow

Chat Message Flow

User β†’ Frontend β†’ Nginx β†’ Chatbot β†’ External AI β†’ LLM Gateway β†’ Ollama
                                  ↓
                            Knowledge Service β†’ ChromaDB (RAG)
                                  ↓
                            SearXNG (Web Search)
                                  ↓
                            Vault (PII Handling)

Report Generation Flow

User Request β†’ Flask API β†’ Request Classifier
                              ↓
                        [>2000 tokens?]
                              ↓ Yes
                        Redis Queue β†’ Report Worker
                                          ↓
                                    External AI (generation)
                                          ↓
                                    PDF Generator
                                          ↓
                                    File Storage β†’ User Download

Network Architecture

Internal Docker Network

All services communicate on the sting-network Docker bridge network.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      sting-network                               β”‚
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚ frontend β”‚  β”‚   app    β”‚  β”‚ chatbot  β”‚  β”‚knowledge β”‚        β”‚
β”‚  β”‚  :443    β”‚  β”‚  :5000   β”‚  β”‚  :8001   β”‚  β”‚  :8002   β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚external- β”‚  β”‚ searxng  β”‚  β”‚llm-gate- β”‚  β”‚  vault   β”‚        β”‚
β”‚  β”‚   ai     β”‚  β”‚  :8080   β”‚  β”‚way-proxy β”‚  β”‚  :8200   β”‚        β”‚
β”‚  β”‚  :8004   β”‚  β”‚          β”‚  β”‚ :11434   β”‚  β”‚          β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚   db     β”‚  β”‚  chroma  β”‚  β”‚  redis   β”‚  β”‚  kratos  β”‚        β”‚
β”‚  β”‚  :5432   β”‚  β”‚  :8000   β”‚  β”‚  :6379   β”‚  β”‚:4433/4434β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

External Access

PortServicePurpose
443Frontend/NginxHTTPS web access
5050Flask APIDirect API access (dev)
8200VaultSecrets management UI

Key Architectural Principles

1. Local-First AI

  • All AI processing can run locally via Ollama
  • No mandatory external API dependencies
  • Optional external LLM providers for enhanced capabilities

2. Privacy by Design

  • PII detection and Vault-based encryption
  • Self-hosted search (SearXNG)
  • No telemetry or data exfiltration

3. Microservices with Boundaries

  • Clear service responsibilities
  • API-based communication
  • Independent scaling and deployment

4. Async Processing

  • Background workers for long-running tasks
  • Redis-backed job queues
  • Non-blocking user experience

5. Security Layers

  • Ory Kratos for identity management
  • HashiCorp Vault for secrets
  • WebAuthn/Passkey support for passwordless auth

Technology Stack

Languages & Frameworks

  • Frontend: React 18, Material-UI, Redux Toolkit
  • Backend: Python 3.11+, Flask, FastAPI
  • Workers: Python with Redis RQ

Databases

  • PostgreSQL 16: Primary relational data
  • ChromaDB: Vector embeddings
  • Redis 7: Caching, sessions, queues

AI/ML

  • Ollama: Local LLM inference
  • LangChain: AI orchestration
  • SearXNG: Meta-search aggregation

Infrastructure

  • Docker: Container runtime
  • Nginx: Reverse proxy, static serving
  • Ory Kratos: Identity management
  • HashiCorp Vault: Secrets management

Last updated: January 2026

Last updated: