What is Semantica

Most AI agents run on embeddings, not meaning: similarity scores with no structure, no relationships, and no way to explain why a result came back. Semantica is the semantic and context layer underneath your LLM, vector store, and agent framework. It is a deterministic infrastructure layer (no LLM required for graph construction, reasoning, or provenance) that turns fragmented enterprise data into a structured, queryable Context Graph and knowledge graph, governed by ontologies and controlled vocabularies (OWL, SHACL, SKOS) so the meaning of your data is explicit, not just its embedding. Decision provenance and audit trails fall out of that structure as a property, not the product itself; in domains a regulator can question, that same structure just happens to double as a straight answer to “why.”

The project is open source, MIT-licensed, and self-hosted with zero vendor lock-in. The code is on GitHub at semantica-agi/semantica, the package is on PyPI, the documentation is at docs.getsemantica.ai, and the website is at getsemantica.ai.

Who It Is For

  • AI/ML platform teams shipping agents that make consequential decisions and need structured, queryable context, not just a vector index.
  • Data platform teams on Databricks or Snowflake turning tables already in Unity Catalog or a warehouse into a governed, lineage-tracked knowledge graph, without exporting to a third-party SaaS.
  • Compliance, risk, and audit teams who need a straight answer to “why did the AI do that?” in a format a regulator accepts.
  • Regulated enterprises (finance, healthcare, legal, government, defense) that can’t ship a black box or send their data to someone else’s SaaS to get one.
  • Platform and infra engineers who want the KG, reasoning, and provenance stack self-hosted and swappable, not locked to one vendor’s backend.
  • Data and knowledge engineers building a KG from messy, multi-source data, where conflicting facts get flagged and duplicates get merged, not silently overwritten.

Full Data Pipeline

Semantica’s pipeline runs from every source type to every final output in a single flow. Sources include files (PDF, DOCX, PPTX, HTML, CSV, JSON, XML), web (pages, RSS/Atom, REST APIs), databases (PostgreSQL, MySQL, SQLite, Oracle, DuckDB, MongoDB), cloud (Snowflake, Google Drive, Elasticsearch, HuggingFace), and streams (Kafka, RabbitMQ, Kinesis, Pulsar). Ingestors feed raw documents into parsing, normalization, and entity-aware splitting. Extraction performs NER, relation extraction, event detection, triplet extraction, and coreference resolution. Conflict detection flags and resolves conflicting facts; deduplication merges duplicates instead of overwriting them. KG construction builds the knowledge graph with bitemporal facts and provenance.

Semantica full data pipeline

The knowledge graph then feeds the intelligence layer: ontology management (OWL, SHACL, SKOS), deterministic reasoning (Rete, Datalog, SPARQL), W3C PROV-O provenance, and context and decisions (ContextGraph, DecisionRecorder, CausalChainAnalyzer). The enriched KG is stored in swappable vector and graph stores and surfaced through exports (RDF, JSON-LD, OWL, CSV), visualizations, and services (REST API, MCP server, CLI, Knowledge Explorer).

Decision Intelligence Lifecycle

Every decision in Semantica is a first-class object: traceable, searchable by precedent, and causally linked. The lifecycle has five stages.

Semantica decision intelligence lifecycle

  1. Record: record_decision() captures category, scenario, reasoning, outcome, confidence, and metadata.
  2. Link: add_causal_relationship() connects decisions with triggers, enables, causes, and precedes edges.
  3. Query: find_similar_decisions() searches precedents semantically, trace_decision_chain() returns full causal ancestry, and analyze_decision_impact() maps downstream influence.
  4. Govern: check_decision_rules() evaluates policies and runs a compliance gate.
  5. Audit Export: W3C PROV-O, CSV, or JSON produces a regulator-ready audit trail.

Polyglot Graph Storage

Semantica’s storage layer is polyglot by design. One API exposes both RDF backends (via SPARQL) and labeled property graph backends (via Cypher), plus vector stores for hybrid search, all swappable without touching application code.

Semantica polyglot graph storage

On the RDF side, Semantica supports embedded Oxigraph, Blazegraph, Apache Jena, and Eclipse RDF4J, all speaking W3C standards (Turtle, JSON-LD, N-Triples). On the LPG side, it supports Neo4j, FalkorDB, Apache AGE, and AWS Neptune, all speaking Cypher. Vector stores include FAISS, Qdrant, Weaviate, Milvus, Pinecone, and PgVector with hybrid search and reciprocal rank fusion. This means a team can start with an embedded Oxigraph instance for development and swap to Neo4j or Neptune for production without rewriting their code.

Semantica vs Vector DB + RAG vs Plain LLM Memory

Semantica complements your existing stack rather than replacing it. Keep your LLM, vector store, and agent framework exactly as they are; Semantica adds the decision records, causal reasoning, provenance, ontology governance, conflict detection, and audit trails on top.

Semantica vs Vector DB+RAG vs Plain LLM Memory

  Vector DB + RAG Plain LLM Memory Semantica
Recall method Embedding similarity Token window Graph traversal + semantic search
Decision history Not stored Not stored First-class queryable objects
Provenance None None W3C PROV-O, source-linked
Reasoning None Black box Forward chain, Rete, Datalog, SPARQL
Conflict detection Silent overwrite Silent overwrite Detected, flagged, resolved
Time travel No No Point-in-time graph snapshots
Compliance export None None PROV-O, SHACL, OWL, RDF
Policy enforcement None None Built-in rule engine + SHACL
Entity resolution No No Blocking + semantic deduplication
Multi-agent context Separate per agent Separate per agent Single shared intelligence layer

The reasoning engines, KG construction, and provenance layer are fully deterministic; no LLM is required to use them.

What Semantica Gives You

  • Context Graphs: A structured, queryable graph of everything your agent knows, decides, and reasons about.
  • Decision Intelligence: Every decision is a first-class object: traceable, searchable by precedent, and causally linked.
  • AI Governance & Ontology: SHACL constraints, conflict detection, compliance rules, OWL generation, and SKOS vocabulary management with a visual editor.
  • Full Auditability: W3C PROV-O provenance on every fact, with audit trails exportable to JSON, CSV, or RDF.
  • Deterministic Reasoning: Forward chaining, Rete network, Datalog, and SPARQL with fully explainable paths, not black boxes.
  • Knowledge Pipeline: Multi-source ingestion, entity-aware chunking, NER, relation, event extraction, and KG construction, with semantic deduplication and provenance-preserving merges throughout.
  • Enterprise Data Platforms: Native connectors for Databricks (Unity Catalog + Delta Lake), Snowflake, and SAP OData, so data already living in your lakehouse or warehouse becomes graph nodes with provenance.
  • Graph Analytics: Centrality, community detection, link prediction, and shortest-path queries over the graph you just built.
  • Polyglot Graph Storage: Native RDF and LPG backends plus vector stores, all swappable without touching your code.
  • Visualization: Explore any graph, ontology, or timeline in an interactive browser workbench.
  • Drop-in Integrations: Native Agno, CrewAI, and LangChain support, a full-featured MCP server, a comprehensive CLI, a REST API, and plugins across major editors.

Quick Start

Install Semantica with pip.

pip install semantica

Record a decision and trace it.

from semantica.context import ContextGraph

graph = ContextGraph(advanced_analytics=True)

# Every agent decision becomes a queryable, auditable knowledge node
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,
)

# Ask "why did this happen?" and get a real, structured answer
chain     = graph.trace_decision_chain(decision_id)       # full causal ancestry
similar   = graph.find_similar_decisions("cloud vendor", max_results=5)  # precedents
impact    = graph.analyze_decision_impact(decision_id)    # downstream influence map
compliant = graph.check_decision_rules({"category": "vendor_selection"})  # policy gate

Verify your install:

semantica doctor

System-Level Explainability

Semantica provides system-level explainability, not foundation-model explainability. It does not expose or reconstruct what happens inside the LLM; its internal reasoning or chain-of-thought stays opaque, as it does for any external system. Semantica explains what is outside the model: the context and data fed in, the decision produced, its provenance, relevant relationships, applied policies, and the full execution trail.

Conclusion

Semantica is a pragmatic answer to the context and accountability gap in AI agent systems. By turning fragmented enterprise data into a governed, queryable Context Graph and knowledge graph with deterministic reasoning, PROV-O provenance, conflict detection, and decision intelligence, it lets a regulated enterprise answer “why did the AI do that?” in a format a regulator accepts, without sending data to a third-party SaaS or locking into a single graph backend. The source is on GitHub at semantica-agi/semantica, the package is on PyPI, and the documentation is at docs.getsemantica.ai.

Watch PyShine on YouTube

Contents