Pramiti Docs

Epistom Overview

Semantic intelligence engine for NLQ-to-SQL — the read plane

Epistom is the read plane of the Pramiti platform. It translates natural language questions into validated SQL queries using a verified knowledge model, ensuring AI agents understand business semantics rather than guessing from column names.

Architecture

Epistom consists of several interconnected components:

  • Knowledge Model — OWL 2 QL ontology stored in Oxigraph, defining Object Types, Link Types, and Business Rules
  • NLQ Engine — Routes questions through trust tiers: knowledge lookup, verified query matching, and constrained SQL generation
  • MCP Server — 8 MCP tools exposing semantic intelligence to AI agents via the Model Context Protocol
  • Verified Queries — Curated SQL patterns that get injected as few-shot examples for higher accuracy
  • Drift Detection — Schema scanning and confidence degradation when the database changes
  • Feedback Engine — Query feedback loop for self-improving accuracy
  • Source Registry — Class-to-source-to-table mapping with industry starter kits

How It Works

When an AI agent asks a question:

  1. The Query Router classifies the intent (definition, vocabulary, analytical, discovery, impact, metric)
  2. For definition queries, the ontology is queried directly via SPARQL — no LLM needed
  3. For analytical queries, the Prompt Assembler builds a context window with relevant schema, definitions, verified query examples, and business rules
  4. The NLQ Engine sends this context to the LLM to generate SQL
  5. The SQL Validator checks the generated SQL against the schema (column existence, join paths, aggregation rules, PII annotations) before execution
  6. If validation fails, the Self-Correction module rewrites and retries
  7. Results are returned with a confidence score, semantic context, and query ID for feedback

Dependencies

DependencyRequiredPurpose
PostgreSQLYesPlatform metadata, query logs, verified queries, feedback
OxigraphYesOWL/SPARQL triplestore for the knowledge model
LLM (Claude/OpenAI/Bedrock/Ollama)YesSQL generation and vocabulary synthesis

Configuration

Key environment variables:

EPISTOM_LLM_PROVIDER=anthropic          # anthropic, openai, bedrock, ollama
EPISTOM_LLM_MODEL_ID=claude-sonnet-4-5  # Model identifier
EPISTOM_OXIGRAPH_ENDPOINT=http://localhost:7878
EPISTOM_MAX_QUERY_ROWS=1000
EPISTOM_QUERY_TIMEOUT_SECONDS=300
EPISTOM_SQL_READONLY=true               # Prevents LLM-generated SQL from writing

On this page