System Architecture 中文版
AI-native global trade intelligence — 8 autonomous agents, 8 ETL pipeline jobs, pgvector-powered RAG KB, and a self-evolving feedback loop.
Operational Components ✓ vs In Progress
Green checkmarks indicate components that are built, tested, and operational. Items without checkmarks are planned or in development.
Not Shell AI. Compliance Infrastructure.
After P0 (Compliance Assertion Engine + Immutable Audit) and P1 (Shadow Graph Pipeline + Tenant Sub-Graphs) enhancements — Aegis is now a full compliance infrastructure platform, not an AI wrapper.
Full-Stack Architecture — 5 Layers, 8 Agents, 8 ETL Jobs
End-to-end data flow from ingestion to decision — every layer connected by a continuous feedback loop that vectorizes corrections to pgvector.
5-Layer Full Stack Architecture
From data ingestion to presentation — every layer built for deterministic AI compliance.
Trade Graph Core — Not a Database. A Regulatory Reasoning Engine.
50K+ nodes, 218K+ edges across 5 jurisdictions. Entity resolution (4-stage) → Graph traversal (BFS) → Decision synthesis → Continuous flywheel enrichment.
From Sources to Decisions — Self-Evolving Pipeline
Every API call enriches the Trade Graph. User corrections are vectorized into pgvector. The system never stops improving.
Multi-Agent Orchestration Pipeline
8 autonomous AI agents orchestrated via LangGraph StateGraph — input flows through 5 compliance agents, then 3 flywheel agents close the loop.
6 Data Categories — 8 ETL Pipeline Jobs
From official authority databases to real-time user feedback — every layer feeds the knowledge graph.
L1 — Authority Data
WCO · WTO · USITC · BIS · OFAC · EU · UN. Official sanctions databases, multilateral tariff schedules, binding customs rulings — synchronized daily.
L2 — National Systems
TARIC · HTSUS · GACC · UK HMRC · ASEAN AHTN. Country-specific customs portals and national tariff engines — 180+ jurisdictions normalized.
L3 — Commercial Intelligence
Dow Jones · Refinitiv · D&B · OpenCorporates. Global risk intelligence, corporate ownership graphs, financial crime databases.
L4 — Trade Flow
Panjiva · ImportGenius · Comtrade · Freight APIs. Live bill-of-lading feeds, maritime vessel telemetry, cross-border shipment data — real-time mapping.
L5 — Feedback Loop
User Corrections · ERP Logs · Shopify Data. Every correction vectorized to pgvector. Every API call enriches the Trade Graph — self-evolving intelligence.
6 — Company & UBO
OpenCorporates API · UBO Registries · UN Comtrade Flows. Entity resolution pipeline with 4-stage normalization and continuous sync.
Enterprise Security & Compliance
Not Shell AI. Compliance Infrastructure with Irreversible Competitive Moats.
Six structural advantages that make Aegis impossible to commoditize — from zero-friction onboarding to legally defensible audit trails.
1. Zero-Friction Onboarding
Shopify OAuth → Shadow Graph Pipeline pulls 12 months of orders. AI classifies every product. Within 60 seconds of signup, users see a Compliance Health Report with estimated tax recovery — before they type a single word. Instant value, zero manual input.
2. Legally Defensible Outputs
15 compliance assertions per classification, each backed by CustomsRulings DB citations, GRI rules, and regulatory text. Immutable Audit Chain (SHA-256 hash-linked) proves no tampering. PDF certificates exportable for customs defense. You sell evidence, not guesses.
3. Self-Evolving Intelligence
Every user correction is vectorized to pgvector. Professional broker feedback gets 5x weight via User Authority Score. Golden Set auto-promotes verified classifications. Accuracy compounds with every API call. Competitors face a cold-start problem that deepens over time.
4. Multi-Jurisdiction Coverage
180+ countries. 5 regulatory regimes (US EAR/ITAR, EU Dual-Use, CN, UK, JP). 50+ sanctions watchlists. 8 ETL pipeline jobs sync daily/weekly/monthly. Trade Graph connects 50K+ nodes across 218K+ regulatory edges. No single jurisdiction product competes with this breadth.
5. API-First Infrastructure
110+ REST endpoints. Real-time WebSocket + SSE for async task progress. OpenAPI 3.1 with auto-generated SDKs. Shopify webhooks, WooCommerce plugin, Zapier connector. JWT + OAuth (Google/Microsoft/Apple). Built to be embedded, not just visited.
6. Data Network Effects (The Core Moat)
Every classification enriches the Trade Graph. Tenant Sub-Graphs feed the global graph with attribution. More users → more edges → higher accuracy. Professional broker corrections compound. The graph is not reproducible from public data alone. This is the irreversible moat.
Aegis V4.0 — Not a ChatGPT Wrapper. Not a Database. A Compliance Reasoning Engine.
8 AI agents · 110+ API endpoints · 8 ETL jobs · 15 compliance assertions · SHA-256 audit chain · 50K+ graph nodes · Tenant isolation · PDF certificates
Four Critical Gaps — Closed. Enterprise-Ready Architecture.
Addressing dual-track privacy, durable execution, agentic ETL, and human-in-the-loop routing — the four structural prerequisites for Fortune 500 procurement.
★ Gap 1: Dual-Track Privacy Architecture
Problem: Zero Data Retention guarantee conflicted with Feedback Flywheel — raw product descriptions stored permanently. Solution: DataMaskingFilter strips PII before graph storage. Track A (Ephemeral Vault) purges after 72h. Track B (Anonymized Topology) retains only semantic features. GDPR Article 17 hard-purge endpoint.
backend/app/services/data_masking.py — PII patterns, semantic extraction, purge scheduler
★ Gap 2: Durable Execution Layer
Problem: 50,000-SKU manifests lost all progress on network failure — no checkpointing, no resume. Solution: BatchManifestEngine with per-SKU state machine (QUEUED→IN_PROGRESS→DONE/FAILED), checkpoint every 100 SKUs, exponential backoff retry, rate-limit awareness, pause/resume, and partial-success completion.
backend/app/services/batch_manifest_engine.py — state machine, checkpointing, rate limiting
★ Gap 3: Agentic ETL Pipeline (Activated)
Problem: 5 of 8 ETL sync jobs were stubs returning processed=0 — rulings, sanctions, tariffs not actually syncing. Solution: Rulings sync wired to live CBP CROSS, EU BTI, UK HMRC scrapers. Sanctions sync calls OFAC SDN CSV download. Pipeline monitor alerts on data staleness >30h. Auto-vectorization on new ruling ingestion.
backend/app/etl/rulings_sync.py → trade_graph/rulings/scraper.py — live API calls
★ Gap 4: HITL Escrow Gateway + Bug Fix
Problem: FlywheelEngine missing get_validation_queue() method — crash on GET /flywheel/queue. No confidence-gated review routing. Solution: EscrowGateway routes <85% confidence items to human review workspace. State machine: PENDING→IN_REVIEW→APPROVED/CORRECTED. 24h SLA tracking. Reviewer authority weighting for Flywheel. Fixed FlywheelEngine bug.
backend/app/trade_agent/escrow_gateway.py — confidence gate, review queue, SLA tracking
V4.1 Enterprise-Ready — "The Armored Truck, Not Just the Racing Engine."
Dual-track privacy · Durable execution · Live ETL scrapers · Human-in-the-loop routing · 4 critical enterprise gaps closed
91% Complete — Production Readiness Roadmap
32 gaps identified across 4 domains. 29 resolved (91%). 3 remain — all non-engineering: customers, partnerships, and compliance certification.
Completed — 29 Items Resolved
Remaining — 3 Items (All Non-Engineering)
First 10 Paying Customers
Why: Validates pricing model, user experience, and market demand. Converts the platform from a technical system into a revenue-generating business.
How: Launch Shopify App Store listing → free trial funnel → feedback-driven iteration → paid conversion.
Owner: Business Development | Timeline: Q3-Q4 2026 | Blocked by: Shopify App Store approval
E&O Insurance ($2-5M Coverage)
Why: Errors & Omissions insurance is mandatory for any service providing customs classification advice. Protects against liability from incorrect HS code assignments or tariff calculations.
How: Engage insurance broker specializing in trade/tech → underwrite based on 99.2% accuracy → secure $2-5M policy → publish coverage certificate.
Owner: Legal/Compliance | Timeline: Q4 2026-Q1 2027 | Blocked by: Customer volume data for underwriting
Licensed Customs Broker Partnerships
Why: Only licensed customs brokers can legally file entries with customs authorities (US CBP, EU customs, etc.). Aegis provides the AI classification — brokers provide the legal filing authority.
How: Identify 3-5 licensed brokers in key jurisdictions → partnership agreement (revenue share per filing) → API integration for automated filing → compliance review.
Owner: Business Development | Timeline: Q4 2026-Q2 2027 | Blocked by: Broker due diligence + regulatory approval
In Progress — EU AI Act Conformity Assessment
Context: The EU AI Act (effective August 2026) classifies AI systems by risk tier. Aegis's customs classification AI falls under "Limited Risk" (transparency obligations) — not "High Risk" since human customs brokers make the final filing decision. However, if Aegis were to file directly without broker review, it would escalate to "High Risk" requiring conformity assessment, technical documentation, and CE marking.
Ready to Explore the Architecture?
Deploy the full AI compliance stack. Start free, no credit card required.