Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

12.4 KB
Raw Blame
[build-system]
requires = ["setuptools==84.2.1", "wheel==0.48.0"]
build-backend = "setuptools.build_meta"

[project]
name = "semantica"
version = "0.8.0"
description = "Graph-Native Infrastructure for Context and Accountable AI Systems: context graphs, decision intelligence, full provenance tracking, and explainable reasoning engines — every AI decision traceable, every output auditable."
readme = "README.md"
license = { text = "MIT" }

authors = [{ name = "Semantica", email = "[email protected]" }]
maintainers = [{ name = "Semantica", email = "[email protected]" }]

# Supported: 3.11-3.13. The Install Matrix, the classifiers below and the
# Docker image (python:3.13) cover exactly this range; keep them in sync
# (tests/test_python_support_policy.py enforces it).
#   - Floor: 3.8/3.9 were dropped in #1506. 3.10 is dropped because it reached
#     end of life on 2026-10-01 and Pillow 13, which fixes advisories that no
#     12.x release does, requires 3.11 (#2067). Installs on 3.10 resolve to
#     the last release that supports it, 0.7.x.
#   - Ceiling: 3.14 is not yet supported. gensim (extras `graph-embeddings`
#     and `split-topic`, both in `all`) ships no cp314 wheel, so those extras
#     and the Docker build need a C compiler there. Raise the cap together
#     with the Install Matrix and the Docker image once 3.14 is verified.
requires-python = ">=3.11,<3.14"

classifiers = [
  "Development Status :: 5 - Production/Stable",
  "Intended Audience :: Developers",
  "Intended Audience :: Science/Research",
  "Intended Audience :: Information Technology",
  "License :: OSI Approved :: MIT License",
  "Operating System :: OS Independent",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  "Topic :: Scientific/Engineering :: Artificial Intelligence",
  "Topic :: Scientific/Engineering :: Information Analysis",
  "Topic :: Text Processing :: Linguistic",
  "Topic :: Database :: Database Engines/Servers",
  "Topic :: Software Development :: Libraries :: Python Modules"
]

keywords = [
  "knowledge-graph", "context-graph", "ai-agents", "llm", "decision-intelligence",
  "provenance", "explainability", "reasoning-engine", "entity-extraction",
  "relation-extraction", "graph-rag", "knowledge-intelligence", "semantic-layer",
  "nlp", "embeddings", "ontology", "rdf", "triplet-extraction", "agentic-ai",
  "knowledge-base", "entity-resolution", "w3c-prov", "audit-trail"
]

# ---------------- CORE DEPENDENCIES (SAFE DEFAULT) ----------------
dependencies = [
  "numpy>=2.0.2",
  "pandas>=1.3.0",
  "scipy>=1.13.1",
  "scikit-learn>=1.7.2",
  "rdflib>=6.2.0",
  "networkx>=2.8.0",
  "requests>=2.34.2",
  "chardet>=7.4.3",
  "protobuf>=5.29.1,<8.0",
  "grpcio>=1.81.1",
  # 13.0.0 fixes 41 advisories against 12.3.0 (several critical, e.g.
  # GHSA-v9pv-5gc8-w2m6) and no 12.x release carries them. It needs Python
  # 3.11, which is why requires-python starts at 3.11 (#2067).
  "pillow>=13.0.0",
  "pydantic>=2.13.4",
  "click>=8.4.2",
  "rich>=12.5.0",
  "tqdm>=4.68.3",
  "pyyaml>=6.0",
  "toml>=0.10.0",
  "python-dotenv>=1.2.1",
  "loguru>=0.7.3",
  "structlog>=22.1.0",
  "httpx<0.29.0",
  "pyarrow>=14.0.0"
]

[project.urls]
Homepage      = "https://getsemantica.ai"
Documentation = "https://docs.getsemantica.ai"
Repository    = "https://github.com/semantica-agi/semantica"
Changelog     = "https://github.com/semantica-agi/semantica/blob/main/CHANGELOG.md"
"Bug Tracker" = "https://github.com/semantica-agi/semantica/issues"
Discord       = "https://discord.gg/sV34vps5hH"

# ---------------- OPTIONAL DEPENDENCIES ----------------
[project.optional-dependencies]

# ---- LLM Providers ----
llm-openai = ["openai>=1.0.0"]
llm-groq = ["groq>=0.4.0"]
llm-gemini = ["google-genai>=0.1.0"]
llm-anthropic = ["anthropic>=0.122.0"]
llm-ollama = ["ollama>=0.1.0"]
llm-deepseek = ["openai>=1.0.0"]
llm-novita = ["openai>=1.0.0"]
llm-litellm = ["litellm>=1.83.9"]
llm-instructor = ["instructor>=1.15.3"]
# Jev is early-access, so keep the integration on the reviewed 0.7 response
# contract until compatibility with a newer minor line is verified.
llm-typesafe = ["typesafe-sdk>=0.7.0,<0.8.0"]

llm-all = [
  "semantica[llm-openai,llm-groq,llm-gemini,llm-anthropic,llm-ollama,llm-deepseek,llm-novita,llm-litellm,llm-instructor,llm-typesafe]"
]

# ---- Document Parsing ----
documents = [
  "python-docx>=1.2.0",
  "openpyxl>=3.1.5",
  "lxml>=6.1.1",
  "beautifulsoup4>=4.15.0"
]
parse-docling = ["docling>=2.132.0"]
# pdfplumber powers the default PDFParser; not pulled in by any other extra.
parse-pdf = ["pdfplumber>=0.10.0"]

# ---- SHACL Validation ----
shacl = ["pyshacl>=0.25.0"]

# ---- Database Connectors ----
db-snowflake = [
  "snowflake-connector-python>=4.6.0",
  "cryptography>=49.0.0"
]
db-databricks = ["databricks-sdk>=0.60.0", "databricks-sql-connector>=4.0.0"]
db-arrow = ["pyarrow>=24.0.0"]
db-salesforce = ["simple-salesforce>=1.12.0"]
db-redshift = ["redshift-connector>=2.0.0"]
ingest-dynamics365 = ["msal>=1.20"]
db-cassandra = ["cassandra-driver>=3.29.0"]
db-bigquery = ["google-cloud-bigquery>=3.0.0"]
ingest-looker = ["looker-sdk>=24.0.0"]
ingest-parquet = ["pyarrow>=24.0.0"]
ingest-arrow = ["pyarrow>=24.0.0"]
ingest-tableau = ["tableauserverclient>=0.25"]
ingest-sap = ["requests>=2.28.0"]
ingest-servicenow = ["requests>=2.28.0"]
ingest-airflow = ["requests>=2.28.0"]
ingest-git = ["GitPython>=3.1.58"]

db-all = [
  "semantica[db-snowflake,db-databricks,db-salesforce,db-redshift,db-cassandra,db-bigquery,db-arrow]"
]

# ---- Embedding / Models ----
models-huggingface = [
  "transformers>=4.20.0",
  "torch>=1.13.1"
]
embeddings-local = [
  "sentence-transformers>=2.2.0",
  # 0.9.1 is the first fastembed that accepts Pillow 13 (earlier ones cap
  # pillow<13.0), so it is the floor that matches pillow>=13.0.0 above.
  "fastembed>=0.9.1",
  "onnxruntime>=1.20.1",
  "tokenizers>=0.15.0"
]
nlp-spacy = [
  "spacy>=3.4.0"
]
# LanguageDetector (semantica.normalize); without it every text is reported
# as the default language.
nlp-langdetect = [
  "langdetect>=1.0.9"
]

# ---- Graph Backends ----
graph-neo4j = ["neo4j>=5.0.0"]
graph-falkordb = ["falkordb>=1.0.0", "redis>=4.3.0"]
graph-amazon-neptune = ["boto3>=1.24.0", "neo4j>=5.0.0"]
graph-apache-age = ["psycopg2-binary>=2.9.0"]
graph-embeddings = ["gensim>=4.4.0"]

graph-all = [
  "semantica[graph-neo4j,graph-falkordb,graph-amazon-neptune,graph-apache-age,graph-embeddings]"
]

# ---- Triplet Store Backends ----
tripletstore-oxigraph = ["pyoxigraph>=0.5.0"]

# ---- Vector Store Backends ----
vectorstore-faiss = ["faiss-cpu>=1.7.0"]
vectorstore-qdrant = ["qdrant-client>=1.10.0"]
vectorstore-weaviate = ["weaviate-client>=4.0.0"]
vectorstore-pinecone = ["pinecone>=3.0.0"]
vectorstore-milvus = ["pymilvus>=2.0.0"]
vectorstore-pgvector = ["psycopg[binary,pool]>=3.0.0", "pgvector>=0.2.0"]
vectorstore-sqlite = ["sqlite-vec>=0.1.1"]

vectorstore-all = [
  "semantica[vectorstore-qdrant,vectorstore-weaviate,vectorstore-pinecone,vectorstore-milvus,vectorstore-pgvector,vectorstore-sqlite,vectorstore-faiss]"
]

# ---- Infra / Queues / Workers ----
infra = [
  "redis>=4.3.0",
  "celery>=5.2.0",
  "kafka-python>=3.0.2",
  "pulsar-client>=3.0.0",
  "pika>=1.3.0"
]

# ---- Cloud Providers ----
cloud = [
  "boto3>=1.24.0",
  "azure-storage-blob>=12.30.0",
  "google-cloud-storage>=2.5.0"
]

# ---- Monitoring (FIXED) ----
monitoring = [
  "prometheus-client>=0.14.0",
  "opentelemetry-api>=1.30.0,<2.0.0",
  "opentelemetry-sdk>=1.30.0,<2.0.0",
  "opentelemetry-semantic-conventions>=0.58b0,<0.67",
  "opentelemetry-instrumentation>=0.62b1,<0.67"
]

# ---- Visualization ----
viz = [
  "pyvis>=0.3.0",
  "graphviz>=0.21",
  "d3blocks>=1.0.0",
  "matplotlib>=3.9.4",
  "seaborn>=0.13.2",
  "plotly>=6.8.0",
  "ipywidgets>=8.0.0",
  "umap-learn>=0.5.12"
]

# ---- Media ----
media = [
  "librosa>=0.9.0",
  "opencv-python>=4.13.0.92"
]

# ---- GPU ----
gpu = [
  "faiss-gpu>=1.7.0",
  "cupy>=10.0.0"
]

# ---- Agentic Framework Integrations ----
agno = ["agno>=1.0.0"]
# There is deliberately no `crewai` extra: crewai hard-requires
# `chromadb~=1.1.0` and `json-repair~=0.25.2`, both of which carry critical
# advisories (CVE-2026-45829/45830/45831/45833, GHSA-xf7x-x43h-rpqh) with no
# fixed release on PyPI as of 2026-09. The integrations/crewai/ module still
# works standalone — install `crewai` yourself if you want it, at your own
# risk assessment — but semantica will not pull it in transitively.
langchain = ["langchain-core>=0.3.0"]
google-adk = ["google-adk>=1.27.0"]

# ---- Verification ----
# The Oxigraph-backed engine behind integrations/open_ontologies. Pure Python,
# no Rust toolchain and no service to run. The `shacl` extra of that package is
# what the shapes half of the check needs; the syntax and closed-world
# vocabulary checks work without it.
#
# The 0.5.0 floor is not cosmetic. Up to 0.4.0 that package declared `mcp` as a
# a core dependency, and `mcp` pulls a starlette major that `fastapi>=0.109.2`
# above does not accept, so installing it into this environment UNINSTALLED
# fastapi and every import of `semantica/explorer` then failed. 0.5.0 moves
# `mcp` behind a `server` extra, which the library API does not use.
open-ontologies = ["open-ontologies-lite>=0.5.0"]

# ---- File Watching ----
watch = ["watchdog>=6.0.0"]

# ---- Splitting / Chunking ----
split-tiktoken = ["tiktoken>=0.5.0"]
split-community = ["python-louvain>=0.16"]
split-topic = ["bertopic>=0.15.0", "gensim>=4.4.0"]

split-all = [
  "semantica[split-tiktoken,split-community,split-topic]"
]

# Explorer Dashboard
explorer = [
  "fastapi>=0.109.2",
  "starlette>=0.53.0",
  "uvicorn[standard]>=0.22.0",
  "websockets>=15.0.1",
  "python-multipart>=0.0.7",
  "defusedxml>=0.7.1"
]
explorer-lite = [
  # 1.66.1 is the first streamlit that accepts Pillow 13 (earlier releases cap
  # pillow<13), so it is the floor that matches the core pillow>=13.0.0.
  "streamlit>=1.66.1",
  "streamlit-agraph>=0.0.45"
]

# Everything (cross-platform — gpu excluded; install semantica[gpu] separately on Linux)
# NOTE: there is no ``crewai`` extra to include here — see the comment above
# the (removed) crewai entry under "Agentic Framework Integrations".
all = [
  "semantica[viz,media,infra,cloud,monitoring,watch,llm-all,models-huggingface,embeddings-local,nlp-spacy,nlp-langdetect,documents,ingest-git,graph-embeddings,split-all,graph-all,tripletstore-oxigraph,vectorstore-all,parse-docling,parse-pdf,ingest-parquet,ingest-arrow,shacl,explorer,agno,langchain,google-adk]"
]

# ---------------- DEVELOPMENT DEPENDENCIES (PEP 735) ----------------
# Contributor-only tooling. Not part of the published package metadata, so it is
# never installed by `pip install semantica[...]` (including `[all]`).
#   uv:  `uv sync` installs this group by default (locked in uv.lock)
#   pip: `pip install -e . --group dev` (pip 25.1+)
[dependency-groups]
dev = [
  "pytest>=7.1.0",
  "pytest-cov>=7.1.0",
  "pytest-asyncio>=0.19.0",
  "black>=22.6.0",
  "isort>=6.1.0",
  "flake8>=4.0.0",
  "mypy>=0.971",
  "pre-commit>=4.6.0",
  "jupyter>=1.0.0",
  "ipykernel>=6.15.0"
]

# ---------------- ENTRYPOINTS ----------------
[project.scripts]
semantica = "semantica.cli:main"
semantica-server = "semantica.server:main"
semantica-worker = "semantica.worker:main"
semantica-explorer = "semantica.explorer:main"
semantica-mcp = "semantica.mcp_server:main"

# ---------------- TOOLING ----------------
[tool.setuptools.packages.find]
where = ["."]
include = ["semantica*", "integrations*", "semantica_mcp*"]

[tool.setuptools.package-data]
# Explicit patterns are more reliable than **/* across setuptools versions.
# static/* covers index.html / favicon; static/assets/* covers all JS/CSS chunks.
"semantica" = ["static/*", "static/assets/*", "ontology/vocabulary/*.ttl"]

[tool.uv]
# databricks-sql-connector (latest 4.6.0) still caps oauthlib<4.0.0, but the
# fixes for GHSA PKCE timing / RevocationEndpoint JSONP only ship in 4.0.0.
# The connector only uses WebApplicationClient (prepare_authorization_request,
# parse_request_uri_response, prepare_request_body, prepare_refresh_body),
# which is unchanged in 4.0.0. Drop this once the connector lifts its cap.
override-dependencies = [
  "oauthlib>=4.0.0",
]

[tool.black]
line-length = 88

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
    "integration: marks tests that require external services or API keys (deselect with '-m not integration')",
    "no_gensim: marks tests that must still run when gensim is absent (e.g. they assert the missing-dependency behaviour)",
]