Architecture
A six-stage event loop with retry plus dead-letter on every queue. Every transition is Chainlog-anchored before the next worker touches the row.
CogniLead runs as a queue-driven event loop. There are six stages — ingestion, intersect, personalize, policy, dispatch, observe — and every transition between them is durable. We never call an LLM, never dispatch an email, never write to the customer-facing API without an immutable Chainlog event written first.
The six stages
- Ingestion. Apify actors, GitHub GraphQL, HN Algolia, Crunchbase webhook, BuiltWith. Each worker writes a raw signal row and emits signal.ingested.
- Intersect. Suppression check → dedup → Chainlog anchor. No lead proceeds without proof of ingestion timestamp.
- Personalize. Jurisdiction-aware routing through PHI Gateway. CH / EU traffic lands on Mistral or Infomaniak; US lands on Anthropic. Strict JSON output with technical_hook_verified.
- Policy. AgentGate evaluates the outbound-gdpr risk pack. Hook verification, body length, sender warmth, jurisdiction, blocked sales language. Denials are written to Chainlog with a reason code.
- Dispatch. Resend Automations. Per-step callback to AgentGate to catch leads that went stale between stages.
- Observe. Bounces, replies, opens (where consented), unsubscribes. Suppression list updates and reputation circuit breaker.
Why this shape
The interesting design choice is that Chainlog writes happen between every stage, not just at boundaries. That makes the audit trail load-bearing for runtime behavior — a stage failing to write its event means the next stage refuses the row, not just that the audit looks incomplete. The compliance posture is enforced by the same primitive that records it.
Every queue ships retry-with-backoff plus a dead-letter sink. Failed rows are inspectable in /dashboard/leads with the full chain of decisions. We never silently drop a lead — a drop is a Chainlog event with a reason code, retrievable in the evidence pack.
Two free MCP tools surface this pipeline inside Cursor or Claude Desktop — no key required.