Skip to content

uberprompt infer

Find semantic edges between fragments that no uses declaration covers.

Usage

bash
uberprompt infer

Reads all prompt and fragment files and sends their texts to gpt-5-nano. The model flags pairs of fragments that are related but have no declared uses edge. With --apply, the edges are written to apps/demo/edges.json as kind: "semantic".

Flags

FlagDescription
--threshold <n>Minimum confidence score (0-1) to accept an edge (default: 0.7)
--applyWrite discovered edges to edges.json immediately
--jsonOutput results as JSON

Examples

Preview inferred edges without writing:

$ uberprompt infer

Inferred semantic edges:
  escalation-criteria ↔ refund-policy        (0.85)
  brand-voice ↔ output-format                (0.72)

2 edges found above threshold (0.70)
Run with --apply to write to edges.json

Apply with a higher threshold:

bash
uberprompt infer --threshold 0.85 --apply

How it works

  1. Loads all fragment texts from apps/demo/fragments/ and inline fragments from apps/demo/prompts/
  2. Skips fragments with empty text (runtime input slots like )
  3. Sends fragment pairs to the model, which scores how related each pair is
  4. Filters results by the confidence threshold
  5. With --apply, merges new edges into edges.json (existing edges are preserved)