⚙️

[Project 4b] PM Intelligence Engine

A 7-Stage Signal-to-Decision Pipeline That Runs on the PM's Thinking, Not Around It
notion image
👉🏻
Executive Summary
PM Intelligence Engine is a personal workflow execution engine that converts market signals into structured product decisions through a 7-stage AI pipeline with mandatory human gates. Unlike conversational AI tools that assist with individual tasks, it runs the full decision workflow — from signal normalization through multi-agent evaluation to routing decisions and executive summaries — while ensuring the PM's judgment, not the system's, determines what happens next. Each stage has typed input/output contracts, making every recommendation traceable to its evidence chain. The system is designed around a single principle: automation should handle orchestration, not judgment.
  • Type: 🧭 Personal PM Operating System (Non-Commercial)
  • Context: A FastAPI + SQLite service running on an always-on iMac, coordinating with pm-decision-context (reasoning contract), pm-wiki (knowledge output), and Hermes (operations plane)
  • Focus: How a structured stage pipeline with human gates produces traceable, auditable PM decisions at each step

🎯 Objective

Product managers spend most of their time on the work surrounding decisions — gathering signals, formatting documents, synthesizing evaluations — rather than on the decisions themselves. This project was built on a different premise: the structured orchestration of PM analysis can and should be automated, so the PM's time goes entirely to the judgment calls that automation can't make.
The goal was not to build a tool that assists with PM work. It was to build a system that runs the full decision workflow — from raw signal intake to routing decision and executive summary — with the PM's thinking encoded at every stage and the PM's judgment preserved at every gate. The system executes; the PM decides.

⚙️ High-Level Architecture

The engine is built around a simple three-phase arc: SENSE → DECIDE → LEARN.
It is intentionally narrow in scope: it runs stages, persists state, manages human gates, and exports artifacts. Signal harvesting, wiki sync, and operational scheduling are owned by the separate Hermes operations plane, which interacts with the engine exclusively via its HTTP API. This boundary is enforced as a design principle — direct database mutation or file-based approval by external systems is prohibited.
Layer
Responsibility
Public API Surface
POST /signals, POST /runs/start, GET /runs, gate action routes
Workflow Engine
S1–S7 stage execution, gate state machine, SQLite persistence
Export
run_finalizer — single exit point on terminal state; writes completed-run artifacts to the pm-intelligence-engine archive
Notifications
Hermes (ops plane) — Gate 1/2/3 notifications via Discord/Telegram; engine FanoutNotifier for local/development use only
External systems — pm-decision-context (reasoning contract loaded at every LLM call) and Hermes (signal harvesting, wiki sync, scheduling) — interact only through the published API contract. The engine never reaches outward.

📋 The 7-Stage Pipeline

Each signal runs through a sequential pipeline with typed input/output contracts at every boundary. The choice to use stage functions rather than conversational agents was deliberate: each stage has a strict Pydantic model in, Pydantic model out signature. This makes every stage testable in isolation, every output traceable, and every revision request precise.
Stage
Name
LLM
Description
S1
Signal
No
Normalize raw input into a structured, factual signal record
S2
Insight
Yes
Extract "what changed" and connect it to a strategy pillar
S3
Opportunity
Yes
Frame a falsifiable hypothesis with target user and assumed value
S4
Evaluation
Yes × 4
Four independent persona agents evaluate in parallel
S5
Prioritization
Partial
Weighted composite score → routing decision (PRD / PoC / Kill)
S6A
PoC Plan
Yes
Minimum experiment design for low-confidence opportunities
S6B
PRD
Yes
Structured product requirements document for high-confidence opportunities
S7
Executive Summary
Yes
One-page narrative brief; archived in pm-intelligence-engine when a decide run completes; Hermes (ops plane) syncs completed decision runs to the wiki
For a decision workflow, rigidity is a feature: stages cannot produce unchecked narrative outputs that escape evaluation. Stages can be re-run individually if a revision is needed, and the eval harness verifies each stage's output against golden data from historical runs.

🧑‍⚖️ Human Gate Design

One gate. Not three.
The original design considered approval gates after S3, S4, and S7. This was simplified to a single gate after S4 — the stage where all four persona agents complete their independent evaluations.
S1–S3 are relatively deterministic: signal normalization, insight extraction, opportunity framing. PM review at this stage has low value and creates unnecessary friction. S4 is where the most judgment-sensitive content is produced — four independent perspectives on whether the opportunity is worth pursuing. This is the right moment for PM oversight before scoring and routing lock in. S7 synthesizes already-approved content; a second gate would slow the workflow without meaningful added control.
The gate is implemented through the engine's POST /runs/{id}/decision endpoint, which the PM can use from their phone via a Tailscale-connected review page. After S4 completes, Hermes sends the Gate 2 notification with the review link; the PM opens it, reads all four persona evaluations, and chooses: Approve, Revise, or Reject. Hermes bridges the PM's response back to the engine via the decision API; the engine's built-in FanoutNotifier is for local/development use only. The system waits. Automation never bypasses this step.
The state diagram below shows three gates in the run lifecycle, but they differ in kind. Gate 2 (approval, after S4) is the judgment-heavy human gate described above. Gate 1 (direction, after S2) and Gate 3 (routing, after S5) are lighter direction-setting and routing-confirmation checkpoints. "One gate, not three" refers to approval gates specifically.
stateDiagram-v2
  [*] --> running: POST /runs/start
  running --> gate1: S2 complete
  gate1 --> running: decision · advance_to (choose depth)
  running --> gate2: S4 complete (decide depth)
  gate2 --> running: decision · advance
  gate2 --> running: decision · revise (rerun S4)
  gate2 --> done_stopped: decision · stop
  running --> gate3: S5 complete (decide depth)
  gate3 --> running: decision · advance / advance_to (PoC or PRD)
  gate3 --> done_stopped: decision · stop / confirm Kill
  running --> done_completed: selected depth reached / S7 complete
  done_completed --> [*]
  done_stopped --> [*]
  state "Gate 1: paused @ s2 (Direction)" as gate1
  state "Gate 2: paused @ s4 (Evaluation)" as gate2
  state "Gate 3: paused @ s5 (Routing)" as gate3
  state "done / completed" as done_completed
  state "done / stopped" as done_stopped

🤖 S4: Multi-Agent Persona Evaluation

Four personas evaluate every opportunity independently and in parallel:
Persona
Lens
Explorer
What's the upside? What could this unlock?
Strategist
Does this fit the strategic direction?
Builder
Can this actually be built? At what cost?
Skeptic
What's likely to go wrong? What are we assuming?
These aren't generic AI roles — they're the PM's own internal evaluation perspectives, made explicit as structured agents. The Explorer keeps the analysis from being too conservative. The Skeptic keeps it from being too optimistic. The Strategist and Builder ground it in fit and feasibility.
Running all four in parallel means S4 adds no additional latency per persona — all four evaluations complete simultaneously. The PM reads all four before S5 runs, which means the routing decision is informed by the full range of perspectives, not a single synthesized summary.

⚖️ Key Design Decisions

Stage functions, not agents. Each stage has a typed I/O contract rather than open-ended conversational behavior. This makes stages testable, revisable, and evaluable independently. For a decision workflow, rigidity is a feature.
SQLite first, not PostgreSQL. The system is a single-user personal tool with no deployment infrastructure. The PMWorkflowStore Protocol abstraction makes the migration to PostgreSQL a one-file change when the need arises — the schema mirrors what PostgreSQL-ready code would look like.
Vendor-agnostic LLM. A minimal LLMProvider protocol with direct SDK calls rather than LangChain — no abstraction layers to debug, model selection per stage is possible, and prompt templates are plain Markdown files editable without framework knowledge.
No LangGraph in v1. The workflow has one branching point (S5 routing: PRD / PoC / Kill), which is a simple conditional. LangGraph adds learning curve and overhead without meaningful capability at this stage. The upgrade path is clear if branching complexity grows.
Eval-first. The eval harness was built before any feature code, using real historical decision runs as golden data. Quality measurement was a design requirement, not a retrofit.

🔧 Infrastructure & Operations

The engine runs on an always-on iMac as a FastAPI service managed by launchd — lid-close on a MacBook would suspend the process and break Hermes polling and gate review links. Tailscale connects the iMac, iPhone, and MacBook in a private network; gate review links are accessible from any device without port-forwarding.
All commands are available via make:
Command
Description
make start / stop / restart
Manage the background server
make dev
Foreground with --reload for development
make test
Unit + integration test suite
make eval
Run the eval harness against the current LLM provider
make install-service
Register as a launchd agent (auto-start on login)

🧠 PM Learning Outcomes

This project clarified that automating PM work is not about replacing PM judgment — it's about eliminating the orchestration overhead that surrounds judgment. The structured pipeline, the typed stage contracts, and the single human gate are all expressions of the same idea: automation earns trust by being bounded and transparent, not by being maximally capable.
Building the eval harness before feature code reinforced something about quality in AI systems: you can't improve what you can't measure, and measurement is hardest to add after the fact. Defining what "good" looks like for each stage — before any stage was built — shaped every subsequent implementation decision.
The system also made clear that traceability is a UX requirement, not just an engineering concern. Every stage output is stored. Every gate decision is logged. Every artifact is linked to the run that produced it. When the PM reviews a decision months later, the full reasoning chain is there.

🗺️ How This Fits Into the Larger System

  • Project 4b: PM Intelligence Engine ← here — the workflow engine