Architecture
How the system is put together — one normalized signal plane in the middle, everything else reads from it.
The pieces
| Component | Technology | Job |
|---|---|---|
Web | Next.js 16 · React 19 | The workspace UI — server components against the API, Clerk for auth. |
API | NestJS 11 | A modular monolith: tenancy, RBAC, audit, scoring, intelligence, agents, graph, billing, public API. |
Ingestion | scheduled workers | Connectors on cadence (hourly → monthly) pulling federal sources; deterministic fingerprints dedupe re-observations. |
Signal plane | PostgreSQL (+pgvector) | One normalized table of market facts with provenance — the heart of the system. |
Graph Builder | PostgreSQL outbox · scheduled worker | The sole graph writer: resolves immutable IDs, validates temporal nodes/edges, materializes governed graph intelligence, tracks full-rebuild generations, retires stale managed records with evidence, retries/dead-letters failures, and supports replay. |
Knowledge graph | Neo4j | A lean, rebuildable relationship index. The builder uses the writer identity; API reads and exact PostgreSQL reconciliation require a different reader-only identity and reject mutation Cypher. |
Intelligence plane | versioned PostgreSQL objects | Twelve canonical output families across sixteen engines, with immutable evidence, publication and review gates, expiry, replacement, retry, dead letter, and replay. |
Agent OS | 10 governed agents | Versioned definitions, deterministic pre-LLM gates, tool allowlists, budgets, structured handoffs, interrupts, evaluations, immutable outputs, and replay. |
Execution plane | 23-component durable workflow catalog | Tasks, documents, approvals, provider actions, deadlines, dependencies, SLAs, compensation, pause/resume/cancel, retry, dead letter, replay, revenue, and outcomes share one context. |
Executive + learning | 15 executive · 10 learning modules | Reproducible scenarios and decisions feed strict evidence-to-outcome learning, drift holds, holdout comparison, historical replay, rollback, privacy thresholds, and approval-gated optimization. |
Cache / queues | Redis · BullMQ | Repeatable ingestion schedules and job state. |
AI runner | Claude | One grounded runner behind every agent persona — evidence packs in, cited briefs out, cost logged. |
Reporting | EventBridge Scheduler · SES | Atomic scheduled snapshot generation, truthful in-app/email delivery state, and immutable PDF, Excel, CSV, and PowerPoint distribution. |
Why a signal plane
Every source writes into the same normalized shape — a signal with a type, a payload, provenance, and a fingerprint. That one decision is what makes the rest cheap: scoring, recompete detection, contact and vehicle intelligence, the graph, and notifications are all readers over the same table, not bespoke pipelines per source. Adding a data source means writing one connector, and every downstream surface lights up.
Compute model
- Scores are computed on read — shared facts × your profile, per request. Nothing scored is written back, so profile edits take effect immediately.
- Ingestion is idempotent — connectors lock by fingerprint, deduplicate unchanged observations, version accepted changes, and preserve the stable signal ID.
- The graph is a governed projection — PostgreSQL records every graph event and validated node/edge first. Only the Graph Builder writer can mutate Neo4j; the API requires a different reader-only credential, rejects mutation Cypher, and rebuild requests enqueue work.
- Stronger evidence is not erased — a thin lower-authority transaction can update its contract timeline without replacing a stronger vendor capability, certification, or corporate-lineage profile.
- Financial unknowns remain unknown — IDV runway is calculated only from a source-backed ceiling and observed task-order obligations; every result exposes coverage, completeness, confidence, and warnings, and HIGH confidence requires a certified complete task-order population.
- Vendor performance is calculated, not guessed — shared vendor metrics materialize from accepted award, subaward, agency, office, vehicle, and lineage edges. Missing money stays null, and a recompete win requires an award-stage outcome plus explicit source lineage.
- Past teaming is observed, not assumed — a derived prime-to-subcontractor relationship requires a canonical accepted Subaward node plus its issuer and recipient. It retains shared contracts, agencies, source value coverage, and bounded evidence IDs; a generic partnership edge cannot fabricate historical teaming.
- Contact patterns are evidence, not influence — relationship strength, association count, and last-seen date derive only from active, accepted Contact → Contract or Task Order graph edges. A Contact with no such evidence has zero procurement strength, and repeat-only vendor affinity remains a separate derived relationship.
- Program identity is structured before semantic — agency, office, program office, program code, budget account, NAICS, and PSC fields establish compatible scope. A pgvector match is optional, never crosses an agency boundary, and must clear structural, similarity, and ambiguity gates before it can link a differently named Program.
- Projection integrity is checked before success is claimed — every scheduled Graph Builder pass reports accepted node/master and edge-endpoint consistency, expired active relationships, inactive-master residue, queue state, and bounded samples. Rebuild generations wait for every child, retire stale managed records, and compare exact IDs, edge keys, counts, and hashes through the separate reader identity.
- Market movement must clear an evidence gate — Growing Agency, Emerging Program, Vehicle Dependency, and Contract Concentration Risk are materialized only from active, comparable graph evidence; ambiguous vehicle links and weak samples are suppressed, and every result keeps its evidence IDs and confidence.
- PSC inference never rewrites source NAICS — repeated historical pairings seed a many-to-many internal crosswalk; one observation cannot activate a mapping, low-confidence rows remain governance-only, and every inferred code retains confidence and mapping evidence.
- Uncertain identities stop safely — exact IDs and known aliases resolve first, bounded deterministic similarity is permitted only at high confidence, and ambiguous names enter the independently authenticated platform Admin Panel without writing unsafe relationships.
- AI is never on the critical path — briefs are generated on request and cached; every run logs model, tokens, latency, and cost.
Where it runs. Web + API deploy as containers behind managed HTTPS; ingestion and the budget pipeline run as scheduled cloud tasks; due reports use a secret-authenticated scheduled dispatcher and optional SES delivery; PostgreSQL is managed with PITR backups and is not publicly reachable. See Security & tenancy for the data-plane model.