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.
Install
pip install semanticaVerify the install
The doctor command checks the environment and reports what is reachable.
semantica doctorRecord a decision and query it back
Every agent decision becomes an auditable node, so "why did this happen?" has a structured answer.
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"})Keep output clean in CI
Progress bars are written only when stdout is an interactive terminal; these variables force the behaviour either way.
SEMANTICA_DISABLE_PROGRESS=1 python build_graph.pyCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
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
How Semantica compares
Semantica alongside other open-source rag frameworks & platforms tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Dify | ★ 159k | An open-source platform with a visual workflow builder for creating LLM and RAG applications without writing much code. |
| graphify | ★ 131k | Turns a folder of code, docs, PDFs and images into a local knowledge graph with tree-sitter AST parsing and Leiden communities — queryable by agents over MCP, no vector store. |
| RAGFlow | ★ 92.6k | A RAG engine built around deep document understanding that turns complex files into a grounded, citation-backed question-answering layer. |
| Context7 | ★ 63.4k | Context7 pulls current, version-specific documentation and code examples for any library and feeds them into your LLM, available as a CLI skill or an MCP server. |
| Pathway | ★ 62.1k | A Python framework with a Rust streaming engine that keeps ETL, real-time analytics and RAG pipelines continuously up to date as source data changes. |
| LightRAG | ★ 40.3k | A graph-based RAG system that builds an entity-and-relationship knowledge graph for fast retrieval and easy incremental updates. |
| Quivr | ★ 39.6k | Quivr is an open-source RAG framework that ingests your documents and answers questions about them, working with any LLM and any file type. |
| Semantica | ★ 14.2k | A graph-native context layer that turns enterprise data into an ontology-governed knowledge graph with provenance and deterministic reasoning |