Files
semantica/docs/cookbook.md
T
KaifAhmad1 bdd99f7924 feat(cookbook): add Regulatory Intelligence use case
Adds an end-to-end cookbook use case that turns 9 real US federal
AI-governance and cybersecurity-regulation documents into an
explainable, ontology-driven knowledge graph: ingestion, chunking,
entity/relation/triplet extraction, ontology import/generation/
evaluation (6 vendored real W3C ontologies plus SKOS taxonomy),
entity resolution, SHACL validation, deterministic reasoning, PROV-O
provenance, an Oxigraph-backed persistent RDF store, conflict
detection, temporal reasoning, SPARQL, JSON-LD, GraphRAG retrieval,
and a five-agent Decision Intelligence workflow.

Real library rough edges hit along the way (noisy extraction over
dense prose, EntityResolver's batch merge not firing, the stub
OntologyValidator, find_precedents_advanced()'s vector-store bug, and
two VectorStore/HybridSearch bugs that drop metadata or crash for
non-inmemory backends) are reported honestly in the notebook output
and README rather than hidden.
2026-08-05 00:08:03 +05:30

7.6 KiB

title, description, icon
title description icon
Cookbook Interactive Jupyter notebooks covering everything from your first knowledge graph to production GraphRAG systems. flask
**Where to start:** - **New to Semantica**: begin with [Core Tutorials](#core-tutorials) - **Building an application**: see [Advanced Concepts](#advanced-concepts) - **Need installation help**: see the [Installation Guide](installation) Prerequisites: Python 3.8+, Jupyter, and an API key for your preferred LLM provider.
  • Your First Knowledge Graph — Go from raw text to a queryable knowledge graph in 20 minutes. Topics: Extraction, Graph Construction, Visualization · Beginner

Core Tutorials

Essential guides to master the Semantica framework.

  • Welcome to Semantica — Interactive introduction to the framework's core philosophy and all modules. Topics: Framework Overview, Architecture · Beginner
  • Data Ingestion — Loading data from files, web, databases, streams, feeds, repositories, email, and MCP. Topics: FileIngestor, WebIngestor, DBIngestor · Beginner
  • Document Parsing — Extracting clean text from complex formats like PDF, DOCX, and HTML. Topics: OCR, PDF Parsing, Text Extraction · Beginner
  • Data Normalization — Pipelines for cleaning, normalizing, and preparing text. Topics: Text Cleaning, Unicode, Formatting · Beginner
  • Entity Extraction — Using NER to identify people, organizations, and custom entities. Topics: NER, spaCy, LLM Extraction · Beginner
  • Relation Extraction — Discovering and classifying relationships between entities. Topics: Relation Classification, Dependency Parsing · Beginner
  • Embedding Generation — Creating and managing vector embeddings for semantic search. Topics: Embeddings, OpenAI, HuggingFace · Intermediate
  • Vector Store — Setting up vector stores for similarity search and retrieval. Intermediate
  • Graph Store — Persisting knowledge graphs in Neo4j or FalkorDB. Topics: Neo4j, Cypher, Persistence · Intermediate
  • Ontology — Defining domain schemas and ontologies to structure your data. Topics: OWL, RDF, Schema Design · Intermediate

Advanced Concepts

Deep dive into advanced features, customization, and complex workflows.

  • Advanced Extraction — Custom extractors, LLM-based extraction, and complex pattern matching. Topics: Custom Models, Regex, LLMs · Advanced
  • Advanced Graph Analytics — Centrality, community detection, and pathfinding algorithms. Topics: PageRank, Louvain, Shortest Path · Advanced
  • Advanced Context Engineering — Production-grade memory system for AI agents using FAISS and Neo4j. Topics: Agent Memory, GraphRAG, Entity Injection · Advanced
  • Complete Visualization Suite — Interactive, publication-ready visualizations of your graphs. Topics: PyVis, NetworkX, D3.js · Intermediate
  • Conflict Resolution — Strategies for handling contradictory information from multiple sources. Topics: Truth Discovery, Voting, Confidence · Advanced
  • Multi-Format Export — Exporting to RDF, OWL, JSON-LD, and NetworkX formats. Topics: Serialization, Interoperability · Intermediate
  • Multi-Source Integration — Merging data from disparate sources into a unified graph. Topics: Entity Resolution, Merging, Fusion · Advanced
  • Reasoning and Inference — Using logical reasoning to infer new knowledge from existing facts. Topics: Logic Rules, Inference Engines · Advanced
  • Temporal Knowledge Graphs — Modeling and querying data that changes over time. Topics: Time Series, Temporal Logic, Allen Algebra · Advanced

Use Cases

Self-contained, end-to-end examples built from real public data and real external ontologies, not synthetic samples. Each one is a folder with its own data/ (source documents + download script) and ontology/ (vendored real ontologies + a small domain extension) alongside the notebook.

  • Regulatory Intelligence — Turns 9 real U.S. federal AI-governance and cybersecurity-regulation documents (NIST AI RMF, NIST CSF 1.1/2.0, HIPAA Security Rule, Executive Order 14110, OMB M-24-10, and more) into an explainable, ontology-driven knowledge graph. Full pipeline: ingestion, chunking every document, automatic entity/relation/triplet extraction across the corpus, ontology import/generation/evaluation, entity resolution, graph construction, SHACL validation, deterministic rule-based reasoning, PROV-O provenance, a persistent RDF database (Oxigraph on disk, plus Semantica's TripletStore for a production server), conflict detection, temporal reasoning, SPARQL, JSON-LD, GraphRAG, and a five-agent Decision Intelligence workflow, reusing real W3C ontologies (ORG, PROV-O, SKOS, DCAT, OWL-Time, FRBR). Topics: Regulatory Intelligence, Decision Intelligence, Explainable AI · Advanced

How to Run

```bash pip install semantica[all] pip install jupyter ``` ```bash git clone https://github.com/semantica-agi/semantica.git cd semantica pip install -e ".[all]" pip install jupyter ``` ```bash jupyter notebook ``` You can also run the cookbook using Docker:
docker run -p 8888:8888 hawksight/semantica-cookbook