Zero-trust, air-gapped Enterprise GraphRAG MCP server with offline, citation-grounded answers.
io.github.bibinprathap/veritasgraph (MCP) Server
The io.github.bibinprathap/veritasgraph MCP server is a zero-trust, air-gapped Enterprise GraphRAG server that provides offline, citation-grounded answers. It is positioned as a governed, on-prem GraphRAG and agent framework that can run 100% locally or in the cloud. The approach combines a Tree-Search structure with knowledge-graph reasoning.
๐ ๏ธ Key Features
Zero-trust and air-gapped operation
Offline, citation-grounded answering
Enterprise GraphRAG and governed agents
Tree-Search structure plus knowledge-graph reasoning
๐ Use Cases
GraphRAG for information retrieval
Multi-hop reasoning with knowledge graphs
Enterprise knowledge management and knowledge engineering
Graph analytics and knowledge-engineering workflows
โก Developer Benefits
Knowledge graphs, knowledge management, and RAG support
Multi-hop reasoning and context-window-oriented agent design
Python-library use (Python 3.10+ indicated)
โ ๏ธ Limitations
Tooling scope is not specified in the provided data (toolCount not included)
VeritasGraph โ The Governed, On-Prem GraphRAG & Agent Framework
A knowledge graph your agents can trust: every answer cites its sources, the vocabulary is governed by a certified ontology, and the system says "I don't know" instead of guessing. Runs 100% locally.
Entity types, predicates (with domain/range) and glossary terms move through proposed โ certified โ deprecated. Certified vocabulary steers extraction.
โ๏ธ Ontology compiler
compile normalizes types and predicates, finds duplicate entities, suggests new terms, checks domain/range rules and flags orphans. It only changes the graph when a mapping is unambiguous; everything else becomes a reviewable suggestion.
๐ก๏ธ Governed answers
mode="governed" answers only when certified terms cover the question, and withholds answers whose citations don't match retrieved sources.
๐งพ Answer receipts
Every answer gets an answer_id. You can replay it later with its question, mode, citations, grounding and feedback.
๐ซ Strict citations & abstention
Each response carries grounded, unknown_citations and abstained. If no entity matches, it says so instead of guessing.
๐พ Shared SQLite store
Studio, the MCP server and the CLI share one transactional store. Legacy JSON graphs are migrated on first start.
๐ Governance
A SHA-256 hash-chained audit log with a verify endpoint, snapshots and restore (the graph is snapshotted automatically before it is cleared), and entity merge.
๐ต๏ธ PII policy
Choose off, tag, redact_before_extract or reject. Email, SSN, credit card (Luhn-checked), phone and IP are detected and redacted on read for low-privilege roles.
๐ Auth & roles
Bearer tokens with viewer / editor / admin roles, an SSRF allowlist for HTTP tools, and a CORS allowlist.
๐ MCP modes
read / write / admin tool tiers, plus new tools: answerability check, ontology, term search, answer receipts and structured data.
๐๏ธ Structured data layer
Connect read-only to Postgres, MySQL, SQLite, DuckDB, ClickHouse, Trino, Hive, Snowflake or Databricks. Govern a semantic layer and ask questions answered by SQL.
git clone https://github.com/bibinprathap/VeritasGraph.git && cd VeritasGraph
pip install -e ".[studio]"# Studio + the `veritasgraph` CLI
ollama serve & ollama pull qwen3:latest # any local chat modelexport STUDIO_API_TOKENS="$(openssl rand -hex 24):admin"# auth is on by defaultecho"${STUDIO_API_TOKENS%%:*}"# the token to paste into the UI
veritasgraph serve # http://127.0.0.1:8200/studio ยท API docs at /docs
Studio asks for the token the first time you open it and keeps it for the browser session. To run a local demo without auth, set STUDIO_AUTH=off (Studio logs a warning on startup); never do this on a shared or public host.
flowchart LR
subgraph Ingest
D[Documents / graph.json imports] --> PII{PII policy}
PII --> X["LLM extraction<br/>(steered by certified ontology)"]
end
subgraph Store["Shared SQLite store"]
G[(Entities ยท relations ยท chunks)]
O[(Ontology & glossary)]
A[(Audit chain ยท snapshots ยท receipts)]
end
X --> G
G <--> C["Ontology compiler<br/>normalize ยท merge ยท suggest ยท validate"]
C <--> O
subgraph Query
Q[Question] --> ANS{"Answerability<br/>(governed mode)"}
ANS -->|covered| R["Entity match + multi-hop traversal"]
ANS -->|not covered| AB[Abstain]
R --> L[Local LLM]
L --> V{"Citation check<br/>(doc#chunk)"}
V -->|grounded| OUT["Answer + citations + answer_id"]
V -->|unknown citations| AB
end
G --> R
O --> ANS
OUT --> A
subgraph Surfaces
S[Studio UI & REST API]
M[MCP server]
CLI[veritasgraph CLI]
end
Surfaces --> Ingest
Surfaces --> Query
Studio, MCP and the CLI are thin layers over the same engine and store. A graph built in Studio can be queried from your IDE, and a compile run from the CLI shows up in the Studio Ontology tab. A shared job lock ensures only one compiler runs at a time.
๐ง Core concepts
Attribution, citations and abstention
Attribution is a data model, not a prompt. Provenance is stored at write time: every entity and relation keeps the chunk it came from (doc_xxx#n, or imp_xxx#n for imported graphs). This prevents hallucinated citations at read time.
Deterministic retrieval. Graph traversal is reproducible, which separates the factual evidence trace from stochastic LLM generation.
Strict citation check. Citations in the answer are compared with the sources that were actually retrieved. Mismatches are reported in unknown_citations and set grounded: false.
Explicit abstention. If no entity matches the question, or governed mode can't ground the answer, the response sets abstained: true instead of guessing.
Ontology & business glossary
The ontology is the governed vocabulary of the graph:
Entity types, e.g. Drug, Enzyme, Supplier.
Predicates, e.g. inhibits, with optional domain/range constraints.
Glossary terms: business definitions with synonyms, linked to entities.
Once vocabulary is certified, it changes how the system behaves:
Extraction limits entity types to the certified list and maps synonyms to the certified predicate.
Compile uses the same mapping rules to clean up the existing graph.
Governed mode answers only when certified terms cover the question.
Manage it in the Studio Ontology tab, through /ontology in the REST API, or with the MCP tools get_ontology, search_terms, get_term and propose_term.
The ontology compiler
veritasgraph compile, POST /graphrag/compile, or a timer set with VERITASGRAPH_COMPILE_INTERVAL runs these stages:
Stage
What it does
normalize_types
Maps raw entity types to certified types and synonyms.
normalize_predicates
Maps raw relation labels to certified predicates.
merge_candidates
Finds likely duplicate entities. It only suggests merges and never merges on its own.
suggest_terms
Proposes glossary terms for well-connected entities (VERITASGRAPH_TERM_MIN_DEGREE).
check_predicate_rules
Flags relations that break a predicate's domain/range.
detect_orphans
Flags entities with no relations.
Only unambiguous mappings to certified vocabulary change the graph. Everything else is a suggestion that you accept or reject in Studio or via /graphrag/suggestions. Rejected suggestions are fingerprinted and don't come back. Every run is recorded (/graphrag/compile/runs) and audited.
Governed mode, answerability and receipts
exploratory (default)
governed
Needs certified glossary coverage
No
Yes; abstains with a reason if not covered
Answers with unmatched citations
Returned, flagged grounded: false
Withheld
Answer receipt (answer_id)
โ
โ
POST /graphrag/answerable (MCP: check_answerable) tells an agent whether a question can be answered before it spends a model call.
GET /graphrag/answers/{id} returns the receipt: question, mode, answer, citations, grounding and feedback.
POST /graphrag/answers/{id}/feedback records a rating for the answer so it can be reviewed later. Any viewer can rate an answer.
Governance: audit, snapshots, merge
Hash-chained audit log. Every write (ingest, import, compile, certify, merge, clear, restore) appends a SHA-256-chained event. GET /graphrag/audit/verify recomputes the chain and reports the event where it breaks (broken_at).
Snapshots. Create, list and restore snapshots (/graphrag/snapshots). Clearing the graph always takes a snapshot first. Retention is set with VERITASGRAPH_SNAPSHOT_KEEP (default 20).
Entity merge.POST /graphrag/entities/merge folds duplicates together and keeps their relations and provenance.
Import / export. Bring in graph.json from Graphify, Understand-Anything, AI-Atlas or a generic node/edge file. Merge strategies are preserve_curated, skip_existing and overwrite, with a --dry-run preview.
PII policy
VERITASGRAPH_PII_POLICY controls what happens when ingested text contains email addresses, SSNs, credit card numbers (Luhn-validated), phone numbers or IP addresses:
Policy
Behaviour
off
No detection.
tag(default)
Store the text and tag the chunks that contain PII.
redact_before_extract
Redact before the LLM ever sees the text.
reject
Refuse the document.
PII in chunks is redacted on read for callers below VERITASGRAPH_PII_REVEAL_ROLE (default editor).
Structured data layer
Beyond documents, VeritasGraph can govern databases. Install with pip install -e ".[structured]" and set VG_STRUCTURED_DSN to a Postgres + pgvector store.
Connect a source read-only: PostgreSQL, MySQL/MariaDB, SQLite, DuckDB, ClickHouse, Trino, Hive ([structured-hive]), Snowflake or Databricks ([structured-saas]). Credentials are encrypted with VG_SECRET_KEY.
Sync the schema, then compile a semantic layer of datasets, fields, relationships, glossary terms and measures. These follow the same proposed โ certified workflow.
Ask in natural language. The answer is generated SQL over certified objects, run under a statement timeout and a row cap, and returned with a receipt.
Source DSNs are guarded:
A network allowlist (VG_STRUCTURED_ALLOWED_NETWORKS) controls which hosts can be reached.
A file root (VG_STRUCTURED_FILE_ROOT) limits SQLite and DuckDB to approved paths.
Studio is a local Agent Build Workspace (FastAPI + a single-page UI at /studio). You build a knowledge graph from your own documents, govern its vocabulary, and wire it into agents alongside tools, memory, data logging, guardrails and headroom-style context budgeting. You then chat with those agents and watch every stage of the orchestration pipeline.
๐ฎ Try the Studio live โ a stable URL that always redirects to the currently running Studio tunnel.
Section
What you can do
Knowledge Graph
Ingest text or import graph.json, explore entities and relations visually, and ask exploratory or governed questions with citations. Browse the audit log and snapshots.
Ontology
Propose and certify types, predicates and glossary terms, run compile, and accept or reject suggestions.
Agents
Create agents with a local model, instructions, capability toggles (Knowledge Graph, Tools, Memory, Guardrails, Data log) and a headroom token budget.
Tools / Knowledge / Guardrails / Memory / Data
Manage inventories: real HTTP tools (method, auth header, custom headers), MCP bridge connectors, PII and policy guardrails.
Playground
Chat with an agent live and inspect the per-turn pipeline trace, reasoning path and citations.
Evaluation / Fine-tune
Run evaluation suites with pass-rate trends, and queue and monitor fine-tune jobs.
Orchestration pipeline (per turn): Guardrails โ Memory โ Knowledge Graph โ Headroom budget โ Tools โ Data log, with every step visible in the trace.
VeritasGraph ships a Model Context Protocol server: a zero-trust, air-gapped enterprise GraphRAG server for MCP. Claude Desktop, Cursor, VS Code, Windsurf, Cline and Continue connect over JSON-RPC 2.0 stdio with zero external data egress.
๐ฅ Use case โ VeritasGraph MCP in production medical AI on Azure
Real-world deployment: the VeritasGraph MCP server runs on Azure Functions with Azure AI Foundry. It delivers GraphRAG-powered clinical decision support with verifiable citations and a compliance-ready architecture.
The challenge: 90% of Azure AI demos work. Most never ship. The gap isn't the model; it's architecture, security, state management and compliance.
The solution: VeritasGraph is deployed as a remote MCP server that Azure AI Foundry agents call to answer clinical questions with:
โ Multi-hop GraphRAG reasoning: answers are assembled from separate graph edges.
โ Verifiable citations: every claim traces to [doc#chunk] sources.
โ Production-grade architecture: externalized state, identity at the boundary, observability.
State externalization. Flex Consumption wiped in-memory graphs; this was fixed with a mounted Azure Files share.
Identity at the boundary. Carry the Entra identity, and enforce Power BI RLS and Dataverse roles on behalf of the user.
Self-correcting agents. Feed errors and the schema back, and retry up to 3ร (e.g. for DAX generation).
Compliance by design. Foundry guardrails block PHI-leaking requests before they reach the model.
Observability layers. Application Insights, Foundry Traces, Evaluations and Alerts.
json
{"question":"Should we adjust warfarin for patient 4471 on amiodarone?","answer":"Reduce the warfarin dose because amiodarone inhibits CYP2C9...","citations":["doc_warfarin_note#0","doc_warfarin_note#1"],"reasoning_path":["Amiodarone โ CYP2C9","CYP2C9 โ Warfarin","Warfarin โ Bleeding Risk"]}
๐ก Key insight: the gap between proof of concept and production is architecture, not the model. Ground it, externalize state, secure it, observe it, make it resilient and keep it compliant.
๐งฐ CLI
pip install -e ".[studio]" installs the veritasgraph command:
bash
veritasgraph serve --host 127.0.0.1 --port 8200 # run Studio
veritasgraph mcp # run the MCP server (stdio)
veritasgraph migrate graph.json veritasgraph.db # legacy JSON โ SQLite
veritasgraph compile --actor ci # run the ontology compiler
veritasgraph export -o graph.json # export the graph
veritasgraph import graph.json --format auto --merge-strategy preserve_curated --dry-run
# Structured data layer (needs the [structured] extra + VG_STRUCTURED_DSN)
veritasgraph structured migrate # create/upgrade the semantic store
veritasgraph structured status
veritasgraph structured sync <connection> # introspect a source schema
veritasgraph structured compile <connection> # build semantic-layer proposals
veritasgraph structured reindex
veritasgraph structured ask "total revenue by region last quarter" --mode governed
The import command accepts --format values auto, graphify, understand_anything, ai_atlas and generic, and --source-type values curated, extracted and inferred.
STUDIO_API_TOKENS="$(openssl rand -hex 24):admin" docker compose up (Studio on 127.0.0.1:8200).
MCP container
docker compose run --rm -T mcp (the mcp profile); defaults to read mode.
On-prem stack
deploy/docker-compose.onprem.yml: pgvector semantic store, Studio via veritasgraph serve, ollama / vllm profiles and a test-engines profile with sample databases.
*The free tier has some limitations. Always keep auth on for anything reachable from the internet, and rotate tokens that have been shared.
On-premise hardware guidance
Hardware: 16+ CPU cores, 64 GB+ RAM (128 GB recommended), and an NVIDIA GPU with 24 GB+ VRAM (A100 / H100 / RTX 4090) for larger local models.
Software: Docker and Docker Compose, Python 3.10+, NVIDIA Container Toolkit.
Copy .env.example to .env and fill in environment-specific values.
Provider support (OpenAI-compatible)
Studio talks to Ollama (OLLAMA_HOST). The structured layer and the GraphRAG pipeline in graphrag-ollama-config/ work with any OpenAI-compatible API. The structured layer stays local unless you set VG_LLM_ALLOW_REMOTE to allow a remote endpoint.
Provider
API base
Example model
Ollama (default)
http://localhost:11434/v1
llama3.1, qwen3
vLLM
http://localhost:8000/v1
any served model
LM Studio
http://localhost:1234/v1
the model loaded in LM Studio
OpenAI
https://api.openai.com/v1
gpt-4-turbo-preview
Groq
https://api.groq.com/openai/v1
llama-3.1-70b-versatile
Together AI
https://api.together.xyz/v1
Meta-Llama-3.1-70B-Instruct-Turbo
Azure OpenAI, OpenRouter, Anyscale and LocalAI are also supported.
โ ๏ธ Embeddings must match your index. If you indexed with nomic-embed-text (768 dims), you must query with the same model. Switching embedding models requires re-indexing.
GraphRAG is great at describing what documents say. Questions like "Which purchase orders violated our Segregation-of-Duties policy last quarter?" are rule-evaluation problems over structured records. VeritasReason is a deterministic reasoning engine (forward-chaining + Rete + SPARQL) that fires policy rules over a triple store and returns auditable answers with W3C PROV-O provenance.
Note: the veritasgraph package on PyPI is the Vision RAG / tree + graph library. It is separate from the Studio / MCP / governance stack in this repository. Both install a veritasgraph command, so use separate virtual environments if you need both.
bash
pip install veritasgraph # basic (includes lite mode)
pip install veritasgraph[all] # + web UI, Microsoft GraphRAG, YouTube/web ingestion
veritasgraph demo --mode=lite # cloud APIs, no GPU (--mode=local for Ollama)
python
from veritasgraph import VisionRAGPipeline, VisionRAGConfig
pipeline = VisionRAGPipeline(VisionRAGConfig(ingest_mode="document-centric")) # tables stay intact
doc = pipeline.ingest_pdf("report.pdf")
print(pipeline.get_document_tree()) # hierarchical "table of contents"print(pipeline.navigate_to_section("Methodology")["breadcrumb"])
print(pipeline.query("What methodology was used?").answer) # graph search with section context
The package also includes an interactive PyVis graph explorer. It shows a query-aware subgraph, colors nodes by community, highlights query entities in red, and sizes nodes by number of connections.
Why VeritasGraph?
Feature
Vector RAG
PageIndex
VeritasGraph
Retrieval type
Similarity
Tree search
๐ Tree + graph reasoning
Attribution
โ Low
โ ๏ธ Medium
โ Verified citations + receipts
Abstains when evidence is missing
โ
โ
โ
Governed vocabulary (ontology)
โ
โ
โ
Tamper-evident audit
โ
โ
โ
Multi-hop reasoning
โ
โ
โ
Structured data (SQL) under the same governance
โ
โ
โ
MCP server for IDE agents
โ ๏ธ Varies
โ
โ
100% local/private
โ ๏ธ Varies
โ Cloud
โ On-premise
Open source
โ ๏ธ Varies
โ Proprietary
โ MIT license
Who is it for? Engineers building enterprise search, compliance assistants, research copilots, scientific literature explorers and agent memory systems: anywhere "the answer" depends on how facts connect, and where a wrong answer costs more than no answer.
๐ Acknowledgments
Builds on the foundational work of HopRAG, Microsoft GraphRAG, LangChain & LlamaIndex, and Neo4j.
๐ Awards & Citation
Presented at the International Conference on Applied Science and Future Technology (ICASF 2025) โ ๐ Appreciation Certificate.
bibtex
@article{VeritasGraph2025,
title={VeritasGraph: A Sovereign GraphRAG Framework for Enterprise-Grade AI with Verifiable Attribution},
author={Bibin Prathap},
journal={International Conference on Applied Science and Future Technology (ICASF)},
year={2025}
}