Skip to main content

Grounding AI Assistants with vg facts

A guide to feeding deterministic, epistemic-typed facts to AI assistants so their suggestions are grounded in your real code — contracts, invariants, and characterizations served via Vibgrate AI Context.

Vibgrate Docs

Vibgrate Help

AI assistants are most useful when they reason from facts rather than from training-data guesses. vg facts produces deterministic, epistemic-typed facts about your code that you can serve straight to an assistant. This guide shows how to combine vg facts with Vibgrate AI Context for grounded, reliable suggestions.

Overview

For a node, vg facts emits its contract (what it promises), invariants (what must hold), and characterization (observed behavior). Each fact is typed by how it was derived — from declared/static, read straight from the code, through to observed/derived, inferred from behavior. Because the output is deterministic, the same code always yields the same facts, which makes them safe to put in front of an AI.

Prerequisites

Build a code map:

vg build

Step 1 — Generate facts

vg facts

Review the facts and their epistemic types. Declared facts are authoritative; derived facts are useful hints. This typing lets the assistant weight them correctly rather than treating every statement as equally certain.

Step 2 — Serve facts to your assistant

Facts are part of Vibgrate AI Context, the local offline MCP server. Start it so any connected assistant can read your facts, code map, and version-correct docs:

vg serve

No account is needed and nothing is uploaded.

Step 3 — Wire up the assistant

Connect your assistant — Claude, Cursor, Windsurf, VS Code, Codex, or Gemini — to the context server:

vg install

This is idempotent and repo-local, so you can re-run it safely.

Why this beats raw prompting

Without grounding, an assistant guesses at contracts and invariants and often gets them subtly wrong. With vg facts, it reads them. Pair that with version-correct docs from vg lib and structural answers from vg ask, and the assistant is working from your real system instead of its memory.

Related

  • Generate node facts with vg facts.
  • Start the context server with vg serve.
  • Add the integration with vg install.
  • Access version-correct docs with vg lib.

Everything here runs locally and offline once set up.