A framework that turns a customer's tribal knowledge (SOPs, policies, past decisions) plus data access into structured prescriptions — decisions proposed with evidence, impact estimates, confidence, and a one-click path to execute.
Prescriptive intelligence is the walk stage between co-pilots (crawl) and autonomous software (run). PIP is the scaffolding that makes the paradigm tangible.
- Seven-phase pipeline: bootstrap → connect → awareness → diagnose → prescribe → execute → learn.
- Declarative edges: user writes
intent.md, drops SOPs into folders, fills oneconnections.yaml. - Prompts as first-class artifacts under
pipproto/prompts/— the real IP. - Consolidated SOPs are markdown-first artifacts with a required structured extract block for parsing.
- Awareness uses a bounded model-authored Python compute step to derive rollups before final reasoning.
- Paragraph-form hypotheses + rejected hypotheses with written rejection reasoning (the diagnosis engine is not a label classifier).
- Permission-gated execution (
allow/ask/deny) with a written reason on every call — evenallow. - Cumulative verdict/outcome store → graduation candidates for auto-execution.
- No UI. Outputs are structured JSON.
- No production-grade transport features. Reads support
local_fileJSON or simple HTTPGET; writes support dry-run or simple bearer-auth JSONPOST/PUT/PATCH. - No RAG. Consolidated SOPs carry
[ref: ...]markers back to raw source files. - No PDF/DOCX ingestion. Markdown and plain text only.
- No pagination, retries, rollback, OAuth, or rich workflow orchestration.
See PIP-plan.md-style commentary inline in each phase module for detail.
Dependencies are installed directly on the machine (no venv):
python -c "import pydantic, yaml, click, openai; print('ok')"If anything is missing, install it with python -m pip install <pkg>.
Set your OpenRouter key:
export OPENROUTER_API_KEY=sk-or-v1-...Default models (changeable in pip.config.yaml):
openai/gpt-5.4-mini— standard callsopenai/gpt-5.4-mini— strong calls in the current demo config as well
python -m pipproto.cli --root examples/returnflow-demo bootstrap # Phase 1: consolidate SOPs + build domain model
python -m pipproto.cli --root examples/returnflow-demo awareness # Phase 3: pull seeded data, compute KPIs, flag anomalies
python -m pipproto.cli --root examples/returnflow-demo diagnose # Phase 4: hypothesis-driven diagnosis
python -m pipproto.cli --root examples/returnflow-demo prescribe # Phase 5: ranked prescriptions
python -m pipproto.cli --root examples/returnflow-demo execute --yes # Phase 6: dry-run execution, auto-approve 'ask'Or, after bootstrap, the runtime shortcut:
python -m pipproto.cli --root examples/returnflow-demo run # awareness → diagnose → prescribeVerdicts and outcomes:
python -m pipproto.cli --root examples/returnflow-demo verdict rx-2026-04-20-001 accepted --reason "Approved by ops"
python -m pipproto.cli --root examples/returnflow-demo outcome rx-2026-04-20-001 0.11
python -m pipproto.cli --root examples/returnflow-demo graduateOutputs land under outputs/{awareness,diagnoses,prescriptions,executions}/.
Verdicts and outcomes land under learning/feedback-store.json.
Execution note:
execution.dry_run: truemeans Phase 6 simulates writes and logs what would have happened.- Set
execution.dry_run: falseto make real HTTP write calls through the configured transport.
pip.config.yaml runtime config + model strings
intent.md customer's voice — threaded through every phase
sops/ per-decision folders, each with raw/ + generated consolidated.md
connections.yaml single file: reads + writes, with permission per write
pipproto/ framework source (phases/, prompts/, types, cli)
outputs/ generated per-run artifacts
learning/ verdicts, outcomes, graduation candidates
examples/returnflow-demo/ a fully-populated post-purchase example
mkdir my-deployment && cd my-deployment
cp ../examples/returnflow-demo/pip.config.yaml .
# author intent.md describing what you want PIP to do
# create sops/<core-business-decision>/raw/*.md with your real SOPs
python -m pipproto.cli --root . bootstrap # generates consolidated SOPs + domain-model.json + connections.yaml skeleton
# fill in connections.yaml (local_file or simple GET endpoint for reads, JSON write endpoints, permission per write)
python -m pipproto.cli --root . runNo cartridges ship with PIP. Cartridges emerge from your SOPs.