Right Reasons

Structured business ontology giving AI agents deterministic access to institutional reasoning — 18 MCP tools, Dolt backend, 0% → 100% "why?" recall vs Markdown+RAG.

Right Reasons

Structured business ontology that gives AI agents deterministic access to institutional reasoning.

AI agents using Markdown + RAG score 0% recall on "why?" questions. The same agents using Right Reasons score 100%. Tested across 48 sessions with 2 independent judges. Full experiment results →

Experiment results

Tested on a real business domain (48 runs, 8 task types, 2 independent LLM judges):

MetricMarkdown + RAGRight ReasonsDelta
Entity recall0.5140.976+90%
"Why?" question recall0.0001.0000% → 100%
Reasoning quality1.96 / 54.33 / 5+121%
Stability (variance)1.4570.4723× more stable
Latency284.6s183.8s-35% faster
Pairwise wins020(4 ties)

Full methodology and results →

What it does

Right Reasons maps your business knowledge into a four-layer ontology:

LORE      (beliefs, worldview)
  ↓ interpreted_into
VISION    (goals, theses, priorities, boundaries)
  ↓ operationalized_into
RULES     (policies, decision rules, tactical concepts)
  ↓ applied_to
OPERATIONS (initiatives, decisions, tasks, events)

Every connection between layers carries an assertion — an explicit explanation of why that relationship exists. This means an AI agent can trace from any operational decision back to the foundational beliefs that justify it.

Key concepts

  • Deterministic retrieval: SQL queries, not vector search. No probabilistic hallucination.
  • Reifiable relations: Every edge can carry a versioned "why?" explanation.
  • Human validation: Every AI-proposed change goes through diff-based approval (Dolt = Git for data).
  • OPS Contracts: Reasoning envelopes that attach institutional context to work in external systems.
  • EPICAL pipeline: Extract → Ponder → Interrogate → Calibrate → Authenticate → Load.

Quick start

Prerequisites

  • Docker and Docker Compose
  • Python 3.11+

1. Start the database

docker compose up -d

This initializes Dolt with the schema and example seed data (11 objects, 8 relations across all 4 layers).

2. Install the MCP server

cd mcp-server
python -m venv .venv
source .venv/bin/activate
pip install -e .

3. Connect your AI agent

Add to your Claude Desktop / Claude Code MCP config:

{
  "mcpServers": {
    "right-reasons": {
      "command": "/path/to/mcp-server/.venv/bin/right-reasons-mcp",
      "env": {
        "RR_DOLT_HOST": "127.0.0.1",
        "RR_DOLT_PORT": "3307",
        "RR_DOLT_DATABASE": "right_reasons"
      }
    }
  }
}

4. Try it

Ask your agent:

Why did we choose Provider A over Provider B for identity?
Use the get_explanation_packet tool with object ID "ex_ops_02".

The agent will trace the reasoning chain:

  • OPERATIONS: Chose Provider A (affordable, OIDC compatible)
  • RULES: Start with affordable identity provider, plan migration later
  • VISION: Build self-service tools for micropreneurs
  • LORE: Small business owners want to handle accounting themselves

MCP Tools (18)

Query tools (9)

ToolDescription
list_objectsList objects filtered by layer, type, search, validation status
get_objectFull details of a single object
list_relationsList relations with assertion explanations
get_relation_assertionFull assertion history for a relation
traverse_graphNavigate the ontology graph — trace "why?" chains
get_schema_infoAll object types (14) and relation types (20)
get_authentication_trailAudit trail: who proposed, confirmed, validated
get_explanation_packetComplete context for an object in one call
query_sqlRead-only SQL for advanced queries

Mutation tools (4)

ToolDescription
create_sessionStart an EPICAL intake session
propose_objectStage a candidate object (requires authentication before promotion)
propose_relationStage a candidate relation
promote_candidatePromote authenticated candidate to canonical

OPS Contract tools (3)

ToolDescription
generate_ops_contractAuto-generate reasoning envelope from ontology for external work
get_ops_contractRetrieve contract with resolved references
list_ops_contractsList contracts by status or kind

Dolt tools (2)

ToolDescription
dolt_statusWorking set status (like git status)
dolt_diffRow-level diffs between commits (like git diff)
dolt_commitCommit changes with message

EPICAL: How knowledge enters the ontology

Right Reasons does not allow AI agents to write directly into the canonical ontology. All knowledge passes through the EPICAL pipeline:

Source docs ──▶ EXTRACT ──▶ PONDER ──▶ INTERROGATE ──▶ CALIBRATE ──▶ AUTHENTICATE ──▶ LOAD
                  │           │            │               │              │              │
               raw text    identify     challenge       adjust        human           promote to
               intake      candidate    claims &        confidence    validates       canonical
                           objects &    assumptions     scores        via Dolt        ontology
                           relations                                 diff review
StageWhat happensWho
ExtractSource documents parsed into fragmentsAgent
PonderCandidate objects and relations identifiedAgent
InterrogateClaims challenged, gaps surfacedAgent
CalibrateConfidence and durability scores adjustedAgent
AuthenticateHuman reviews Dolt diff, approves or rejectsHuman
LoadAuthenticated candidates promoted to canonical statusAgent

The epistemic boundary is strict: promote_candidate requires status authenticated or calibrated. An agent cannot bypass human validation.

OPS Contracts: Reasoning envelopes for external work

OPS Contracts solve the "last mile" problem: how does institutional reasoning reach the systems where work actually happens (Jira, CI/CD, planning tools)?

An OPS Contract is not a task manager. It is a reasoning envelope — a paperclip that attaches scoped institutional context to a work item in an external system.

External work item          OPS Contract                    Ontology
(Jira, GitHub, etc.)        (reasoning envelope)            (4 layers)
┌──────────────┐     ┌─────────────────────┐     ┌──────────────────┐
│ TASK-123:    │────▶│ Clauses (from RULES)│◀────│ RULES: policies, │
│ Prepare      │     │ Constraints         │     │ decision rules   │
│ annual       │     │ Success criteria    │     ├──────────────────┤
│ report       │     │ References (31)     │     │ VISION: goals,   │
│              │     │ Reasoning chain (13)│     │ boundaries       │
└──────────────┘     └─────────────────────┘     ├──────────────────┤
                                                  │ LORE: beliefs,   │
                                                  │ worldview        │
                                                  └──────────────────┘

The agent generates it in one call:

generate_ops_contract(
    external_work_ref="jira://TASK-123",
    description="Prepare annual report for submission",
    contract_kind="annual_reporting"
)

The contract tells the executing agent why this task matters, what rules apply, and which boundaries must not be crossed — without the agent needing to query the full ontology itself.

Schema

The full schema is in schema/LOAD1st_bootstrap.sql.

Core tables:

  • rr_object — canonical business objects with layer, confidence, validation status
  • rr_relation — typed edges between objects
  • rr_relation_assertion — versioned "why?" explanations (reifiable relations)
  • rr_object_type — 14 types across 4 layers
  • rr_relation_type — 20 relation types in 5 families
  • ops_contract — reasoning envelopes for external work items
  • src_session, src_candidate_object, src_candidate_relation — EPICAL intake pipeline
  • src_authentication_event, rr_validation_record — audit trail

Object types (14)

LayerTypeDescription
LORElore_itemFoundational belief or worldview element
VISIONstrategic_goalDesired longer-horizon outcome
VISIONstrategic_thesisDirectional belief about how success is created
VISIONstrategic_priorityRelative weighting among strategic directions
VISIONstrategic_boundaryStrategic no-go area or explicit limit
RULESpolicyOperational policy derived from higher-layer strategy
RULESdecision_ruleDiscrete action-shaping logic
RULESescalation_ruleTrigger for upward traversal or human review
RULEStactical_conceptReusable applied operational pattern
OPERATIONSinitiativeBounded effort or program
OPERATIONSsituationLive context requiring interpretation
OPERATIONSdecisionChosen or recommended course of action
OPERATIONStaskConcrete action unit
OPERATIONSeventObserved outcome or signal

Relation types (20)

Organized in 5 families. Reifiable relations (✓) can carry versioned assertion explanations.

Transition — cross-layer links that form the reasoning spine:

CodeDescriptionReifiable
interpreted_intoLORE → VISION interpretive transition
operationalized_intoVISION → RULES operationalization
applied_toRULES → OPERATIONS application

Structural — within-layer relationships:

CodeDescriptionReifiable
supportsPositive contribution
constrainsLimiting relation
conflicts_withTension or conflict
depends_onDependency
affectsMaterial effect
relevant_toContextual relevance

Reasoning — justification and prioritization:

CodeDescriptionReifiable
justified_byExplicit reasoning support
validated_againstValidation against another object
prioritized_overRelative ranking
escalates_toEscalation target

Governance — ownership and authority:

CodeDescriptionReifiable
owned_byOwnership
reviewed_byReview relation
authorized_byAuthorization
overridden_byOverride (with explanation)

Feedback — observations and outcomes:

CodeDescriptionReifiable
observed_inObservation in context
resulted_inCausal result
evaluated_byEvaluation

Architecture

┌─────────────┐     ┌──────────────┐     ┌──────────┐
│  AI Agent   │────▶│  MCP Server  │────▶│   Dolt   │
│ (Claude,    │     │  (Python /   │     │  (Git    │
│  GPT, etc.) │◀────│   FastMCP)   │◀────│  for     │
│             │     │  18 tools    │     │  data)   │
└─────────────┘     └──────────────┘     └──────────┘
                           │
                    stdio / SSE / HTTP
  • Dolt provides Git semantics for data: branch, commit, diff, merge, PR-style validation
  • MCP is the de facto standard for agent-tool communication (97M+ SDK downloads)
  • Python / FastMCP keeps the server simple (~700 lines across 7 files)

Example: OPS Contract generation

generate_ops_contract(
    external_work_ref="jira://TASK-123",
    description="Prepare annual report for submission",
    contract_kind="annual_reporting"
)

Returns a reasoning envelope with:

  • Clauses derived from RULES-layer objects
  • Constraints from policies
  • Success criteria from decision rules and tactical concepts
  • References to all relevant objects across all 4 layers
  • Reasoning chain showing the full LORE → VISION → RULES → OPS trace

License

Business Source License 1.1 — see LICENSE.

Contributing

Right Reasons is in early development. If you're interested in contributing or using it for your business, open an issue or reach out.

Verwandte Server

NotebookLM Web Importer

Importieren Sie Webseiten und YouTube-Videos mit einem Klick in NotebookLM. Vertraut von über 200.000 Nutzern.

Chrome-Erweiterung installieren