πŸ›οΈ Enterprise Architecture Review

Hermes AI Trading Platform Β· July 30, 2026 Β· Confidential

47
Overall Score
Enterprise Maturity: Intermediate
Not ready for financial institution production. Strong foundation, critical gaps in testing, HA, DR, and security posture.

Category Scores

CategoryScoreRatingKey Finding
Architecture5.5/10IntermediateGood layering, no microservices, tight coupling between bot instances
AI Platform7/10ProductionStrong Hermes agent with skills/memory/cron. Missing eval framework.
Trading Engine4/10BeginnerNo backtesting pipeline, no walk-forward, no Monte Carlo
Infrastructure5/10IntermediateContainerized but no orchestration. No HA. Single VPS.
Security6/10IntermediateCentralized creds, no RBAC, no encryption-at-rest for secrets
Reliability3.5/10BeginnerNo DR plan, no failover, no circuit breakers in trading path
Performance5/10IntermediateAdequate for current load, no async in bot loops, no DB indexing
Code Quality4.5/10BeginnerNo tests, no CI/CD, configuration duplication across 4 envs
Trading Standards3/10BeginnerNo Sharpe/Sortino tracking, no Kelly sizing, no correlation analysis
Production Readiness3/10BeginnerSingle point of failure on every component

Top 20 Weaknesses

#SeverityCategoryWeakness
1CRITICALReliabilitySingle VPS β€” no HA, no failover, Total platform failure if host goes down
2CRITICALTradingNo backtesting pipeline with walk-forward validation β€” strategies selected by live performance gambling
3CRITICALCode QualityZero automated tests (no pytest, no CI/CD) β€” every change is a blind deploy
4HIGHProductionNo circuit breakers or retry logic in order execution path
5HIGHTradingNo slippage modeling β€” strategies assume they get limit price every time
6HIGHInfrastructureNo container orchestration (K8s/Nomad) β€” manual process management with shell scripts
7HIGHSecurityAPI keys in multiple .env files with 600 perms but no encryption at rest
8HIGHCode QualityConfig duplication across 4 environments with known drift history (strategies would balloon past cap)
9HIGHTradingNo portfolio correlation tracking β€” strategies can be all on same side of a crash
10HIGHArchitectureTight coupling between strategy discovery and production trading in same process
11HIGHProductionNo disaster recovery plan β€” no off-site backup of trading state
12MEDIUMAI PlatformNo LLM evaluation framework β€” model upgrades are blind (can't detect regressions)
13MEDIUMInfrastructureNo structured logging (all bot logs to single flat file per instance)
14MEDIUMSecurityNo audit log of credential changes β€” can't trace who changed what key when
15MEDIUMPerformanceNo database indexing on Postgres β€” queries slow as data grows
16MEDIUMArchitectureNo API versioning between components β€” gateway, bridge, dashboard tightly coupled
17MEDIUMTradingKelly criterion not used for position sizing β€” fixed fractions instead
18MEDIUMInfrastructureDocker image not version-pinned β€” `latest` tags could break on restart
19MEDIUMSecurityNo dependency scanning β€” vulnerabilities in 150+ Python packages unmonitored
20MEDIUMAI PlatformSingle model provider (DeepSeek) β€” if DeepSeek goes down, AI assistant is blind

Top 20 Improvements

#PriorityEffortImprovement
1CRITICAL3 weeksWrite a proper backtesting harness with walk-forward validation. Stop using live P&L as strategy selector.
2CRITICAL2 weeksAdd pytest suite with CI/CD (GitHub Actions). Test order flow, risk checks, config loading.
3HIGH1 weekImplement circuit breaker pattern on Alpaca API calls β€” stop trading if API latency spikes.
4HIGH1 weekAdd slippage model to backtesting β€” track fill vs limit price gap per strategy.
5HIGH2 weeksConsolidate 4 env configs into a single source with env-specific overlays (Hydra/OmegaConf).
6HIGH2 daysAdd structured logging (JSON) to all bots β€” ship to Grafana Loki or similar.
7HIGH1 weekImplement Kelly position sizing and portfolio correlation matrix.
8HIGH2 daysPin all Docker image versions β€” never use `latest` in production.
9HIGH2 daysAdd dependency scanning (pip-audit, Safety, or Dependabot).
10HIGH3 daysSet up a fallback provider chain for AI (DeepSeek→OpenRouter→Anthropic).
11HIGH1 dayAdd Monte Carlo simulation to all strategy backtests β€” probability distributions of returns.
12MEDIUM1 weekDeploy second VPS as hot standby with database replication.
13MEDIUM2 daysAdd database indexing to Postgres β€” queries for historical P&L currently scan all rows.
14MEDIUM3 daysCreate an LLM eval harness β€” benchmark responses before/after model changes.
15MEDIUM2 daysAdd GRPC or async message queue between components β€” decouple discovery from execution.
16MEDIUM1 dayEncrypt credentials.env with GPG or SOPS β€” decrypt only at runtime.
17MEDIUM3 daysAdd API versioning (v1/v2 prefixes) to all internal HTTP endpoints.
18MEDIUM1 dayTrack Sharpe/Sortino ratios per strategy over rolling 30-day windows.
19MEDIUM1 dayAdd credential audit log β€” timestamp every change to credentials.env.
20MEDIUM2 daysAdd readiness/liveness probes to all services β€” not just bot process checks.

Immediate Fixes (Do This Week)

  1. Pin Docker images β€” replace latest with explicit version tags. A docker pull on restart could break everything.
  2. Add AI fallback provider β€” if DeepSeek is down, the entire Telegram assistant is blind. Configure OpenRouter as fallback.
  3. Add structured logging β€” JSON logs to a dedicated file per service. Grepping flat files for errors is not production.
  4. Encrypt credentials.env β€” GPG encrypt the central credential file. Decrypt into memory at startup, never write plaintext to disk.
  5. Pin strategy rankings β€” the daily review cron needs a minimum-trades threshold before swapping (currently swaps on 3 trades). Change to 10.
  6. Add circuit breaker on Alpaca order endpoint β€” if 3 consecutive orders fail, stop trading for 5 minutes.
  7. Track slippage β€” log fill_price vs limit_price on every order. This data is critical for backtest accuracy.
  8. Pin Python package versions β€” requirements.txt should lock all transitive deps, not just top-level.

Nice-to-Have Improvements

Risk Matrices

πŸ”΄ Security Risks

RiskLikelihoodImpactMitigation
Credentials leaked via gitMediumCritical.gitignore + credentials.env outside repo (done). Add git hooks to block accidental commits.
Dependency with known CVE exploitedMediumHighNo scanning. Add dependabot or pip-audit to weekly cron.
Telegram bot token compromisedLowMediumToken in .env with 600 perms. Rotate quarterly.
Prompt injection via TelegramMediumMediumNo guardrails on user input to LLM. Add system prompt hardening.

πŸ”΄ Trading Risks

RiskLikelihoodImpactMitigation
Strategy selected by luck (not backtesting)HighHighBuild walk-forward backtest harness. This is the #1 risk today.
All strategies correlated in a crashMediumCriticalNo correlation matrix today. Add portfolio correlation tracking.
Budget gate wrong β€” over-tradingLowHighBudget gate works. But no circuit breaker if it fails.
Alpaca API outageLowHighNo alternate broker configured. Single point of broker failure.
Order fills worse than backtest assumptionHighMediumNo slippage tracking. Add fill vs limit price logging.

πŸ”΄ AI Risks

RiskLikelihoodImpactMitigation
DeepSeek API outageLowHighNo fallback provider configured. Add OpenRouter.
Model regression on upgradeMediumMediumNo eval harness. Build LLM benchmark suite.
Context window overflow on long sessionMediumLowHermes has auto-compression. Monitor compression frequency.
LLM hallucination in trading decisionLowHighLLM only assists, doesn't execute. Risk is low by design.

πŸ”΄ Production Risks

RiskLikelihoodImpactMitigation
Single VPS host failureLowCriticalTotal platform loss. Deploy second VPS with replicated DB.
Disk full (logs)MediumHighNo log rotation configured on all services. Add logrotate.
Memory exhaustion from 4x bot instancesMediumHigh11GB used/15GB β€” 4GB free. Monitor with alert at 2GB free.
Container restart loses running stateLowMediumBots are nohup processes outside container lifecycle. Inconsistent.

Technical Debt

  1. Config duplication β€” 4 identical config.yaml files with known drift. Single source with overlays needed.
  2. Script sprawl β€” 70+ cron jobs, 20+ shell scripts in /opt/data/scripts/, many untracked in git (now fixed).
  3. No type hints β€” Python codebase has minimal type annotations. MyPy would catch 50+ bugs.
  4. Strategy discovery vs execution coupling β€” same process discovers AND trades. Should be separate microservices.
  5. No API contracts β€” internal HTTP APIs have no OpenAPI specs. Breaking changes go undetected.
  6. Logs as source of truth β€” trading state is read from log files and strategy_performance.json. Should be in Postgres.
  7. Bash as orchestrator β€” keepalive, watchdog, scout all in bash. Shell scripts are fragile (quoting bugs, trap handling).
  8. No dependency lockfile β€” pip installs unpinned packages every time. Reproducibility is broken.

Suggested Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        PUBLIC INTERNET                                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Tailscale Funnel  β”‚  ttyd :4860  β”‚  Telegram Bot  β”‚  Email/SMTP       β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                     β”‚              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      REVERSE PROXY (port 80)                           β”‚
β”‚  routes: /dashboard β†’ :9119 Β· /cloud β†’ :8082 Β· /api β†’ :8766           β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                          β”‚
β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  HERMES GATEWAY β”‚    β”‚              TRADING BOT FLEET                  β”‚
β”‚  :8642          β”‚    β”‚                                                  β”‚
β”‚  Telegram ───────    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚  Skills/Memory  β”‚    β”‚  β”‚   QA    β”‚  β”‚  PROD   β”‚  β”‚  DEV    β”‚          β”‚
β”‚  MCP Servers    β”‚    β”‚  β”‚ paper   β”‚  β”‚ paper   β”‚  β”‚ paper   β”‚          β”‚
β”‚  Cron Jobs      β”‚    β”‚  β”‚ $4K     β”‚  β”‚ $4K     β”‚  β”‚ $4K     β”‚          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜          β”‚
                       β”‚       β”‚            β”‚            β”‚               β”‚
                       β”‚  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”          β”‚
                       β”‚  β”‚         SHARED SERVICES            β”‚          β”‚
                       β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚          β”‚
                       β”‚  β”‚  β”‚Alpaca  β”‚ β”‚Postgresβ”‚ β”‚Grafana β”‚  β”‚          β”‚
                       β”‚  β”‚  β”‚Paper APIβ”‚ β”‚:32772 β”‚ β”‚Cloud+  β”‚  β”‚          β”‚
                       β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚Langfuseβ”‚ β”‚Local   β”‚  β”‚          β”‚
                       β”‚  β”‚            β”‚n8n     β”‚ β”‚:8742   β”‚  β”‚          β”‚
                       β”‚  β”‚            β”‚Dify    β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚          β”‚
                       β”‚  β”‚            β”‚Swamp   β”‚              β”‚          β”‚
                       β”‚  β”‚            β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚          β”‚
                       β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Suggested Folder Structure

/opt/data/
β”œβ”€β”€ hermes-workspace/          # Git repo (3-copy sync)
β”‚   β”œβ”€β”€ live/            # LIVE bot
β”‚   β”œβ”€β”€ qa/                    # QA paper bot
β”‚   β”œβ”€β”€ prod/                  # PROD paper bot
β”‚   β”œβ”€β”€ dev/                   # DEV paper bot
β”‚   β”œβ”€β”€ scripts/               # Git-tracked scripts
β”‚   β”‚   └── infra/             # Infrastructure scripts mirror
β”‚   β”œβ”€β”€ dashboard/             # Trading dashboard
β”‚   β”œβ”€β”€ secure-docs/           # Security-sensitive docs
β”‚   β”œβ”€β”€ shared-kb/             # Obsidian-compatible KB
β”‚   └── docs/                  # Design docs, architecture
β”œβ”€β”€ scripts/                   # Live scripts (some in git)
β”‚   β”œβ”€β”€ reverse-proxy-80.py
β”‚   β”œβ”€β”€ service-keepalive.sh
β”‚   β”œβ”€β”€ bot-watchdog.sh
β”‚   β”œβ”€β”€ trading-review.py
β”‚   └── strategy-scout.sh
β”œβ”€β”€ shared-kb/                 # Obsidian vault (separate git)
β”œβ”€β”€ .credentials.env           # Central secrets (chmod 600)
β”œβ”€β”€ config.yaml                # Hermes agent config
β”œβ”€β”€ .env                       # Hermes agent env
β”œβ”€β”€ SOUL.md                    # Personality definition
└── logs/                      # All service logs

Suggested Technology Stack

LayerCurrentRecommended
Container RuntimeDocker + s6-overlayDocker Compose β†’ Kubernetes (if scaling)
OrchestrationNone (manual nohup)Docker Compose with restart:always
DatabasePostgres (self-hosted)Postgres + TimescaleDB for market data
CacheIn-memory dictsRedis for rate limiting, signal cache
Message QueueNoneNATS / RabbitMQ for order events
MonitoringGrafana Cloud + self-hostedGrafana + Loki + Prometheus + AlertManager
SecretsPlain file chmod 600HashiCorp Vault / SOPS / Mozilla sops
CI/CDNoneGitHub Actions + pytest + ruff
LoggingFlat filesJSON β†’ Loki β†’ Grafana
Feature StoreNoneFeast / Tecton for market features
ML RegistryNoneMLflow for strategy versioning

Suggested AI Ecosystem

ComponentCurrentRecommended
LLM ProviderDeepSeek v4 FlashDeepSeek (primary) + OpenRouter (fallback) + Gemini (vision)
Agent FrameworkHermes AgentKeep β€” best-in-class for this use case
MemoryHermes built-inAdd Honcho/Mem0 for persistent memory across restarts
MCP ServersZapier, SEC EdgarExpand: add Yahoo Finance, Polygon.io, broker-specific MCPs
Vector DBNoneChromaDB / Qdrant for strategy documentation RAG
Eval FrameworkNoneDeepEval / LangFuse for LLM response quality tracking
Prompt MgmtSOUL.md + skillsAdd versioned prompt templates with A/B testing
ObservabilityLangfuseKeep β€” add tracing to all gateway conversations

Enterprise Readiness Assessment

RequirementStatusNotes
HA / Fault Tolerance❌ Not MetSingle VPS hosts everything
Disaster Recovery❌ Not MetNo DR plan, no off-site state backup
Change Management⚠️ PartialGit tracking exists, no code review, no CI/CD
Observability⚠️ BasicGrafana present, no structured logging, no alerting
Security Audit Trail❌ Not MetNo audit log for config or credential changes
Compliance (SOC2)❌ Not MetNo access controls, no encryption at rest
Testing Coverage❌ Not MetZero automated tests
Documentation⚠️ PartialArchitecture docs exist, no runbooks, no diagrams
Capacity Planning⚠️ Partial15GB RAM, 200GB disk β€” adequate now, no growth plan

Estimated Maintainability

Score: 4.5/10 β€” Below Industry Standard

Estimated Scalability

Score: 3.5/10 β€” Limited

Final Verdict

Would I approve this platform for production in a financial institution?

No. Not without significant remediation.

This is a passionate solo developer's project with genuine architectural ambition β€” Hermes Agent integration, multi-env trading pipeline, MCP server ecosystem, Grafana monitoring β€” that has outgrown its bootstrap phase without the corresponding investment in production hardening.

The three dealbreakers for financial institution production:

  1. No testing β€” zero test coverage means every deploy is a trust exercise. In a financial system, untested code loses real money.
  2. No HA/DR β€” a single VPS failure takes down all trading, all monitoring, all AI assistance. No SLA possible.
  3. No backtesting rigor β€” strategies are selected by live P&L over 10-20 trades, which is statistically meaningless. A strategy can win by luck and get promoted, or lose by luck and get demoted.

The platform scores well on architecture vision (layering, AI integration, multi-env pipeline) and developer velocity (fast iteration, automated cron pipelines, daily review cycles). For a solo trading setup with $4K paper budget, this is above average. But the gap between "trading as a hobby" and "trading as a financial institution" is wide β€” and visible in every category.

The good news: the foundations are solid. The Hermes Agent integration, the credential guardrails, the strategy cap enforcement, the daily review cron β€” these are production-ready components. What's missing is the testing/QA/DR layer that wraps them in reliability. About 4-6 weeks of focused engineering could close most of the gap.

Verdict: Conditional Pass at 60-Day Milestone
If the top 10 critical/high improvements are delivered within 60 days, re-review. The core platform has Enterprise DNA wrapped in a Startup shell.

Enterprise Architecture Review Β· Hermes AI Trading Platform Β· July 30, 2026
Principal AI Architect Β· Confidential