Skip to content

Guide · Open source

How to use Semantica: install it and build a Context Graph

Updated · written with AI from the project's own documentation and checked against our catalogue data

Semantica is an open-source Python library, released under the MIT licence, that turns scattered data into a structured knowledge graph it calls a Context Graph. AI agents can query that graph, and it records relationships, ontologies and decision provenance so you can trace which context fed into an AI decision. This guide covers what it is, how to install it, what its main parts do, and when it is and isn't the right tool.

Semanticasemantica-agi/semantica · ★ 14.4k · MIT

Quick start

  1. 1Check Python 3.11+. Confirm your Python version is 3.11 or newer, since that is the stated prerequisite.
  2. 2Install from PyPI. Run pip install semantica in a terminal, preferably inside a virtual environment.
  3. 3Read the docs. Open docs.getsemantica.ai and the README sections on Quick Start and Module Reference.
  4. 4Model your domain. Decide which entities, relationships and rules matter, and express them with ontologies such as OWL, SHACL or SKOS.
  5. 5Ingest and build the graph. Load your multi-source data and build a Context Graph and knowledge graph from it.
  6. 6Query from your agent. Connect your LLM, vector store or agent framework to query the graph for structured context.

What Semantica is and what it is not

Semantica sits underneath your LLM, vector store or agent framework rather than replacing them. The README describes it as the semantic and context layer that turns fragmented enterprise data into a queryable Context Graph and knowledge graph.

Semantica explains what is outside the model: the context fed in, the decision produced, its provenance, relevant relationships, applied policies and the execution trail. It does not expose or reconstruct the LLM's internal reasoning.

  • Good fit: AI platform teams building agents that need structured context beyond vector search.
  • Good fit: data engineers building a knowledge graph from multi-source data with conflict detection.
  • Good fit: regulated teams that want a self-hosted, auditable decision trail.
  • Not a fit: simple retrieval over documents, where a vector database or basic RAG is likely enough.
  • Not a fit: non-technical users looking for a ready-made end-user app, since the README centres on a Python install.

Install Semantica with pip

Semantica is installed from PyPI with the package manager. The README lists Python 3.11+ as the prerequisite.

Run the install command in a terminal, ideally inside a virtual environment, then confirm the package imports in Python.

  • Check that your Python version is 3.11 or newer before installing.
  • Use a virtual environment so the dependencies stay isolated from other projects.
pip install semantica

Build your first Context Graph

The README describes the core workflow as ingesting your data, extracting what matters, building a Context Graph and knowledge graph, and then running graph analytics and causal reasoning over the result.

Ontologies and controlled vocabularies (OWL, SHACL and SKOS) let you state what an entity means to your business, including its definitions, relationships and rules. The README says Semantica supports RDF and labelled property graph (LPG) storage and Polyglot Graph Storage, so the graph is not tied to one backend.

The README notes that an LLM is optional for graph construction, reasoning and provenance. When you do use one, Semantica supports several providers through semantica.llms.

  • Ingest data from your sources.
  • Extract entities and relationships.
  • Model meaning with ontologies (OWL, SHACL, SKOS).
  • Resolve duplicates and flag conflicting facts rather than silently overwriting them.
  • Query the graph from your agent or application.

Record decision provenance

Decision provenance and audit trails come from the graph structure. The README presents them as a result of the design rather than a separate feature to switch on.

The README's audit trail recipe is the best place to see how a regulated decision is recorded end to end. Check the project's documentation for the exact API calls.

  • Each decision is treated as a first-class object that can be traced and searched.
  • The trail records the context that fed the decision and the policies applied.

Where to find more: docs, CLI and modules

The README links to a documentation site, a Module Reference, a CLI section and an Integrations section. Start with the docs site for full guides, since this README is truncated in the source used for this page.

The README also links to a Discord community and a YouTube walkthrough of the platform.

  • Website: getsemantica.ai
  • Docs: docs.getsemantica.ai
  • Source code: github.com/semantica-agi/semantica

What people use it for

  • Giving an AI agent structured relationships and definitions, not just similarity-ranked text chunks.
  • Building a knowledge graph from multiple data sources, with conflicting facts flagged for review.
  • Recording which context fed an AI decision so a compliance team can review it later.
  • Turning tables in a lakehouse or warehouse into a governed knowledge graph without sending data to a third-party SaaS.

Frequently asked questions

Is Semantica free to use?

Semantica is released under the MIT licence, which the README states and the badge confirms. The licence permits use, and the source is public on GitHub. Check the LICENSE file in the repository for the full terms.

What do I need to install Semantica?

The README lists Python 3.11 or newer as the prerequisite. You install it from PyPI with pip install semantica.

How do I install Semantica?

Run pip install semantica in your terminal. The README gives this as the only install command, so use a virtual environment to keep it separate from other projects.

Is Semantica an alternative to a vector database?

Not exactly. The README says Semantica is meant to sit under an LLM, vector store or agent framework rather than replace them. If you only need simple retrieval over documents, a vector database or basic RAG setup is likely enough.

How does Semantica compare to Neo4j, RDFLib or LlamaIndex?

The source lists Neo4j, Apache Jena, RDFLib and LlamaIndex as comparable projects but does not compare them in detail. Semantica's stated focus is a Context Graph with ontologies and decision provenance. Evaluate each against your own storage and reasoning needs.

Can Semantica explain what the LLM is thinking?

No. The README says Semantica explains only what is outside the model, such as the context, relationships, policies and execution trail. The LLM's internal reasoning stays opaque.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Semantica suits AI and data teams that need structured, auditable context for agents, especially in regulated, self-hosted settings. If you only need document retrieval, or you want a ready-made app with no Python involved, a vector database, basic RAG setup or another tool will likely serve you better.

Install options & downloads