Veritasgraph

io.github.bibinprathap由 GitHub 账号 bibinprathap 发布v0.2.0更新于 Nov 11, 2026

Zero-trust, air-gapped Enterprise GraphRAG MCP server with offline, citation-grounded answers.

概览

AI 生成的概览

本地部署的 GraphRAG MCP 服务器,让助手查询受治理的知识图谱,获得带引用的答案,或在证据不足时明确表示无法回答。

可以做什么
  • 以探索或受治理模式对本地知识图谱提问,返回引用、接地标记与弃答结果
  • 在消耗模型调用前检查问题是否可回答,并回放历史答案及其回执与反馈
  • 读取并提议本体条目、术语表词条与实体类型,并检索术语
  • 摄取文档、导入导出图谱、合并实体,并管理快照与审计日志
  • 通过受治理的语义层查询已连接的 SQL 数据源,以生成的 SQL 作答
适用场景
适合需要助手基于自有文档与内部数据库作答、且答案必须可核验引用的场景,并要求在无证据时明确弃答而非猜测。适用于必须留在本地环境的合规、科研与企业检索工作。
运行要求
以 Python 包形式本地运行(Python 3.10+),需要本地 Ollama 端点(由 OLLAMA_HOST 指定)并已拉取 VERITASGRAPH_MODEL 指定的模型。SQLite 存储路径由 VERITASGRAPH_DB 或 STUDIO_DATA_DIR 设置,工具层级由 VERITASGRAPH_MCP_MODE 选择。可选的结构化数据层还需单独的数据源连接串与密钥设置。
安装前请注意
MCP 默认模式为 write,助手可摄取、导入并修改图谱;如需限制请将 VERITASGRAPH_MCP_MODE 设为 read。摄取文本可能含个人数据,应谨慎选择 VERITASGRAPH_PII_POLICY。结构化层用 VG_SECRET_KEY 加密保存数据库凭据并可访问外部数据库,应严格限制其网络白名单。Studio 默认开启鉴权,不应在共享主机上关闭。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Veritasgraph,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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.

[VeritasGraph Logo]

[PyPI version] [Python 3.10+] [License: MIT] [CI] [GitHub Stars] [MCPVault: claimed] [M8ven Score]

🎯 Traditional RAG guesses based on similarity. VeritasGraph reasons based on structure — and refuses to answer when the evidence isn't there.

🌐 Live site · 🎮 Try the Studio live · ⭐ Star · 🍴 Fork · 💬 Discuss · 🐛 Report a bug

[Building Auditable Deep-Research Agents — Live at MBZUAI]   [VeritasGraph Master Demo]

▶️ Watch the full talk & live demo on YouTube (27 mins)


✨ What's new

AreaWhat you get
🧭 Ontology & business glossaryEntity types, predicates (with domain/range) and glossary terms move through proposed → certified → deprecated. Certified vocabulary steers extraction.
⚙️ Ontology compilercompile 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 answersmode="governed" answers only when certified terms cover the question, and withholds answers whose citations don't match retrieved sources.
🧾 Answer receiptsEvery answer gets an answer_id. You can replay it later with its question, mode, citations, grounding and feedback.
🚫 Strict citations & abstentionEach response carries grounded, unknown_citations and abstained. If no entity matches, it says so instead of guessing.
💾 Shared SQLite storeStudio, the MCP server and the CLI share one transactional store. Legacy JSON graphs are migrated on first start.
🔐 GovernanceA 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 policyChoose 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 & rolesBearer tokens with viewer / editor / admin roles, an SSRF allowlist for HTTP tools, and a CORS allowlist.
🔌 MCP modesread / write / admin tool tiers, plus new tools: answerability check, ontology, term search, answer receipts and structured data.
🗄️ Structured data layerConnect read-only to Postgres, MySQL, SQLite, DuckDB, ClickHouse, Trino, Hive, Snowflake or Databricks. Govern a semantic layer and ask questions answered by SQL.
🧰 veritasgraph CLIserve, mcp, migrate, compile, export, import --dry-run, structured ….
🐳 Dockerdocker compose up for Studio + Ollama, an on-prem stack with pgvector, and a hardened MCP container.

📑 Table of contents

  1. Quick start
  2. Architecture
  3. Core concepts — attribution · ontology · compiler · governed mode · governance · PII · structured data
  4. VeritasGraph Studio
  5. Security model
  6. MCP server
  7. CLI
  8. Configuration
  9. API overview
  10. Deployment
  11. Development & tests
  12. Examples & ecosystem
  13. Vision RAG Python package (PyPI)
  14. Why VeritasGraph?
  15. Acknowledgments, awards & citation

🚀 Quick start

Option A — Local (Python + Ollama)

bash
git clone https://github.com/bibinprathap/VeritasGraph.git && cd VeritasGraphpip install -e ".[studio]"                  # Studio + the `veritasgraph` CLIollama serve & ollama pull qwen3:latest     # any local chat model
export 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.

Option B — Docker Compose

bash
STUDIO_API_TOKENS="$(openssl rand -hex 24):admin" docker compose updocker compose exec ollama ollama pull qwen3:latest

Studio is published on 127.0.0.1:8200 only.

Option C — MCP server for your IDE agent

bash
pip install -e .VERITASGRAPH_MCP_MODE=read python -m veritasgraph_mcp     # or: veritasgraph mcp

See MCP server for IDE registration.

One-command end-to-end demo

This builds a graph and drives a fully wired agent through graph reasoning, memory recall, PII redaction and a guardrail block:

bash
python3 demos/agent-studio/sample_pipeline.py --model qwen3:latest

🏗️ Architecture

mermaid
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.
mermaid
stateDiagram-v2    [*] --> proposed: propose (editor, MCP write, compile suggestion)    proposed --> certified: certify (admin)    certified --> deprecated: deprecate (admin)    proposed --> deprecated: deprecate (admin)

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:

StageWhat it does
normalize_typesMaps raw entity types to certified types and synonyms.
normalize_predicatesMaps raw relation labels to certified predicates.
merge_candidatesFinds likely duplicate entities. It only suggests merges and never merges on its own.
suggest_termsProposes glossary terms for well-connected entities (VERITASGRAPH_TERM_MIN_DEGREE).
check_predicate_rulesFlags relations that break a predicate's domain/range.
detect_orphansFlags 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 coverageNoYes; abstains with a reason if not covered
Answers with unmatched citationsReturned, flagged grounded: falseWithheld
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:

PolicyBehaviour
offNo detection.
tag (default)Store the text and tag the chunks that contain PII.
redact_before_extractRedact before the LLM ever sees the text.
rejectRefuse 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.

  1. 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.
  2. Sync the schema, then compile a semantic layer of datasets, fields, relationships, glossary terms and measures. These follow the same proposed → certified workflow.
  3. 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.
  • Dangerous driver options are refused.

See .env.structured.example for every setting, and the structured CLI / /structured API.


🖥️ VeritasGraph Studio

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.

[VeritasGraph Studio]

SectionWhat you can do
Knowledge GraphIngest text or import graph.json, explore entities and relations visually, and ask exploratory or governed questions with citations. Browse the audit log and snapshots.
OntologyPropose and certify types, predicates and glossary terms, run compile, and accept or reject suggestions.
AgentsCreate agents with a local model, instructions, capability toggles (Knowledge Graph, Tools, Memory, Guardrails, Data log) and a headroom token budget.
Tools / Knowledge / Guardrails / Memory / DataManage inventories: real HTTP tools (method, auth header, custom headers), MCP bridge connectors, PII and policy guardrails.
PlaygroundChat with an agent live and inspect the per-turn pipeline trace, reasoning path and citations.
Evaluation / Fine-tuneRun 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.

[Knowledge Graph builder and explorer] [Agent builder with capability toggles]

For full API details and curl recipes, see studio_api/README.md. For a guided enterprise scenario, see the Northwind Bank compliance playbook.


🔐 Security model

Auth is on by default. Studio refuses to start unless STUDIO_API_TOKENS is set or STUDIO_AUTH=off is set explicitly.

bash
export STUDIO_API_TOKENS="tokenA:admin,tokenB:editor,tokenC:viewer"   # each token ≥ 24 chars
RoleCan
viewerRead everything, ask questions (graph query, answerability, playground chat, structured search and ask), and leave answer feedback.
editorEverything a viewer can, plus ingest and import, edit Studio inventories, propose ontology entries, run compile, and accept or reject suggestions.
adminEverything, including clearing the graph, restoring snapshots, certifying or deprecating vocabulary, and reindexing structured data.

More controls:

  • Public routes: only /health, /ready and /studio; the UI shell holds no data.
  • SSRF protection: HTTP tools can't reach private, loopback or link-local addresses unless the address is listed in STUDIO_TOOL_ALLOWED_NETWORKS.
  • CORS: set allowed origins with STUDIO_CORS_ORIGINS.
  • MCP tiers: VERITASGRAPH_MCP_MODE limits which tools an MCP client can see. In the Studio MCP bridge, tools are also limited by the caller's role.
  • PII: see PII policy.

🔌 MCP server

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.

bash
VERITASGRAPH_MCP_MODE=read python -m veritasgraph_mcp
ModeTools exposed (all prefixed veritasgraph_)
readcheck_answerable, query, search_entities, get_entity, get_graph, get_ontology, search_terms, get_term, get_answer_receipt, compile_status, structured_search, structured_get_term, structured_list_measures, structured_ask
write (default)read tools + ingest_document, import_graph, propose_term
adminwrite tools + clear_graph (always snapshots first)

Resources: veritasgraph://graph, veritasgraph://stats, veritasgraph://ontology. Tools that aren't in the active mode are reported as unknown tools.

See veritasgraph_mcp/README.md for Claude Desktop, Cursor and VS Code registration snippets.

🏥 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.
  • ✅ Compliance-ready: region-pinned, PHI-aware guardrails, semantic-layer RBAC.
Foundry Agent / MCP client   → Identity (Entra ID + function key)      → Azure Functions (Flex Consumption, 4 mcpToolTrigger tools)         → veritasgraph-mcp + graphrag_engine            → Azure OpenAI (extraction + reasoning)            → Knowledge Graph         → Durable Azure Files mount (externalized state)         → Storage + App Insights (observability)

Key production lessons:

  1. State externalization. Flex Consumption wiped in-memory graphs; this was fixed with a mounted Azure Files share.
  2. Identity at the boundary. Carry the Entra identity, and enforce Power BI RLS and Dataverse roles on behalf of the user.
  3. Self-correcting agents. Feed errors and the schema back, and retry up to 3× (e.g. for DAX generation).
  4. Compliance by design. Foundry guardrails block PHI-leaking requests before they reach the model.
  5. 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"]}

[Watch: VeritasGraph MCP on Azure AI Foundry]

💡 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 Studioveritasgraph mcp                                      # run the MCP server (stdio)veritasgraph migrate graph.json veritasgraph.db       # legacy JSON → SQLiteveritasgraph compile --actor ci                       # run the ontology compilerveritasgraph export -o graph.json                     # export the graphveritasgraph 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 storeveritasgraph structured statusveritasgraph structured sync <connection>             # introspect a source schemaveritasgraph structured compile <connection>          # build semantic-layer proposalsveritasgraph structured reindexveritasgraph 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.


⚙️ Configuration

VariableDefaultPurpose
STUDIO_API_TOKENS—token:role,... (each token ≥ 24 chars). Required unless STUDIO_AUTH=off.
STUDIO_AUTHonSet off for local development only.
STUDIO_CORS_ORIGINS—Allowed browser origins.
STUDIO_TOOL_ALLOWED_NETWORKS—CIDRs that HTTP tools may reach despite the SSRF block.
STUDIO_DATA_DIRstudio_api/dataData directory.
VERITASGRAPH_DB$STUDIO_DATA_DIR/veritasgraph.dbSQLite store shared by Studio, MCP and the CLI. A legacy graphrag.json is migrated on first start.
OLLAMA_HOSThttp://localhost:11434Local model server.
VERITASGRAPH_MCP_MODEwriteMCP tool tier: read, write or admin.
VERITASGRAPH_PII_POLICYtagoff, tag, redact_before_extract or reject.
VERITASGRAPH_PII_REVEAL_ROLEeditorLowest role that sees unredacted PII.
VERITASGRAPH_COMPILE_INTERVAL0Seconds between background compile runs (0 = off).
VERITASGRAPH_TERM_MIN_DEGREE3Minimum connections before a term is suggested.
VERITASGRAPH_SNAPSHOT_KEEP20Snapshots retained.
STUDIO_GRAPH_CHUNK_SIZE—Ingest chunk size.
VG_STRUCTURED_DSN, VG_SECRET_KEY, VG_LLM_*, VG_EMBED_*, VG_STRUCTURED_*, VG_ASK_*—Structured data layer; see .env.structured.example.

The full reference is in studio_api/README.md.


🌐 API overview

The interactive OpenAPI docs are served at /docs. Main route groups:

PrefixHighlights
/graphragingest, import, export, graph, query (mode: exploratory/governed), answerable, answers/{id} (+ /feedback), entities/{id}, entities/merge, compile, compile/runs, compile/status, suggestions (+ accept/reject), snapshots (+ restore), audit, audit/verify
/ontologyList the ontology; terms, terms/{term}, terms/{term}/links; propose types, predicates, terms; /{kind}/{id}/certify and /deprecate (admin)
/structuredstatus, connections (+ test, sync, compile), datasets, fields, terms, relationships, measures, /{kind}/{id}/{accept,certify,reject,deprecate}, search, ask, answers/{id}, reindex, jobs/{id}
/playgroundAgent chat with full pipeline trace
/agents, /tools, /knowledge, /guardrails, /memory, /dataStudio inventories (CRUD), tools/{id}/test, knowledge/budget
/evaluation, /finetune, /workspace, /modelsEvaluation runs, fine-tune jobs, KPIs, draft/deploy, local models
/mcpMCP bridge: tools, resources, JSON-RPC (/mcp/rpc)
bash
TOKEN="${STUDIO_API_TOKENS%%:*}"curl -s -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \  -d '{"question":"Which drugs inhibit CYP2C9?","mode":"governed"}' \  http://127.0.0.1:8200/graphrag/query

🐳 Deployment

TargetHow
Docker Compose (Studio + Ollama)STUDIO_API_TOKENS="$(openssl rand -hex 24):admin" docker compose up (Studio on 127.0.0.1:8200).
MCP containerdocker compose run --rm -T mcp (the mcp profile); defaults to read mode.
On-prem stackdeploy/docker-compose.onprem.yml: pgvector semantic store, Studio via veritasgraph serve, ollama / vllm profiles and a test-engines profile with sample databases.
Public demo linkscripts/start-studio-with-tunnel.sh: Studio behind a Cloudflare tunnel, reusing the admin token in .studio-api-token. scripts/install-studio-service.sh installs it as a service.
Azure (serverless MCP)See the Azure production use case.
Share with your team (free)
MethodDurationLocal OllamaSetupBest for
Cloudflare tunnel (script above)Unlimited*✅5 minTeam evaluation
Ngrok tunnelUnlimited*✅5 minTeam evaluation
Hugging Face SpacesPermanent❌ (cloud LLM)15 minPublic showcase

*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.

ProviderAPI baseExample model
Ollama (default)http://localhost:11434/v1llama3.1, qwen3
vLLMhttp://localhost:8000/v1any served model
LM Studiohttp://localhost:1234/v1the model loaded in LM Studio
OpenAIhttps://api.openai.com/v1gpt-4-turbo-preview
Groqhttps://api.groq.com/openai/v1llama-3.1-70b-versatile
Together AIhttps://api.together.xyz/v1Meta-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.


🧪 Development & tests

bash
pip install -e ".[studio,dev]"ruff check veritasgraph studio_api veritasgraph_mcpSTUDIO_AUTH=off timeout 600 python -m pytest studio_api/tests tests -m "not ollama" -q \  --ignore=studio_api/tests/test_e2e_playwright.py

CI runs ruff and pytest on Python 3.10 and 3.12. Browser end-to-end tests live in tests/studio-e2e (see VERITASGRAPH_PLAYWRIGHT_INTEGRATION_TESTS.md). Contributions are welcome; see CONTRIBUTING.md and SECURITY.md.


🧩 Examples & ecosystem

ExampleWhat it demonstratesRun
sample_pipeline.pyStudio agent pipeline: brief → KG → multi-hop Q&A with citations → memory → PII redaction → guardrail block → audit.python3 demos/agent-studio/sample_pipeline.py
sample_tools_explorer.pySeeds 17 tools and sample explorer agents (idempotent).python3 demos/agent-studio/sample_tools_explorer.py
MedTrust AgentZero-trust governed agent for medical and pharma workflows (NEECON 2026): step-up authorization, mandatory citations, hash-chained audit, 69 tests.python -m medtrust.demo
clinical-kg/HIPAA-safe clinical KG: Safe Harbor de-identification, ConText NER, contradiction detection, ICD-10/RxNorm/SNOMED/LOINC normalization.cd clinical-kg/backend && python run.py
municipality-incident-chatbot/Civic incident reporting with CV validation (YOLO/VLM), KG-grounded routing and evidence fusion (architecture).cd municipality-incident-chatbot && python cli.py
Floorplan-KG takeoffConstruction drawings → rooms, dimensions and schedules → KG + CSV/XLSX takeoff, with every quantity traced to its sheet.Hosted demo

🏛️ Enterprise compliance — VeritasGraph + VeritasReason

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.

 Policy PDFs ─┐                        ┌─ ingest_structured.py (SQL → triples + text)              ▼                        ▼      VeritasGraph GraphRAG      VeritasReason (TripletStore + RuleSet      (quotes policy text)       + ForwardChainer + PROV-O)              └──────────┬───────────────┘                         ▼             Compliance answer + violators table + clause citations
bash
python tests/test_policy_compliance_demo.py      # 30-second smoke test, stdlib onlypip install veritas-reason && veritasreason-policy-demo

[VeritasGraph + VeritasReason policy-compliance demo]

The rules live in rules/sod_policy.yaml and the SQL → triple mapping in ingest_structured.py. See veritas-reason/plan.md for a walkthrough.

Built with VeritasGraph

[Built with VeritasGraph]

Building with VeritasGraph? Open a PR with a short repo description to be featured here.

📚 Guides & talks

[Build Governed AI Agents On-Prem — walkthrough]   [Import any graph.json into VeritasGraph Studio — walkthrough]

[Watch VeritasGraph build reasoning paths in real time]   [Convert charts & tables to knowledge graphs — Vision RAG tutorial]


📦 Vision RAG Python package (PyPI)

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 ingestionveritasgraph 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 intactdoc = 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
Ingest modeDescriptionBest for
document-centricWhole pages/sections as nodes (default)Most documents
pageEach page = one nodeSlide decks, reports
sectionEach section = one nodeStructured documents
chunkTraditional 500-token chunksLegacy compatibility

[Colab: Vectorless RAG]   [Colab: Vision RAG]   [Colab: Tree Accuracy]

Graph + Tree retrieval

Document Root├── [1] Introduction│   ├── [1.1] Background ←── Tree Navigation│   └── [1.2] Objectives├── [2] Methodology ←───────── Graph Links│   └── relates_to ──────────→ [3.1] Findings└── [3] Results

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.

[Graph Explorer]


Why VeritasGraph?

FeatureVector RAGPageIndexVeritasGraph
Retrieval typeSimilarityTree 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

[Traditional RAG vs VeritasGraph comparison]

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}}

Star History

[Star History Chart]


[stars] [issues] [forks] [license] [图片]

Licensed under MIT. ⭐ Star the repo to follow the roadmap for open-source, governed GraphRAG.

来源:README.md,提交 68552fd

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.2.0最新Nov 11, 2026
  2. v0.1.2Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分