Skip to main content

Generate Deterministic Facts for AI with vg facts

vg facts produces deterministic, epistemic-typed facts — contract, invariant, characterization — for a node, ranging from declared/static to observed/derived, to reliably ground AI assistants.

Difficulty
Advanced
Duration
20 minutes
Steps
5

AI assistants reason better when they are given facts they can trust. vg facts produces deterministic open facts for a node — its contract, invariants, and characterization — each labeled with how it was derived.

Prerequisites

  • A built code graph from vg build

Steps

1. Build the graph

vg build

2. Generate facts

vg facts

Provide the node you care about. vg facts returns deterministic facts about it.

3. Read the fact types

Facts come in kinds: a contract (what the node promises), an invariant (what always holds), and a characterization (how the node behaves in practice). Together they describe the node without you reading every line.

4. Read epistemic typing

Each fact is epistemic-typed, ranging from declared/static (read directly from the source) through to observed/derived (inferred from behavior). The typing tells you how much to trust each fact and where it came from.

5. Feed facts to an assistant

Use the facts as grounding for an AI assistant — paste them in directly, or serve them through Vibgrate AI Context:

vg serve

Grounding the assistant in deterministic facts reduces hallucination about your code.

Verification

Confirm vg facts returns facts tagged with their epistemic type for the node you queried. Cross-check a declared fact against the source to confirm accuracy.

Next Steps

  • Explain the node with vg show
  • Serve facts to your assistant with vg serve
  • Ask broader questions with vg ask

Prerequisites

  • A built code graph (vg build)

Steps

  • 1
    Build the graph
  • 2
    Generate facts
  • 3
    Read the fact types
  • 4
    Read epistemic typing
  • 5
    Feed facts to an assistant

Category

Vibgrate