# Semantica

> A graph-native context layer that turns enterprise data into an ontology-governed knowledge graph with provenance and deterministic reasoning

- Category: Retrieval & Knowledge (RAG) / RAG Frameworks & Platforms
- Language: Python
- Licence: MIT
- Repository: https://github.com/semantica-agi/semantica
- Website: https://getsemantica.ai/
- Canonical page: https://ai-tldr.dev/tools/semantica/
- Updated: 2026-08-20

## In short

Semantica sits underneath an LLM stack as a semantic layer. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python and licensed MIT. To get started: install.

## Overview

Semantica sits underneath an LLM stack as a semantic layer. Its argument is that most agents recall by embedding similarity — a score with no structure, no relationships and no way to explain why a result came back — and that for regulated work you want the meaning of the data to be explicit, not implied by a vector. It ingests enterprise sources, extracts entities, relations and events, resolves conflicts and duplicates, and builds a Context Graph plus a knowledge graph governed by ontologies and controlled vocabularies (OWL, SHACL, SKOS). Graph construction, reasoning and provenance are deterministic: no LLM call is required for any of them.

The pipeline is a sequence of independently importable modules — ingest, parse, normalize, split, extract, conflict detection, deduplication, graph construction, then ontology, reasoning, provenance and decisions on top — feeding a vector store and a polyglot graph store. Storage is swappable without touching your code: RDF via embedded Oxigraph, Blazegraph, Apache Jena or Eclipse RDF4J over SPARQL, and labeled property graphs via Neo4j, FalkorDB, Apache AGE or AWS Neptune over Cypher. Reasoning spans forward chaining, Rete, Datalog and SPARQL, with graph analytics — centrality, community detection, link prediction, shortest paths — over the graph you just built.

Decisions are first-class objects rather than a side effect. An agent decision is recorded as a queryable node with its scenario, reasoning, outcome and confidence; from there you can trace its full causal ancestry, find precedents, map downstream impact, and gate it against policy rules. Provenance follows W3C PROV-O and is source-linked, bi-temporal facts allow point-in-time snapshots, and conflicting facts are flagged rather than silently overwritten. The project is explicit about the limit of that claim: it explains the context and data fed into a model and the decisions around it, not the model's own internal reasoning. It ships drop-in integrations for Agno, CrewAI and LangChain, an MCP server, a CLI, a REST API and an interactive browser workbench, under MIT.

## What it does

- Deterministic knowledge-graph construction, reasoning and provenance — no LLM required for any of them
- Ontology governance with OWL, SHACL and SKOS, plus entity resolution via blocking and semantic deduplication
- Decisions as queryable objects: causal chains, precedent search, downstream impact, and policy gating
- W3C PROV-O source-linked provenance, bi-temporal facts and point-in-time graph snapshots
- Polyglot storage — RDF (Oxigraph, Blazegraph, Jena, RDF4J over SPARQL) and LPG (Neo4j, FalkorDB, Apache AGE, Neptune over Cypher) — swappable without code changes
- Reasoning engines (forward chaining, Rete, Datalog, SPARQL) and graph analytics: centrality, communities, link prediction, shortest paths
- Drop-in Agno, CrewAI and LangChain integrations plus an MCP server, CLI, REST API and an interactive graph workbench

## Getting started

Semantica is a Python package on PyPI. The quick start below records a decision and then queries it back — no graph server needed, because the embedded RDF store is the default.

1. Install

```bash
pip install semantica
```

2. Verify the install

   The doctor command checks the environment and reports what is reachable.

```bash
semantica doctor
```

3. Record a decision and query it back

   Every agent decision becomes an auditable node, so "why did this happen?" has a structured answer.

```python
from semantica.context import ContextGraph

graph = ContextGraph(advanced_analytics=True)

decision_id = graph.record_decision(
    category="vendor_selection",
    scenario="Choose cloud provider for HIPAA workload",
    reasoning="AWS offers BAA, mature HIPAA tooling, and existing team expertise",
    outcome="selected_aws",
    confidence=0.93,
)

chain     = graph.trace_decision_chain(decision_id)
similar   = graph.find_similar_decisions("cloud vendor", max_results=5)
impact    = graph.analyze_decision_impact(decision_id)
compliant = graph.check_decision_rules({"category": "vendor_selection"})
```

4. Keep output clean in CI

   Progress bars are written only when stdout is an interactive terminal; these variables force the behaviour either way.

```bash
SEMANTICA_DISABLE_PROGRESS=1 python build_graph.py
```

## When to use it

- Give agents a shared, structured context layer instead of one embedding index per agent
- Answer a regulator's "why" with a traced decision chain and source-linked PROV-O provenance
- Merge fragmented enterprise data where conflicting facts must be flagged, not silently overwritten
- Add graph traversal, ontology governance and deterministic reasoning on top of an existing LLM and vector store

## Version history

- 2026-08-20 v0.6.6: Security release: fixes a privately disclosed batch of vulnerabilities across backup, export, outbound requests and triplet-store backends, and hardens ingestion against SSRF. The same release adds CrewAI integration and graph retraction.
