Skip to content

Latest commit

 

History

1,665 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Pulls PyPI version License E2E Tests Discord

Playground | Self-Host | Docs | YouTube | Discord | Website

The open source ontology hypergraph runtime for AI agents

trustgraph-ai%2Ftrustgraph | Trendshift

Your ontology. Your hypergraph. Your agents. Your rules.

Take AI to the 4th dimension.


Every platform now sells you an ontology. TrustGraph is the one you own.

For enterprises deploying AI agents where decisions carry real risk, TrustGraph is the open-source hypergraph platform that unifies your knowledge, ontologies, business logic, complex process flows, prompts, configurations, policies, and audit trails in a single store—and governs what every agent and user can access or retrieve from it.

Flat property graphs and vector databases cannot solve enterprise AI. They collapse context, scatter prompts, business logic, and configurations across disconnected systems, and bolt on versioning and access control as afterthoughts. Only a hypergraph can solve these problems natively.

Built on W3C standards (RDF, RDF-star, OWL, SHACL, PROV-O), TrustGraph gives you total ownership and portability across any cloud, model, or deployment.

Why Only a Hypergraph Can Solve Enterprise AI

Enterprise AI is not a flat collection of facts. Every answer an agent produces depends on intersecting dimensions: which document or remote source a claim came from, which ontology version guided extraction, which business logic, process flow, prompt, and model configuration ran, and which policy governed the query.

A standard graph only connects nodes with binary edges. A hypergraph lets you group statements into higher-order structures and make statements about those statements. In TrustGraph, W3C named graphs and RDF-star turn your knowledge store into a multi-dimensional hypergraph:

  • Everything in one store: Domain knowledge, OWL ontologies, business logic, complex process flows, agent prompts, pipeline configurations, SHACL policies, policy-governed remote data retrieval definitions, and PROV-O audit trails all live in the same hypergraph—queried and governed with the same engine.
  • Native versioning via named graphs: Named graphs act as isolated, composable dimensions. Version your ontologies, business logic, process flows, prompts, configurations, and knowledge snapshots without duplicating infrastructure or breaking running agents.
  • Relationships spanning named graph dimensions: Edges and quoted triples cross named graph boundaries directly. You can trace a single answer from a retrieval graph (urn:graph:retrieval), across the extracted knowledge graph and remote data retrievals, to the exact process flow, business logic, prompt version, ontology class, policy evaluation (urn:graph:policy), and source document chunk (urn:graph:source) that produced it.

How It Works

   Ontologies · Logic · Flows · Prompts · Configs    Your Documents & Remote Data
         (versioned named graph dimensions)                       │
                         │                                        │
                         └───────────────────┬────────────────────┘
                                             ▼
                                  ┌──────────────────────┐
                       1. EXTRACT │     OntologyRAG      │  Triples match classes and properties,
                                  │                      │  checked against ontology constraints
                                  └──────────┬───────────┘
                                             ▼
                                  ┌──────────────────────┐
                       2. GROUND  │   Hypergraph Store   │  RDF & RDF-star across named graphs,
                                  │                      │  with cross-dimensional PROV-O lineage
                                  └──────────┬───────────┘
                                             ▼
                                  ┌──────────────────────┐
                       3. GOVERN  │  SHACL-AF Policies   │  Every query & remote retrieval evaluated:
                                  │                      │  Allowed · Filtered · Violation
                                  └──────────┬───────────┘
                                             ▼
                              GraphRAG · SPARQL · Agents · MCP
                    + a queryable hypergraph trace of every decision

Additional Technical Diagrams

What Makes It Different

TrustGraph Platform Ontologies & Flat Graphs
Data model Hypergraph (W3C RDF, RDF-star, Named Graphs, OWL, JSON-LD) Flat vendor object model or binary property graph
System state Knowledge, ontologies, business logic, process flows, prompts, configs, policies, and remote data retrieval in one store Scattered across databases, workflow engines, config files, and prompt registries
Versioning Named graph dimensions with cross-graph relationships Manual snapshots or external version control
Where it runs Docker, Podman, Kubernetes, any cloud, on-prem, or self-hosted models Inside one vendor's data estate
Knowledge source Documents (PDF, DOCX, XLSX, PPTX, HTML, Markdown, CSV), images, structured data, and policy-governed remote data Mostly warehouse tables and metadata
Access control SHACL-AF policies evaluated per node on every query and remote retrieval Coarse platform permissions
Audit trail Cross-dimensional PROV-O lineage in queryable named graphs Static platform logs
Models All major LLM APIs, hosted or self-hosted open-weight models Platform's choice
License Apache 2.0 Commercial

Core Capabilities

1. Unify & version everything: multi-dimensional hypergraph

  • Store knowledge as RDF with language tags, XSD datatypes, and RDF-star quoted triples for statements about statements.
  • Use named graphs to capture and version ontologies, business logic, complex process flows, prompts, configurations, policies, policy-governed remote data retrieval, and data layers in a single store—while maintaining queryable relationships across graph boundaries.
  • Load knowledge as Turtle, TriG, or N-Quads (named graphs preserved); export the graph as Turtle.
  • Package knowledge into Context Cores that carry triples, embeddings, provenance, and source documents between deployments.
  • Move whole workspaces between deployments with portable .tgx bundles (tg-export-workspace / tg-import-workspace).

2. Use it: ontology to knowledge

  • OntologyRAG uses your versioned ontology graphs to guide extraction. A similarity-based selector picks the relevant part of the ontology for each chunk, with a bypass mode for small ontologies.
  • Extracted triples are validated against ontology domain and range constraints, including the subclass hierarchy. Triples that break the rules are rejected.
  • rdf:type attributes are stored with graph embeddings, so you can filter vector searches by entity type.
  • Schema-free GraphRAG and hybrid (BM25 + vector) DocumentRAG are also available, both with cross-encoder reranking.

3. Govern it: policy-based query & remote retrieval filtering

  • Write access policies as SHACL-AF shapes, stored in the urn:graph:policy named graph.
  • Every graph query and policy-governed remote data retrieval is evaluated node by node with a tri-state result: Allowed, Filtered, or Violation.
  • Policies apply across the REST API, SPARQL, GraphRAG, and remote data connectors, using a per-request user context.
  • Each evaluation publishes a structured policy.evaluation audit event.
  • With no policies loaded, the system runs in open mode.

4. Steer it: guided hypergraph traversal

  • Supply grounding seeds or graph seeds to skip LLM concept extraction.
  • Restrict each hop by type, relationship, or named graph dimension, and filter edges by language tag.

5. Prove it: cross-dimensional explainability

  • Extraction emits PROV-O lineage linking documents, pages, chunks, and edges (urn:graph:source) directly to the ontology, business logic, and configuration graphs used.
  • GraphRAG, DocumentRAG, remote retrievals, and agent queries record full reasoning traces (urn:graph:retrieval).
  • Inspect traces with tg-show-explain-trace and tg-show-extraction-provenance, or query across every dimension with SPARQL.

6. Decide fast

  • Decision Scoring (Laya, ONNX Runtime, ~35 ms per call): pick an option, score on an ordered scale, or get a yes/no confidence.
  • Cloze Classification: auto-train a DistilBERT classifier from labeled examples and serve it with confidence scores.

Agents and APIs

  • Agent orchestrator with ReAct, Plan-then-Execute, and Supervisor patterns.
  • MCP server with tools for graph queries, SPARQL, GraphQL over structured data, and embeddings, with bearer-token authentication.
  • SPARQL 1.1 query service with 30+ built-in functions, cross-named-graph queries, and streaming results.
  • REST, WebSocket, Python SDK, TypeScript libraries, and a full tg-* CLI.

Quickstart

No need to clone the repo unless you are building from source. TrustGraph deploys as a set of Docker containers. Configure it on the command line in one step:

npx @trustgraph/config

The config process generates an app config that can be run locally with Docker, Podman, or Minikube. It outputs:

  • deploy.zip with either a docker-compose.yaml file for Docker/Podman or resources.yaml for Kubernetes
  • Deployment instructions as INSTALLATION.md

For a browser-based configuration, try the Configuration Terminal.

Standards Support

Standard Use in TrustGraph
RDF (incl. RDF-star & Named Graphs) Hypergraph data model, cross-dimensional relationships, versioning, business logic, process flows, language tags, and datatypes
OWL / RDFS Versioned ontology classes and properties; domain, range, and subclass checks during extraction
SHACL-AF Policy-based query filtering and remote data retrieval governance
PROV-O Cross-graph extraction lineage and query-time reasoning traces
SPARQL 1.1 Querying knowledge, business logic, configurations, provenance, and policies across named graphs
Turtle / TriG / N-Quads Import and export with named graph preservation
MCP Agent integration

Note on scope: TrustGraph uses OWL ontologies to guide extraction and to check domain, range, and subclass constraints. It is not a full OWL reasoner. See the Ontologies docs for details.

Integrations

  • LLMs: All major LLM APIs, including OpenAI and compatible providers, Claude, Gemini (GCP and AI Studio), Near AI, AWS Bedrock, Azure, Mistral, Cohere, Ollama, vLLM, LM Studio, TGI, and llama.cpp
  • Messaging: Apache Pulsar or RabbitMQ (Kafka experimental)
  • Storage: Cassandra (hypergraph), Qdrant (vectors), S3-compatible object storage
  • Documents: Docling decoder for PDF, DOCX, XLSX, PPTX, HTML, Markdown, and CSV
  • Deployment: Docker / Podman Compose, Minikube, Azure AKS, GCP, AWS, Scaleway, OVHcloud; amd64 and arm64 images; Nvidia, AMD, and Intel GPU support
  • Security: IAM with JWT and API keys, workspace multi-tenancy, fine-grained capabilities

Getting Started with TrustGraph

TypeScript Library for UIs

There are TS libraries for quick UI integration of TrustGraph services:

Package Description
@trustgraph/trustkit Shared component library and design system
@trustgraph/client TypeScript client for TrustGraph APIs
@trustgraph/react-provider React provider for TrustGraph WebSocket connections
@trustgraph/react-state React state management hooks
@trustgraph/portal Portal application showcasing all workflows

Contributing

Developer's Guide

License

TrustGraph is licensed under Apache 2.0.

Copyright 2024-2026 TrustGraph

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Support & Community

  • Bug Reports & Feature Requests: Discord
  • Discussions & Questions: Discord
  • Documentation: Docs