-
-- :material-lightning-bolt: **Efficient Embeddings**
- ---
- Uses **FastEmbed** by default for high-performance, lightweight local embedding generation (faster than sentence-transformers).
-
-- :material-database-import: **Universal Data Ingestion**
- ---
- Handles multiple formats (PDF, DOCX, HTML, JSON, CSV, databases, APIs, streams) with unified pipeline, no custom parsers needed.
-
-- :material-brain: **Automated Semantic Extraction**
- ---
- NER, relationship extraction, and triplet generation with LLM enhancement discovers entities and relationships automatically.
-
-- :material-graph: **Knowledge Graph Construction**
- ---
- Production-ready graphs with entity resolution, temporal support, and graph analytics. Queryable knowledge ready for AI applications.
-
-- :material-robot: **GraphRAG Engine**
- ---
- Hybrid vector + graph retrieval achieves **91% accuracy** (30% improvement) via semantic search + graph traversal for multi-hop reasoning.
-
-- :material-account-cog: **AI Agent Context Engineering**
- ---
- Persistent memory with RAG + knowledge graphs enables context maintenance, action validation, and structured knowledge access.
-
-- :material-book-open-variant: **Automated Ontology Generation**
- ---
- 6-stage LLM pipeline generates validated OWL ontologies with HermiT/Pellet validation, eliminating manual engineering.
-
-- :material-shield-check: **Production-Grade QA**
- ---
- Conflict detection, deduplication, quality scoring, and provenance tracking ensure trusted, production-ready knowledge graphs.
-
-- :material-cog-transfer: **Pipeline Orchestration**
- ---
- Flexible pipeline builder with parallel execution enables scalable processing via orchestrator-worker pattern.
-
-
-
-### Core Features at a Glance
-
-| **Feature Category** | **Capabilities** | **Key Benefits** |
-|:---------------------|:-----------------|:------------------|
-| **Data Ingestion** | Multiple formats (PDF, DOCX, HTML, JSON, CSV, databases, APIs, streams, archives) | Universal ingestion, no custom parsers needed |
-| **Semantic Extraction** | NER, relationship extraction, triplet generation, LLM enhancement | Automated discovery of entities and relationships |
-| **Knowledge Graphs** | Entity resolution, temporal support, graph analytics, query interface | Production-ready, queryable knowledge structures |
-| **Ontology Generation** | 6-stage LLM pipeline, OWL generation, HermiT/Pellet validation | Automated ontology creation from documents |
-| **GraphRAG** | Hybrid vector + graph retrieval, multi-hop reasoning | 91% accuracy, 30% improvement over vector-only |
-| **Agent Memory** | Persistent memory (Save/Load), Hybrid Retrieval (Vector+Graph), FastEmbed support | Context-aware agents with semantic understanding |
-| **Pipeline Orchestration** | Parallel execution, custom steps, orchestrator-worker pattern | Scalable, flexible data processing |
-| **Quality Assurance** | Conflict detection, deduplication, quality scoring, provenance | Trusted knowledge graphs ready for production |
+**[๐ Full Quick Start](getting-started.md)** โข **[๐ณ Cookbook Examples](cookbook.md)** โข **[๐ฌ Join Discord](https://discord.gg/ggb7vWeP)** โข **[โญ Star Us](https://github.com/Hawksight-AI/semantica)**
---
-## โจ Core Capabilities
+## Core Value Proposition
-### 1. ๐ Universal Data Ingestion
+| **Trustworthy** | **Explainable** | **Auditable** |
+|:------------------:|:------------------:|:-----------------:|
+| Conflict detection & validation | Transparent reasoning paths | Complete provenance tracking |
+| Rule-based governance | Entity relationships & ontologies | W3C PROV-O compliant lineage |
+| Production-grade QA | Multi-hop graph reasoning | Source tracking & integrity verification |
-Process **multiple file formats** with intelligent semantic extraction:
+---
-
+## Key Features & Benefits
-- __๐ Documents__
- ---
- - PDF (with OCR)
- - DOCX, XLSX, PPTX
- - TXT, RTF, ODT
- - EPUB, LaTeX, Markdown
+### Not Just Another Agentic Framework
-- __๐ Web & Feeds__
- ---
- - HTML, XHTML, XML
- - RSS, Atom feeds
- - JSON-LD, RDFa
- - Web scraping
+**Semantica complements** LangChain, LlamaIndex, AutoGen, CrewAI, Google ADK, Agno, and other frameworks to enhance your agents with:
-- __๐พ Structured Data__
- ---
- - JSON, YAML, TOML
- - CSV, TSV, Excel
- - Parquet, Avro, ORC
- - SQL/NoSQL databases
+| Feature | Benefit |
+|:--------|:--------|
+| **Auditable** | Complete provenance tracking with W3C PROV-O compliance |
+| **Explainable** | Transparent reasoning paths with entity relationships |
+| **Provenance-Aware** | End-to-end lineage from documents to responses |
+| **Validated** | Built-in conflict detection, deduplication, QA |
+| **Governed** | Rule-based validation and semantic consistency |
+| **Version Control** | Enterprise-grade change management with integrity verification |
-- __๐ง Communication__
- ---
- - EML, MSG, MBOX
- - PST archives
- - Email threads
- - Attachment extraction
+### Perfect For High-Stakes Use Cases
-- __๐๏ธ Archives__
- ---
- - ZIP, TAR, RAR, 7Z
- - Recursive processing
- - Multi-level extraction
+| ๐ฅ **Healthcare** | ๐ฐ **Finance** | โ๏ธ **Legal** |
+|:-----------------:|:--------------:|:------------:|
+| Clinical decisions | Fraud detection | Evidence-backed research |
+| Drug interactions | Regulatory support | Contract analysis |
+| Patient safety | Risk assessment | Case law reasoning |
-- __๐ฌ Scientific__
- ---
- - BibTeX, EndNote, RIS
- - JATS XML
- - PubMed formats
- - Citation networks
+| ๐ **Cybersecurity** | ๐๏ธ **Government** | ๐ญ **Infrastructure** | ๐ **Autonomous** |
+|:-------------------:|:----------------:|:-------------------:|:-----------------:|
+| Threat attribution | Policy decisions | Power grids | Decision logs |
+| Incident response | Classified info | Transportation | Safety validation |
-
+### Powers Your AI Stack
-### 2. ๐ง Semantic Intelligence Engine
+- **GraphRAG Systems** โ Retrieval with graph reasoning and hybrid search
+- **AI Agents** โ Trustworthy, accountable multi-agent systems with semantic memory
+- **Reasoning Models** โ Explainable AI decisions with reasoning paths
+- **Enterprise AI** โ Governed, auditable platforms that support compliance
-Transform raw text into structured semantic knowledge with state-of-the-art NLP and AI models:
+### Integrations
-- **Named Entity Recognition (NER)**: Extract people, organizations, locations, dates, and custom entities
-- **Relationship Extraction**: Identify semantic, temporal, and causal relationships
-- **Event Detection**: Detect and classify events (acquisitions, partnerships, announcements)
-- **Coreference Resolution**: Resolve pronouns and entity mentions across documents
-- **Triplet Extraction**: Generate RDF triplets for knowledge graph construction
+- **Docling Support** โ Document parsing with table extraction (PDF, DOCX, PPTX, XLSX)
+- **AWS Neptune** โ Amazon Neptune graph database support with IAM authentication
+- **Custom Ontology Import** โ Import existing ontologies (OWL, RDF, Turtle, JSON-LD)
-### 3. ๐ธ๏ธ Knowledge Graph Construction
+> **Built for environments where every answer must be explainable and governed.**
-Build production-ready knowledge graphs with:
+---
-- **Automatic Entity Resolution**: Merge duplicate entities with fuzzy matching
-- **Conflict Detection & Resolution**: Handle contradictory information from multiple sources
-- **Temporal Knowledge Graphs**: Track changes over time with version history
-- **Graph Analytics**: Centrality, community detection, path finding
-- **Multi-Format Export**: Neo4j, RDF, JSON-LD, GraphML
+## ๐จ The Problem: The Semantic Gap
-### 4. ๐ Ontology Generation & Management
+### Most AI systems fail in high-stakes domains because they operate on **text similarity**, not **meaning**.
-Generate formal ontologies automatically using a **6-stage LLM-based pipeline**:
+### Understanding the Semantic Gap
-1. **Semantic Network Parsing** โ Extract domain concepts
-2. **YAML-to-Definition** โ Transform into class definitions
-3. **Definition-to-Types** โ Map to OWL types
-4. **Hierarchy Generation** โ Build taxonomic structures
-5. **TTL Generation** โ Generate OWL/Turtle syntax
-6. **Symbolic Validation** โ HermiT/Pellet reasoning (F1 up to 0.99)
+The **semantic gap** is the fundamental disconnect between what AI systems can process (text patterns, vector similarities) and what high-stakes applications require (semantic understanding, meaning, context, and relationships).
-### 5. ๐ Hybrid Search & Retrieval
+**Traditional AI approaches:**
+- Rely on statistical patterns and text similarity
+- Cannot understand relationships between entities
+- Cannot reason about domain-specific rules
+- Cannot explain why decisions were made
+- Cannot trace back to original sources with confidence
-Power GraphRAG applications with:
+**High-stakes AI requires:**
+- Semantic understanding of entities and their relationships
+- Domain knowledge encoded as formal rules (ontologies)
+- Explainable reasoning paths
+- Source-level provenance
+- Conflict detection and resolution
-- **Vector Search**: Semantic similarity using embeddings
-- **Graph Traversal**: Multi-hop reasoning for context expansion
-- **Hybrid Retrieval**: Combine vector + graph for improved accuracy
-- **Temporal Queries**: Query knowledge at specific time points
+**Semantica bridges this gap** by providing a semantic intelligence layer that transforms unstructured data into validated, explainable, and auditable knowledge.
+
+### What Organizations Have vs What They Need
+
+| **Current State** | **Required for High-Stakes AI** |
+|:---------------------|:-----------------------------------|
+| PDFs, DOCX, emails, logs | Formal domain rules (ontologies) |
+| APIs, databases, streams | Structured and validated entities |
+| Conflicting facts and duplicates | Explicit semantic relationships |
+| Siloed systems with no lineage | **Explainable reasoning paths** |
+| | **Source-level provenance** |
+| | **Audit-ready compliance** |
+
+### The Cost of Missing Semantics
+
+- **Decisions cannot be explained** โ No transparency in AI reasoning
+- **Errors cannot be traced** โ No way to debug or improve
+- **Conflicts go undetected** โ Contradictory information causes failures
+- **Compliance becomes impossible** โ No audit trails for regulations
+
+**Trustworthy AI requires semantic accountability.**
+
+---
+
+## ๐ Semantica vs Traditional RAG
+
+| Feature | Traditional RAG | Semantica |
+|:--------|:----------------|:----------|
+| **Reasoning** | โ Black-box answers | โ
Explainable reasoning paths |
+| **Provenance** | โ No provenance | โ
W3C PROV-O compliant lineage tracking |
+| **Search** | โ ๏ธ Vector similarity only | โ
Semantic + graph reasoning |
+| **Quality** | โ No conflict handling | โ
Explicit contradiction detection |
+| **Safety** | โ ๏ธ Unsafe for high-stakes | โ
Designed for governed environments |
+| **Compliance** | โ No audit trails | โ
Complete audit trails with integrity verification |
+
+---
+
+## ๐งฉ Semantica Architecture
+
+### 1๏ธโฃ Input Layer โ Governed Ingestion
+- ๐ **Multiple Formats** โ PDFs, DOCX, HTML, JSON, CSV, Excel, PPTX
+- ๐ง **Docling Support** โ Docling parser for table extraction
+- ๐พ **Data Sources** โ Databases, APIs, streams, archives, web content
+- ๐จ **Media Support** โ Image parsing with OCR, audio/video metadata extraction
+- ๏ฟฝ **Single Pipeline** โ Unified ingestion with metadata and source tracking
+
+### 2๏ธโฃ Semantic Layer โ Trust & Reasoning Engine
+- ๐ **Entity Extraction** โ NER, normalization, classification
+- ๐ **Relationship Discovery** โ Triplet generation, semantic links
+- ๐ **Ontology Induction** โ Automated domain rule generation
+- ๐ **Deduplication** โ Jaro-Winkler similarity, conflict resolution
+- โ
**Quality Assurance** โ Conflict detection, validation
+- ๐ **Provenance Tracking** โ W3C PROV-O compliant lineage tracking across all modules
+- ๐ง **Reasoning Traces** โ Explainable inference paths
+- ๐ **Change Management** โ Version control with audit trails, checksums, compliance support
+
+### 3๏ธโฃ Output Layer โ Auditable Knowledge Assets
+- ๏ฟฝ **Knowledge Graphs** โ Queryable, temporal, explainable
+- ๐ **OWL Ontologies** โ HermiT/Pellet validated, custom ontology import support
+- ๐ข **Vector Embeddings** โ FastEmbed by default
+- โ๏ธ **AWS Neptune** โ Amazon Neptune graph database support
+- ๐ **Provenance** โ Every AI response links back to:
+ - ๐ Source documents
+ - ๐ท๏ธ Extracted entities & relations
+ - ๐ Ontology rules applied
+ - ๐ง Reasoning steps used
+
+---
+
+## ๐ฅ Built for High-Stakes Domains
+
+Designed for domains where **mistakes have real consequences** and **every decision must be accountable**:
+
+- **๐ฅ Healthcare & Life Sciences** โ Clinical decision support, drug interaction analysis, medical literature reasoning, patient safety tracking
+- **๐ฐ Finance & Risk** โ Fraud detection, regulatory support (SOX, GDPR, MiFID II), credit risk assessment, algorithmic trading validation
+- **โ๏ธ Legal & Compliance** โ Evidence-backed legal research, contract analysis, regulatory change tracking, case law reasoning
+- **๐ Cybersecurity & Intelligence** โ Threat attribution, incident response, security audit trails, intelligence analysis
+- **๐๏ธ Government & Defense** โ Governed AI systems, policy decisions, classified information handling, defense intelligence
+- **๐ญ Critical Infrastructure** โ Power grid management, transportation safety, water treatment, emergency response
+- **๐ Autonomous Systems** โ Self-driving vehicles, drone navigation, robotics safety, industrial automation
+
+---
+
+## ๏ฟฝ Who Uses Semantica?
+
+- **๐ค AI / ML Engineers** โ Building explainable GraphRAG & agents
+- **โ๏ธ Data Engineers** โ Creating governed semantic pipelines
+- **๐ Knowledge Engineers** โ Managing ontologies & KGs at scale
+- **๐ข Enterprise Teams** โ Requiring trustworthy AI infrastructure
+- **๐ก๏ธ Risk & Compliance Teams** โ Needing audit-ready systems
---
@@ -420,7 +363,7 @@ print(f"Created graph with {len(kg.nodes)} nodes and {len(kg.edges)} edges")
-- **๐ 100% Open Source**
+- **๐ Open Source**
---
MIT licensed. No vendor lock-in. Full transparency.
@@ -487,13 +430,3 @@ Get hands-on with interactive Jupyter notebooks:
- **Difficulty**: Advanced
- **Use Cases**: Building AI applications with knowledge graphs
----
-
-
-
-**Ready to transform your data into knowledge?**
-
-[Get Started Now](getting-started.md){ .md-button .md-button--primary }
-[Join Discord](https://discord.gg/semantica){ .md-button }
-
-
diff --git a/docs/integrations/snowflake.md b/docs/integrations/snowflake.md
new file mode 100644
index 00000000..8e624262
--- /dev/null
+++ b/docs/integrations/snowflake.md
@@ -0,0 +1,280 @@
+# Snowflake Integration
+
+Semantica features a native integration with **Snowflake**, the powerful cloud data warehouse that enables scalable data storage and analytics for enterprise workloads.
+
+## Overview
+
+Snowflake is integrated into Semantica's `ingest` module via the `SnowflakeIngestor`. This allows you to seamlessly extract structured data from Snowflake tables and queries into semantic structures that can be indexed, searched, and analyzed within the Semantica framework.
+
+- ๐ **Semantica Snowflake Integration Docs**: [Reference Guide](../reference/ingest.md)
+- ๐ป **Semantica Snowflake Integration GitHub**: [Source Code](https://github.com/Hawksight-AI/semantica/blob/main/semantica/ingest/snowflake_ingestor.py)
+- ๐ง๐ฝโ๐ณ **Semantica Snowflake Integration Example**: [Snowflake Clear Code Example](../CodeExamples.md#snowflake-clear-code-example)
+- ๐ฆ **Semantica Snowflake Integration PyPI**: [Installation Guide](../installation.md)
+
+---
+
+## ๐ Integration Documentation
+
+The `SnowflakeIngestor` provides a high-level interface for Snowflake data ingestion. It supports:
+
+* **Multiple Authentication Methods**: Password, key-pair, OAuth, and SSO authentication.
+* **Advanced Querying**: Custom SQL queries with parameterization and batching.
+* **Schema Introspection**: Automatic table schema discovery and metadata extraction.
+* **Document Export**: Convert Snowflake data to Semantica document format.
+
+### Basic Usage
+
+```python
+from semantica.ingest import SnowflakeIngestor
+
+# Initialize with environment variables
+ingestor = SnowflakeIngestor()
+
+# Ingest a table
+data = ingestor.ingest_table("CUSTOMERS")
+
+# Access the structured data
+print(f"Retrieved {data.row_count} rows")
+print(f"Columns: {data.columns}")
+```
+
+For more details, see the [Ingest Reference](../reference/ingest.md).
+
+---
+
+## ๐ง๐ฝโ๐ณ Integration Example
+
+We provide a detailed cookbook and clear code examples to help you get started quickly.
+
+### Snowflake Clear Code Example
+
+```python
+from semantica.ingest import SnowflakeIngestor
+import os
+from dotenv import load_dotenv
+
+# 1. Load environment variables
+load_dotenv()
+
+# 2. Initialize the Snowflake Ingestor
+ingestor = SnowflakeIngestor(
+ account=os.getenv("SNOWFLAKE_ACCOUNT"),
+ user=os.getenv("SNOWFLAKE_USER"),
+ password=os.getenv("SNOWFLAKE_PASSWORD"),
+ warehouse=os.getenv("SNOWFLAKE_WAREHOUSE"),
+ database=os.getenv("SNOWFLAKE_DATABASE"),
+ schema=os.getenv("SNOWFLAKE_SCHEMA")
+)
+
+# 3. Ingest a table with filters
+data = ingestor.ingest_table(
+ "CUSTOMERS",
+ where="COUNTRY = 'USA' AND CREATED_DATE > '2024-01-01'",
+ order_by="CREATED_DATE DESC",
+ limit=10000
+)
+
+# 4. Access the structured data
+print(f"--- Customer Data ---")
+print(f"Retrieved {data.row_count} customers")
+print(f"Columns: {data.columns}")
+
+# 5. Iterate through rows
+for row in data.data[:5]: # Print first 5 rows
+ print(f"Customer: {row['NAME']} ({row['EMAIL']})")
+
+# 6. Export as documents for Semantica processing
+documents = ingestor.export_as_documents(
+ data,
+ id_field="CUSTOMER_ID",
+ text_fields=["NAME", "EMAIL", "NOTES"]
+)
+
+print(f"Created {len(documents)} documents for processing")
+```
+
+See more in our [Code Examples](../CodeExamples.md).
+
+---
+
+## ๐ป GitHub Source
+
+The integration is open-source and available on GitHub. You can explore the implementation, contribute improvements, or report issues.
+
+- [snowflake_ingestor.py](https://github.com/Hawksight-AI/semantica/blob/main/semantica/ingest/snowflake_ingestor.py) - The core implementation of the Snowflake integration.
+
+---
+
+## ๐ฆ PyPI & Installation
+
+Snowflake connector is an optional dependency for Semantica. You can install it along with Semantica or as a separate requirement.
+
+### Install via Semantica
+```bash
+# Install with Snowflake support
+pip install semantica[db-snowflake]
+
+# Or install with all database connectors
+pip install semantica[db-all]
+```
+
+### Install Snowflake connector manually
+If you are working in a custom environment:
+```bash
+pip install snowflake-connector-python
+```
+
+For full installation details, see the [Installation Guide](../installation.md).
+
+---
+
+## ๐ Authentication Methods
+
+Snowflake integration supports multiple authentication methods for different security requirements:
+
+### Password Authentication
+```python
+ingestor = SnowflakeIngestor(
+ account="myaccount",
+ user="myuser",
+ password="mypassword",
+ warehouse="COMPUTE_WH"
+)
+```
+
+### Key-Pair Authentication (Recommended for Production)
+```python
+ingestor = SnowflakeIngestor(
+ account="myaccount",
+ user="myuser",
+ private_key_path="/path/to/rsa_key.p8",
+ warehouse="COMPUTE_WH"
+)
+```
+
+### OAuth Authentication
+```python
+ingestor = SnowflakeIngestor(
+ account="myaccount",
+ user="myuser",
+ authenticator="oauth",
+ token="your_oauth_token",
+ warehouse="COMPUTE_WH"
+)
+```
+
+### SSO Authentication
+```python
+ingestor = SnowflakeIngestor(
+ account="myaccount",
+ user="myuser",
+ authenticator="externalbrowser",
+ warehouse="COMPUTE_WH"
+)
+```
+
+---
+
+## ๐ Advanced Features
+
+### Schema Introspection
+```python
+# Get table schema
+schema = ingestor.get_table_schema("CUSTOMERS")
+for column in schema["columns"]:
+ print(f"{column['name']}: {column['type']}")
+```
+
+### Custom Queries
+```python
+# Execute custom SQL
+data = ingestor.ingest_query("""
+ SELECT
+ CUSTOMER_ID,
+ SUM(AMOUNT) AS TOTAL_AMOUNT
+ FROM SALES
+ WHERE DATE >= '2024-01-01'
+ GROUP BY CUSTOMER_ID
+""")
+```
+
+### Batch Processing
+```python
+# Handle large result sets
+data = ingestor.ingest_query(
+ "SELECT * FROM LARGE_TABLE",
+ batch_size=5000
+)
+```
+
+---
+
+## ๐ Best Practices
+
+### Use Environment Variables
+```python
+import os
+from dotenv import load_dotenv
+
+load_dotenv()
+ingestor = SnowflakeIngestor() # Reads from environment
+```
+
+### Use Key-Pair Authentication for Production
+```python
+ingestor = SnowflakeIngestor(
+ account=os.getenv("SNOWFLAKE_ACCOUNT"),
+ user=os.getenv("SNOWFLAKE_USER"),
+ private_key_path=os.getenv("SNOWFLAKE_PRIVATE_KEY_PATH"),
+ warehouse="COMPUTE_WH"
+)
+```
+
+### Paginate Large Results
+```python
+PAGE_SIZE = 10000
+for page in range(total_pages):
+ data = ingestor.ingest_table(
+ "LARGE_TABLE",
+ limit=PAGE_SIZE,
+ offset=page * PAGE_SIZE
+ )
+ process_batch(data)
+```
+
+---
+
+## ๐ Troubleshooting
+
+### Connection Issues
+```python
+# Test connection
+connector = SnowflakeConnector(
+ account="myaccount",
+ user="myuser",
+ password="mypassword"
+)
+
+if not connector.test_connection():
+ print("Connection failed - check credentials")
+```
+
+### Performance Optimization
+```python
+# Use appropriate warehouse size
+ingestor = SnowflakeIngestor(
+ account="myaccount",
+ user="myuser",
+ password="mypassword",
+ warehouse="LARGE_WH" # For heavy workloads
+)
+```
+
+---
+
+## ๐ See Also
+
+- **[Ingest Module Reference](../reference/ingest.md)** - Complete ingestion documentation
+- **[Getting Started Guide](../getting-started.md)** - Quick start with Semantica
+- **[Code Examples](../CodeExamples.md)** - More integration examples
+- **[Installation Guide](../installation.md)** - Installation instructions
diff --git a/docs/integrations/snowflake_ingestion.md b/docs/integrations/snowflake_ingestion.md
deleted file mode 100644
index a0ef1129..00000000
--- a/docs/integrations/snowflake_ingestion.md
+++ /dev/null
@@ -1,570 +0,0 @@
-# Snowflake Ingestion Guide
-
-This guide explains how to use the Snowflake ingestor to extract data from Snowflake data warehouses into Semantica.
-
-## Table of Contents
-
-- [Installation](#installation)
-- [Authentication Methods](#authentication-methods)
-- [Basic Usage](#basic-usage)
-- [Advanced Features](#advanced-features)
-- [Error Handling](#error-handling)
-- [Best Practices](#best-practices)
-
-## Installation
-
-Install Semantica with Snowflake support:
-
-```bash
-# Install with Snowflake support only
-pip install semantica[db-snowflake]
-
-# Or install with all database connectors
-pip install semantica[db-all]
-```
-
-This will install:
-- `snowflake-connector-python>=3.0.0`
-- `cryptography>=3.4.0` (required for key-pair authentication)
-
-## Authentication Methods
-
-### 1. Password Authentication (Default)
-
-The simplest authentication method using username and password:
-
-```python
-from semantica.ingest import SnowflakeIngestor
-
-ingestor = SnowflakeIngestor(
- account="myaccount", # Your Snowflake account identifier
- user="myuser",
- password="mypassword",
- warehouse="COMPUTE_WH",
- database="MYDB",
- schema="PUBLIC"
-)
-```
-
-**Environment Variables:**
-
-```bash
-export SNOWFLAKE_ACCOUNT="myaccount"
-export SNOWFLAKE_USER="myuser"
-export SNOWFLAKE_PASSWORD="mypassword"
-export SNOWFLAKE_WAREHOUSE="COMPUTE_WH"
-export SNOWFLAKE_DATABASE="MYDB"
-export SNOWFLAKE_SCHEMA="PUBLIC"
-```
-
-**Note:** For key-pair authentication, you must provide the `private_key_path` parameter directly in code. Environment variables are supported for account, user, warehouse, database, schema, role, authenticator, and token parameters.
-
-```python
-# Now you can omit supported parameters - they'll be read from environment
-ingestor = SnowflakeIngestor()
-```
-
-### 2. Key-Pair Authentication
-
-More secure authentication using RSA key pairs:
-
-**Generate Key Pair:**
-
-```bash
-# Generate private key
-openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
-
-# Generate public key
-openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
-```
-
-**Add public key to Snowflake:**
-
-```sql
-ALTER USER myuser SET RSA_PUBLIC_KEY='MIIBIjANBgkqh...';
-```
-
-**Use in Python:**
-
-```python
-from semantica.ingest import SnowflakeIngestor
-
-ingestor = SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- private_key_path="/path/to/rsa_key.p8",
- warehouse="COMPUTE_WH",
- database="MYDB"
-)
-```
-
-**With encrypted private key:**
-
-```python
-ingestor = SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- private_key_path="/path/to/rsa_key.p8",
- private_key_passphrase="my_passphrase",
- warehouse="COMPUTE_WH"
-)
-```
-
-### 3. OAuth Authentication
-
-Use OAuth tokens for authentication:
-
-```python
-ingestor = SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- authenticator="oauth",
- token="your_oauth_token",
- warehouse="COMPUTE_WH"
-)
-```
-
-### 4. SSO Authentication (External Browser)
-
-For organizations using SSO:
-
-```python
-ingestor = SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- authenticator="externalbrowser",
- warehouse="COMPUTE_WH"
-)
-# This will open a browser for SSO login
-```
-
-## Basic Usage
-
-### Ingest a Table
-
-```python
-from semantica.ingest import SnowflakeIngestor
-
-ingestor = SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- password="mypassword",
- warehouse="COMPUTE_WH",
- database="MYDB",
- schema="PUBLIC"
-)
-
-# Ingest entire table
-data = ingestor.ingest_table("CUSTOMERS")
-
-print(f"Retrieved {data.row_count} rows")
-print(f"Columns: {data.columns}")
-print(f"First row: {data.data[0]}")
-```
-
-### Ingest with Filters
-
-```python
-# With WHERE clause
-data = ingestor.ingest_table(
- "CUSTOMERS",
- where="COUNTRY = 'USA' AND CREATED_DATE > '2024-01-01'"
-)
-
-# With limit and offset for pagination
-data = ingestor.ingest_table(
- "CUSTOMERS",
- limit=10000,
- offset=0,
- order_by="CREATED_DATE DESC"
-)
-```
-
-### Execute Custom Queries
-
-```python
-# Simple query
-data = ingestor.ingest_query("""
- SELECT
- CUSTOMER_ID,
- SUM(AMOUNT) AS TOTAL_AMOUNT
- FROM SALES
- WHERE DATE >= '2024-01-01'
- GROUP BY CUSTOMER_ID
- HAVING SUM(AMOUNT) > 1000
-""")
-
-# Parameterized query
-data = ingestor.ingest_query(
- "SELECT * FROM SALES WHERE DATE > %(start_date)s AND REGION = %(region)s",
- params={
- "start_date": "2024-01-01",
- "region": "WEST"
- }
-)
-```
-
-### Large Result Sets with Batching
-
-```python
-# Fetch in batches to manage memory
-data = ingestor.ingest_query(
- "SELECT * FROM LARGE_TABLE",
- batch_size=5000 # Fetch 5000 rows at a time
-)
-
-print(f"Total rows: {data.row_count}")
-```
-
-## Advanced Features
-
-### Schema Introspection
-
-```python
-# Get table schema
-schema = ingestor.get_table_schema("CUSTOMERS")
-
-for column in schema["columns"]:
- print(f"{column['name']}: {column['type']} (nullable: {column['nullable']})")
-
-print(f"Primary keys: {schema['primary_keys']}")
-```
-
-### List All Tables
-
-```python
-# List tables in current schema
-tables = ingestor.list_tables()
-print(f"Found {len(tables)} tables: {tables}")
-
-# List tables in specific database/schema
-tables = ingestor.list_tables(database="OTHER_DB", schema="OTHER_SCHEMA")
-```
-
-### Export as Documents
-
-Convert Snowflake data to Semantica document format:
-
-```python
-# Ingest data
-data = ingestor.ingest_table("ARTICLES")
-
-# Convert to documents
-documents = ingestor.export_as_documents(
- data,
- id_field="ARTICLE_ID",
- text_fields=["TITLE", "CONTENT", "SUMMARY"]
-)
-
-# Now use in Semantica pipeline
-from semantica.pipeline import Pipeline
-
-pipeline = Pipeline()
-for doc in documents:
- pipeline.process_document(doc)
-```
-
-### Context Manager
-
-Use as a context manager for automatic connection cleanup:
-
-```python
-with SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- password="mypassword"
-) as ingestor:
- data = ingestor.ingest_table("CUSTOMERS")
- # Connection automatically closed on exit
-```
-
-### Multiple Schemas/Databases
-
-```python
-# Ingest from different databases and schemas
-data1 = ingestor.ingest_table(
- "CUSTOMERS",
- database="SALES_DB",
- schema="PROD"
-)
-
-data2 = ingestor.ingest_table(
- "ORDERS",
- database="SALES_DB",
- schema="STAGING"
-)
-```
-
-## Error Handling
-
-```python
-from semantica.utils.exceptions import ProcessingError, ValidationError
-
-try:
- ingestor = SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- password="wrong_password"
- )
- data = ingestor.ingest_table("CUSTOMERS")
-
-except ValidationError as e:
- print(f"Configuration error: {e}")
-
-except ProcessingError as e:
- print(f"Processing failed: {e}")
-
-except Exception as e:
- print(f"Unexpected error: {e}")
-```
-
-### Test Connection
-
-```python
-# Test connection before using
-connector = SnowflakeConnector(
- account="myaccount",
- user="myuser",
- password="mypassword"
-)
-
-if connector.test_connection():
- print("Connection successful!")
-else:
- print("Connection failed")
-```
-
-## Best Practices
-
-### 1. Use Environment Variables for Credentials
-
-**Don't:**
-```python
-# Hard-coded credentials (bad!)
-ingestor = SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- password="mypassword123"
-)
-```
-
-**Do:**
-```python
-# Use environment variables
-import os
-from dotenv import load_dotenv
-
-load_dotenv()
-
-ingestor = SnowflakeIngestor() # Reads from environment
-```
-
-### 2. Use Key-Pair Authentication for Production
-
-Key-pair authentication is more secure than passwords:
-
-```python
-ingestor = SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- private_key_path=os.getenv("SNOWFLAKE_PRIVATE_KEY_PATH"),
- warehouse="COMPUTE_WH"
-)
-```
-
-### 3. Paginate Large Result Sets
-
-```python
-# Don't fetch millions of rows at once
-PAGE_SIZE = 10000
-
-for page in range(total_pages):
- data = ingestor.ingest_table(
- "LARGE_TABLE",
- limit=PAGE_SIZE,
- offset=page * PAGE_SIZE
- )
- process_batch(data)
-```
-
-### 4. Use Query Filters
-
-Push filtering to Snowflake instead of filtering in Python:
-
-**Don't:**
-```python
-# Fetching all rows and filtering in Python (inefficient)
-all_data = ingestor.ingest_table("CUSTOMERS")
-filtered = [row for row in all_data.data if row["COUNTRY"] == "USA"]
-```
-
-**Do:**
-```python
-# Filter in Snowflake (efficient)
-data = ingestor.ingest_table("CUSTOMERS", where="COUNTRY = 'USA'")
-```
-
-### 5. Set Appropriate Warehouse Size
-
-```python
-# Use appropriate warehouse for workload
-ingestor = SnowflakeIngestor(
- account="myaccount",
- user="myuser",
- password="mypassword",
- warehouse="LARGE_WH" # For heavy workloads
-)
-```
-
-### 6. Close Connections
-
-```python
-# Always close connections when done
-try:
- ingestor = SnowflakeIngestor(...)
- data = ingestor.ingest_table("CUSTOMERS")
-finally:
- ingestor.close()
-
-# Or use context manager
-with SnowflakeIngestor(...) as ingestor:
- data = ingestor.ingest_table("CUSTOMERS")
-```
-
-## Examples
-
-### Example 1: ETL Pipeline
-
-```python
-from semantica.ingest import SnowflakeIngestor
-from semantica.pipeline import Pipeline
-
-# Initialize ingestor
-ingestor = SnowflakeIngestor()
-
-# Extract data
-sales_data = ingestor.ingest_query("""
- SELECT
- s.ORDER_ID,
- s.CUSTOMER_ID,
- c.CUSTOMER_NAME,
- s.PRODUCT_ID,
- p.PRODUCT_NAME,
- s.AMOUNT,
- s.ORDER_DATE
- FROM SALES s
- JOIN CUSTOMERS c ON s.CUSTOMER_ID = c.ID
- JOIN PRODUCTS p ON s.PRODUCT_ID = p.ID
- WHERE s.ORDER_DATE >= CURRENT_DATE - 30
-""")
-
-# Transform to documents
-documents = ingestor.export_as_documents(
- sales_data,
- id_field="ORDER_ID",
- text_fields=["CUSTOMER_NAME", "PRODUCT_NAME"]
-)
-
-# Load into Semantica
-pipeline = Pipeline()
-pipeline.process_documents(documents)
-```
-
-### Example 2: Multi-Table Ingestion
-
-```python
-from semantica.ingest import SnowflakeIngestor
-
-ingestor = SnowflakeIngestor()
-
-# Get all tables
-tables = ingestor.list_tables()
-
-# Ingest each table
-for table_name in tables:
- print(f"Ingesting {table_name}...")
-
- # Get schema first
- schema = ingestor.get_table_schema(table_name)
-
- # Ingest with limit
- data = ingestor.ingest_table(table_name, limit=1000)
-
- # Process data
- process_table(table_name, data, schema)
-```
-
-### Example 3: Incremental Loading
-
-```python
-import datetime
-from semantica.ingest import SnowflakeIngestor
-
-ingestor = SnowflakeIngestor()
-
-# Get last load timestamp
-last_load = get_last_load_timestamp() # Your function
-
-# Ingest only new/updated records
-data = ingestor.ingest_table(
- "CUSTOMERS",
- where=f"UPDATED_AT > '{last_load}'",
- order_by="UPDATED_AT ASC"
-)
-
-print(f"Loaded {data.row_count} new/updated records")
-
-# Update last load timestamp
-set_last_load_timestamp(datetime.datetime.now())
-```
-
-## Troubleshooting
-
-### Connection Issues
-
-```python
-# Enable verbose logging
-import logging
-logging.basicConfig(level=logging.DEBUG)
-
-# Test connection
-connector = SnowflakeConnector(
- account="myaccount",
- user="myuser",
- password="mypassword"
-)
-
-if not connector.test_connection():
- print("Connection failed - check credentials and network")
-```
-
-### Large Query Timeouts
-
-```python
-# Use batching for large queries
-data = ingestor.ingest_query(
- "SELECT * FROM VERY_LARGE_TABLE",
- batch_size=10000 # Fetch in batches
-)
-```
-
-### Memory Issues with Large Results
-
-```python
-# Process in chunks instead of loading all at once
-CHUNK_SIZE = 10000
-offset = 0
-
-while True:
- chunk = ingestor.ingest_table(
- "LARGE_TABLE",
- limit=CHUNK_SIZE,
- offset=offset
- )
-
- if chunk.row_count == 0:
- break
-
- process_chunk(chunk)
- offset += CHUNK_SIZE
-```
diff --git a/docs/license.md b/docs/license.md
index f6abe1e1..429a4a32 100644
--- a/docs/license.md
+++ b/docs/license.md
@@ -1,6 +1,6 @@
# License
-Semantica is released under the MIT License.
+**Semantica is open source under the MIT License.**
---
@@ -34,45 +34,52 @@ SOFTWARE.
## What This Means
-### You Can:
-- โ
Use commercially
-- โ
Modify the source code
-- โ
Distribute the software
-- โ
Use in private/proprietary projects
-- โ
Sublicense it
+### โ
You Can
+- **Use commercially** - Free for business use
+- **Modify** - Change the source code
+- **Distribute** - Share with others
+- **Sublicense** - Use in your own projects
+- **Private use** - Use in proprietary software
-### You Must:
-- โ
Include copyright notice
-- โ
Include license text
+### โ
You Must
+- **Include copyright** - Keep the copyright notice
+- **Include license** - Share the MIT license text
-### You Cannot:
-- โ Hold authors liable
-- โ Use authors' names for endorsement
+### โ No Warranty
+- **No liability** - Authors not responsible for damages
+- **No endorsement** - Can't use authors' names for promotion
---
## Commercial Use
-**Semantica is free for commercial use.** No attribution required (though appreciated)!
+**Semantica is completely free for commercial use.** No attribution required (though appreciated!).
---
-## Third-Party Licenses
+## Third-Party Dependencies
-Key dependencies:
-- Python (PSF), NumPy (BSD), Pandas (BSD)
-- spaCy (MIT), Transformers (Apache 2.0), RDFLib (BSD)
-
-See `LICENSE` file for complete list.
+Semantica uses open-source libraries with compatible licenses:
+- **Python** (PSF License)
+- **NumPy, Pandas** (BSD License)
+- **spaCy** (MIT License)
+- **Transformers** (Apache 2.0)
+- **RDFLib** (BSD License)
---
## Contributing
-By contributing, you agree your contributions will be licensed under MIT.
+By contributing to Semantica, you agree that your contributions will be licensed under the same MIT License.
---
-**Questions?** [Open an issue](https://github.com/Hawksight-AI/semantica/issues)
+## Questions?
-**Semantica is 100% open source and free!** ๐
+- **[GitHub Issues](https://github.com/Hawksight-AI/semantica/issues)** - License questions
+- **[Contributing Guide](contributing.md)** - How to contribute
+- **[Community](community.md)** - Get in touch
+
+---
+
+**Semantica is open source and free for everyone!** ๐
diff --git a/docs/modules.md b/docs/modules.md
index 4f676878..23c36801 100644
--- a/docs/modules.md
+++ b/docs/modules.md
@@ -1,1189 +1,740 @@
-# Modules & Architecture
+๏ปฟ# Modules & Architecture
-Semantica is built with a modular architecture, designed to be flexible, extensible, and scalable. This guide provides a comprehensive overview of all modules, their responsibilities, key features, and components.
+**Complete guide to Semantica's modular architecture and how to use each component.**
-!!! info "About This Guide"
- This guide covers all 20+ core modules in Semantica, organized by their functional layer. Each module can be used independently or combined into powerful pipelines.
+!!! tip "Modular Design"
+ Each Semantica module works independently. Use only what you need for your specific use case.
---
-## Module Overview
+## Architecture Overview
-Semantica's modules are organized into six logical layers:
+Semantica is organized into **six logical layers** - each with specific responsibilities:
-| Layer | Modules | Description |
-| :--- | :--- | :--- |
-| **Input Layer** | [Ingest](#ingest-module), [Parse](#parse-module), [Split](#split-module), [Normalize](#normalize-module) | Data ingestion, parsing, chunking, and cleaning |
-| **Core Processing** | [Semantic Extract](#semantic-extract-module), [Knowledge Graph](#knowledge-graph-kg-module), [Ontology](#ontology-module), [Reasoning](#reasoning-module) | Entity extraction, graph construction, inference |
-| **Storage** | [Embeddings](#embeddings-module), [Vector Store](#vector-store-module), [Graph Store](#graph-store-module), [Triplet Store](#triplet-store-module) | Vector, graph, and triplet persistence |
-| **Quality Assurance** | [Deduplication](#deduplication-module), [Conflicts](#conflicts-module) | Data quality and consistency |
-| **Context & Memory** | [Context](#context-module), [Seed](#seed-module), [LLM Providers](#llm-providers-module) | Agent memory, foundation data, and LLM integration |
-| **Output & Orchestration** | [Export](#export-module), [Visualization](#visualization-module), [Pipeline](#pipeline-module) | Export, visualization, and workflow management |
+
+
+- **Input Layer**
+
+ ---
+
+ Data ingestion and preparation
+
+ **Modules**: Ingest, Parse, Split, Normalize
+
+- **Core Processing**
+
+ ---
+
+ Intelligence and understanding
+
+ **Modules**: Semantic Extract, Knowledge Graph, Ontology, Reasoning
+
+- **Storage**
+
+ ---
+
+ Persistent data storage
+
+ **Modules**: Embeddings, Vector Store, Graph Store, Triplet Store
+
+- **Quality Assurance**
+
+ ---
+
+ Data quality and consistency
+
+ **Modules**: Deduplication, Conflicts
+
+- **Context & Memory**
+
+ ---
+
+ Agent memory and foundation data
+
+ **Modules**: Context, Seed, LLM Providers
+
+- **Output & Orchestration**
+
+ ---
+
+ Export, visualization, and workflows
+
+ **Modules**: Export, Visualization, Pipeline
+
+
---
## Input Layer
-These modules handle data ingestion, parsing, chunking, and preparation.
-
----
-
### Ingest Module
+**Data ingestion from multiple sources**
-!!! abstract "Purpose"
- The entry point for data ingestion. Connects to various data sources including files, web, databases, and MCP servers.
+```python
+from semantica.ingest import FileIngestor, WebIngestor
-**Key Features:**
+# File ingestion
+ingestor = FileIngestor()
+documents = ingestor.ingest_directory("data/")
-- Multiple file format support (PDF, DOCX, HTML, JSON, CSV, etc.)
-- Web scraping with JavaScript rendering
-- Database integration (SQL, NoSQL)
-- Real-time streaming support
-- MCP (Model Context Protocol) server integration
-- Batch processing capabilities
-- Metadata extraction and preservation
+# Web ingestion
+web_ingestor = WebIngestor()
+pages = web_ingestor.ingest_urls(["https://example.com"])
+```
-**Components:**
+**What it does:**
+- **File formats** - PDF, DOCX, TXT, JSON, CSV
+- **Web scraping** - Extract content from websites
+- **Database** - Connect to SQL and NoSQL databases
+- **Batch processing** - Handle large datasets efficiently
-- `FileIngestor` โ Read files (PDF, DOCX, HTML, JSON, CSV, etc.)
-- `WebIngestor` โ Scrape and ingest web pages
-- `FeedIngestor` โ Process RSS/Atom feeds
-- `StreamIngestor` โ Real-time data streaming
-- `DBIngestor` โ Database queries and ingestion
-- `EmailIngestor` โ Process email messages
-- `RepoIngestor` โ Git repository analysis
-- `MCPIngestor` โ Connect to MCP servers for resource and tool-based ingestion
-
-**Try It:**
-
-- **[Data Ingestion Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/02_Data_Ingestion.ipynb)**: Learn to ingest from multiple sources
- - **Topics**: File, web, feed, stream, database ingestion
- - **Difficulty**: Beginner
- - **Time**: 15-20 minutes
- - **Use Cases**: Loading data from various sources
-
-**API Reference**: [Ingest Module](reference/ingest.md)
-
----
+**Use Cases:**
+- Document processing pipelines
+- Web data extraction
+- Database integration
+- Multi-source data collection
### Parse Module
+**Document parsing and text extraction**
-!!! abstract "Purpose"
- Extracts raw text and metadata from ingested documents. Supports OCR, table extraction, and structured data parsing.
+```python
+from semantica.parse import DocumentParser
-**Key Features:**
+parser = DocumentParser()
+parsed = parser.parse_document("document.pdf")
+text = parsed["full_text"]
+metadata = parsed["metadata"]
+```
-- Multiple file format support
-- OCR for images and scanned documents
-- Table extraction from PDFs and spreadsheets
-- Metadata preservation
-- Automatic format detection
-- Structured data parsing (JSON, CSV, XML)
-- Code file parsing with syntax awareness
+**What it does:**
+- **Text extraction** - Extract clean text from documents
+- **Metadata parsing** - Extract titles, authors, dates
+- **Structure analysis** - Identify sections, headings
+- **OCR support** - Handle scanned documents
-**Components:**
-
-- `DocumentParser` โ Main parser orchestrator
-- `PDFParser` โ Extract text, tables, images from PDFs
-- `DOCXParser` โ Parse Word documents
-- `HTMLParser` โ Extract content from HTML
-- `JSONParser` โ Parse structured JSON data
-- `ExcelParser` โ Process spreadsheets
-- `ImageParser` โ OCR and image analysis
-- `CodeParser` โ Parse source code files
-
-**Try It:**
-
-- **[Document Parsing Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/03_Document_Parsing.ipynb)**: Learn to parse various document formats
- - **Topics**: PDF, DOCX, HTML, JSON parsing, OCR, table extraction
- - **Difficulty**: Beginner
- - **Time**: 15-20 minutes
- - **Use Cases**: Extracting text from different file formats
-
-**API Reference**: [Parse Module](reference/parse.md)
+**Use Cases:**
+- PDF processing
+- Document analysis
+- Content extraction
+- Metadata harvesting
---
### Split Module
+**Text chunking and segmentation**
-!!! abstract "Purpose"
- Comprehensive document chunking and splitting for optimal processing. Provides 15+ splitting methods including KG-aware chunking.
+```python
+from semantica.split import TextSplitter
-**Key Features:**
+splitter = TextSplitter(method="semantic")
+chunks = splitter.split(text, chunk_size=1000, overlap=200)
+```
-- Multiple standard splitting methods (recursive, token, sentence, paragraph)
-- Semantic-based chunking using NLP and embeddings
-- Entity-aware chunking for GraphRAG workflows
-- Relation-aware chunking for KG preservation
-- Graph-based and ontology-aware chunking
-- Hierarchical multi-level chunking
-- Community detection-based splitting
-- Sliding window chunking with overlap
-- Table-specific chunking
-- Chunk validation and quality assessment
-- Provenance tracking for data lineage
+**What it does:**
+- **Intelligent chunking** - Split text while preserving context
+- **Semantic splitting** - Break at natural boundaries
+- **Size control** - Manage chunk sizes for processing
+- **Overlap handling** - Maintain context between chunks
-**Components:**
-
-- `TextSplitter` โ Unified text splitter with method parameter
-- `SemanticChunker` โ Semantic-based chunking coordinator
-- `StructuralChunker` โ Structure-aware chunking (headings, lists)
-- `SlidingWindowChunker` โ Fixed-size sliding window chunking
-- `TableChunker` โ Table-specific chunking
-- `EntityAwareChunker` โ Entity boundary-preserving chunker
-- `RelationAwareChunker` โ Triplet-preserving chunker
-- `GraphBasedChunker` โ Graph structure-based chunker
-- `OntologyAwareChunker` โ Ontology concept-based chunker
-- `HierarchicalChunker` โ Multi-level hierarchical chunker
-- `ChunkValidator` โ Chunk quality validation
-- `ProvenanceTracker` โ Chunk provenance tracking
-
-**Supported Methods:**
-
-| Category | Methods |
-| :--- | :--- |
-| **Standard** | recursive, token, sentence, paragraph, character, word, semantic_transformer, llm |
-| **KG/Ontology** | entity_aware, relation_aware, graph_based, ontology_aware, hierarchical, community_detection, centrality_based |
-
-**Try It:**
-
-- **[Text Splitting Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/04_Data_Normalization.ipynb)**: Learn different splitting methods
- - **Topics**: Recursive, token, sentence splitting, entity-aware chunking
- - **Difficulty**: Beginner
- - **Time**: 15-20 minutes
- - **Use Cases**: Document chunking for processing
+**Use Cases:**
+- Document preprocessing
+- Embedding preparation
+- RAG systems
+- Large document processing
---
### Normalize Module
+**Data cleaning and standardization**
-!!! abstract "Purpose"
- Cleans, standardizes, and prepares text for semantic extraction. Handles encoding, entity names, dates, and numbers.
+```python
+from semantica.normalize import DataNormalizer
-**Key Features:**
+normalizer = DataNormalizer()
+clean_text = normalizer.normalize_text(text)
+standardized_date = normalizer.normalize_date("Jan 1st, 2020")
+```
-- Text cleaning and noise removal
-- Encoding normalization (Unicode handling)
-- Entity name standardization
-- Date and number formatting
-- Language detection
-- Whitespace normalization
-- Special character handling
+**What it does:**
+- **Text cleaning** - Remove noise and artifacts
+- **Date standardization** - Convert to ISO format
+- **Name normalization** - Standardize person names
+- **Entity normalization** - Clean up company names
-**Components:**
-
-- `TextNormalizer` โ Main normalization orchestrator
-- `TextCleaner` โ Remove noise, fix encoding
-- `DataCleaner` โ Clean structured data
-- `EntityNormalizer` โ Normalize entity names
-- `DateNormalizer` โ Standardize date formats
-- `NumberNormalizer` โ Normalize numeric values
-- `LanguageDetector` โ Detect document language
-- `EncodingHandler` โ Handle character encoding
-
-**Try It:**
-
-- **[Data Normalization Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/04_Data_Normalization.ipynb)**: Learn text normalization
- - **Topics**: Text cleaning, encoding normalization, entity standardization
- - **Difficulty**: Beginner
- - **Time**: 15-20 minutes
- - **Use Cases**: Preparing text for processing
-
-**API Reference**: [Normalize Module](reference/normalize.md)
+**Use Cases:**
+- Data preprocessing
+- Quality improvement
+- Standardization
+- Consistency enforcement
---
-## Core Processing Layer
-
-These modules form the intelligence coreโextracting meaning, building relationships, and inferring knowledge.
-
----
+## Core Processing
### Semantic Extract Module
+**Entity and relationship extraction**
-!!! abstract "Purpose"
- The brain of Semantica. Uses LLMs and NLP to extract entities, relationships, and semantic meaning from text.
-
-**Key Features:**
-
-- Multiple NER methods (rule-based, ML, LLM)
-- Relationship extraction with confidence scoring
-- Event extraction
-- Custom entity type support
-- Multi-language support
-- Semantic network extraction
-- Coreference resolution
-- **Auto-chunking**: Automatic text splitting for long documents
-- **Robust Error Handling**: Standardized LLM provider diagnostics and retry logic
-
-**Components:**
-
-- `NERExtractor` โ Named Entity Recognition
-- `RelationExtractor` โ Extract relationships between entities
-- `SemanticAnalyzer` โ Deep semantic analysis
-- `SemanticNetworkExtractor` โ Extract semantic networks
-- `EventExtractor` โ Extract events from text
-- `CoreferenceResolver` โ Resolve entity coreferences
-
-**Try It:**
-
-- **[Entity Extraction Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/05_Entity_Extraction.ipynb)**: Learn entity extraction
- - **Topics**: Named entity recognition, entity types, extraction methods
- - **Difficulty**: Beginner
- - **Time**: 15-20 minutes
- - **Use Cases**: Understanding entity extraction
-
-- **[Relation Extraction Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/06_Relation_Extraction.ipynb)**: Learn relationship extraction
- - **Topics**: Relationship extraction, dependency parsing, semantic role labeling
- - **Difficulty**: Beginner
- - **Time**: 15-20 minutes
- - **Use Cases**: Building rich knowledge graphs
-
-**Quick Example:**
```python
from semantica.semantic_extract import NERExtractor, RelationExtractor
-# Extract entities
-extractor = NERExtractor(method="llm", model="gpt-4")
-entities = extractor.extract(normalized_docs)
+# Entity extraction
+ner = NERExtractor()
+entities = ner.extract("Apple Inc. was founded by Steve Jobs.")
-# Extract relationships
-relation_extractor = RelationExtractor()
-relationships = relation_extractor.extract(normalized_docs, entities=entities)
-
-for rel in relationships[:5]:
- print(f"{rel.subject.text} --[{rel.predicate}]--> {rel.object.text}")
+# Relationship extraction
+rel_extractor = RelationExtractor()
+relationships = rel_extractor.extract(text, entities)
```
-**API Reference**: [Semantic Extract Module](reference/semantic_extract.md)
+**What it does:**
+- **Named Entity Recognition** - Find people, orgs, locations
+- **Relationship extraction** - Find connections between entities
+- **Custom entities** - Define your own entity types
+- **Confidence scoring** - Quality assessment for extractions
+
+**Use Cases:**
+- Knowledge graph construction
+- Document analysis
+- Information extraction
+- Content understanding
---
-### Knowledge Graph (KG) Module
-
-!!! abstract "Purpose"
- Constructs and manages knowledge graphs from extracted entities and relationships. Supports multiple backends and advanced analytics.
-
-**Key Features:**
-
-- Graph construction from entities/relationships
-- Multiple backend support (NetworkX, Neo4j)
-- Temporal graph support
-- Graph analytics and metrics
-- Entity resolution and deduplication
-- Community detection
-- Centrality calculations
-- Path finding algorithms
-- Graph validation
-
-**Components:**
-
-- `GraphBuilder` โ Construct knowledge graphs
-- `GraphAnalyzer` โ Analyze graph structure and properties
-- `EntityResolver` โ Resolve entity conflicts and duplicates
-- `ConflictDetector` โ Detect conflicting information
-- `CentralityCalculator` โ Calculate node importance metrics
-- `CommunityDetector` โ Detect community structure
-- `ConnectivityAnalyzer` โ Analyze graph connectivity
-- `SeedManager` โ Manage seed data for KG initialization
-- `TemporalQuery` โ Query temporal knowledge graphs
-- `Deduplicator` โ Remove duplicate entities/relationships
-
-**Quick Example:**
+### Knowledge Graph Module
+**Graph construction and management**
```python
from semantica.kg import GraphBuilder, GraphAnalyzer
# Build graph
-builder = GraphBuilder(backend="networkx", temporal=True)
-kg = builder.build(entities, relationships)
+builder = GraphBuilder()
+kg = builder.build({"entities": entities, "relationships": relationships})
# Analyze graph
analyzer = GraphAnalyzer()
-metrics = analyzer.analyze(kg)
-
-print(f"Nodes: {metrics['nodes']}, Edges: {metrics['edges']}")
-print(f"Density: {metrics['density']:.3f}")
+stats = analyzer.analyze(kg)
```
-**API Reference**: [Knowledge Graph Module](reference/kg.md)
+**What it does:**
+- **Graph construction** - Build knowledge graphs from data
+- **Graph analysis** - Calculate metrics and statistics
+- **Graph querying** - Search and retrieve information
+- **Graph manipulation** - Merge, split, transform graphs
+
+**Use Cases:**
+- Knowledge base creation
+- Graph analytics
+- Information retrieval
+- Data integration
---
### Ontology Module
-
-!!! abstract "Purpose"
- Defines schema and structure for your knowledge domain. Generates and validates ontologies with OWL/RDF export.
-
-**Key Features:**
-
-- Automatic ontology generation (6-stage pipeline)
-- OWL/RDF/Turtle export
-- Class and property inference
-- Ontology validation
-- Symbolic reasoning (HermiT, Pellet)
-- Version management
-- SHACL constraint support
-- Ontology merging and alignment
-
-**Components:**
-
-- `OntologyGenerator` โ Generate ontologies from knowledge graphs
-- `OntologyValidator` โ Validate ontologies
-- `OWLGenerator` โ Generate OWL format ontologies
-- `PropertyGenerator` โ Generate ontology properties
-- `ClassInferrer` โ Infer ontology classes
-- `OntologyMerger` โ Merge multiple ontologies
-- `ReasonerInterface` โ Interface with symbolic reasoners
-
-**Quick Example:**
+**Schema definition and validation**
```python
-from semantica.ontology import OntologyEngine
+from semantica.ontology import OntologyManager
-# Initialize engine
-engine = OntologyEngine(base_uri="https://example.org/ontology/")
+# Define ontology
+ontology = OntologyManager()
+ontology.add_class("Person", ["name", "birth_date"])
+ontology.add_relationship("works_for", "Person", "Organization")
-# Generate ontology from data
-ontology = engine.from_data({
- "entities": [...],
- "relationships": [...]
-})
-
-# Validate ontology
-result = engine.validate(ontology)
-if result.valid:
- print("Ontology is valid!")
-
-# Export to OWL
-owl_content = engine.to_owl(ontology, format="turtle")
-print(f"Generated {len(owl_content)} lines of OWL")
+# Validate data
+is_valid = ontology.validate_graph(kg)
```
-**API Reference**: [Ontology Module](reference/ontology.md)
+**What it does:**
+- **Schema definition** - Define data structure
+- **Data validation** - Ensure data conforms to schema
+- **Inheritance** - Create hierarchical relationships
+- **Constraints** - Enforce data quality rules
+
+**Use Cases:**
+- Data modeling
+- Quality assurance
+- Schema management
+- Rule enforcement
---
### Reasoning Module
-
-!!! abstract "Purpose"
- Infers new facts and validates existing knowledge using logical rules. Supports forward-chaining, high-performance pattern matching, and explanation generation.
-
-**Key Features:**
-
-- Forward-chaining inference engine
-- IF-THEN rule support with variable substitution
-- High-performance Rete algorithm for large-scale rule matching
-- Natural language explanation generation for inferred facts
-- SPARQL query expansion for RDF graphs
-- Conflict detection in inferences
-- Priority-based rule execution
-
-**Components:**
-
-- `Reasoner` โ High-level facade for all reasoning tasks
-- `ReteEngine` โ High-performance pattern matching (Rete algorithm)
-- `ExplanationGenerator` โ Generate justifications for inferred facts
-- `SPARQLReasoner` โ Query expansion for triplet stores
-
-**Quick Example:**
+**Logical inference and deduction**
```python
-from semantica.reasoning import Reasoner
+from semantica.reasoning import ReasoningEngine
-reasoner = Reasoner()
-
-# Add rules and facts
-reasoner.add_rule("IF Person(?x) AND Parent(?x, ?y) THEN ParentOfPerson(?x, ?y)")
-reasoner.add_fact("Person(Alice)")
-reasoner.add_fact("Parent(Alice, Bob)")
-
-# Perform inference
-inferred = reasoner.infer_facts(["Person(Alice)", "Parent(Alice, Bob)"])
-# Inferred: ["ParentOfPerson(Alice, Bob)"]
+engine = ReasoningEngine()
+inferences = engine.infer(kg, rules=["transitivity", "symmetry"])
```
-**API Reference**: [Reasoning Module](reference/reasoning.md)
+**What it does:**
+- **Logical inference** - Derive new facts from existing ones
+- **Pattern matching** - Find complex patterns in data
+- **Consistency checking** - Detect contradictions
+- **Decision support** - Automated reasoning
+
+**Use Cases:**
+- Knowledge discovery
+- Decision making
+- Consistency checking
+- Advanced analytics
---
## Storage Layer
-These modules handle persistence and retrieval of vectors, graphs, and triplets.
-
----
-
### Embeddings Module
-
-!!! abstract "Purpose"
- Generates vector embeddings for text, images, and audio. Supports multiple providers with caching and batch processing.
-
-**Key Features:**
-
-- Multiple provider support (OpenAI, Cohere, HuggingFace, Sentence Transformers)
-- Text, image, and audio embeddings
-- Multimodal embeddings
-- Batch processing
-- Caching support
-- Custom models
-- Similarity calculations
-
-**Components:**
-
-- `EmbeddingGenerator` โ Main embedding orchestrator
-- `TextEmbedder` โ Generate text embeddings
-- `ImageEmbedder` โ Generate image embeddings
-- `AudioEmbedder` โ Generate audio embeddings
-- `MultimodalEmbedder` โ Combine multiple modalities
-- `EmbeddingOptimizer` โ Optimize embedding quality
-- `ProviderStores` โ Support for OpenAI, Cohere, etc.
-
-**Quick Example:**
+**Vector embeddings and similarity**
```python
from semantica.embeddings import EmbeddingGenerator
-generator = EmbeddingGenerator(
- provider="openai",
- model="text-embedding-3-small"
-)
-embeddings = generator.generate(documents)
-
-# Calculate similarity
+generator = EmbeddingGenerator(model="sentence-transformers")
+embeddings = generator.generate(["text1", "text2"])
similarity = generator.similarity(embeddings[0], embeddings[1])
-print(f"Similarity: {similarity:.3f}")
```
-**API Reference**: [Embeddings Module](reference/embeddings.md)
+**What it does:**
+- **Text embeddings** - Convert text to vectors
+- **Similarity search** - Find similar content
+- **Clustering** - Group related items
+- **AI integration** - Provide context to LLMs
+
+**Use Cases:**
+- Semantic search
+- Recommendation systems
+- Clustering
+- AI context
---
### Vector Store Module
-
-!!! abstract "Purpose"
- Manages storage and retrieval of high-dimensional vectors. Supports hybrid search combining vector and keyword search.
-
-**Key Features:**
-
-- Multiple backend support (FAISS, Weaviate, Qdrant, Milvus)
-- Hybrid search (vector + keyword)
-- Metadata filtering
-- Batch operations
-- Similarity search with scoring
-- Index management
-- Namespace support
-
-**Components:**
-
-- `VectorStore` โ Main vector store interface
-- `FAISSStore` โ FAISS integration
-- `WeaviateStore` โ Weaviate integration
-- `HybridSearch` โ Combine vector and keyword search
-- `VectorRetriever` โ Retrieve relevant vectors
-
-**Quick Example:**
+**Vector database management**
```python
-from semantica.vector_store import VectorStore, HybridSearch
+from semantica.vector_store import VectorStore
-vector_store = VectorStore(backend="faiss")
-vector_store.store(embeddings, documents, metadata)
-
-# Hybrid search
-hybrid_search = HybridSearch(vector_store)
-results = hybrid_search.search(
- query="machine learning",
- top_k=10,
- filters={"category": "AI"}
-)
+store = VectorStore(backend="faiss")
+store.add_vectors(embeddings, ids)
+results = store.search(query_vector, top_k=10)
```
-**API Reference**: [Vector Store Module](reference/vector_store.md)
+**What it does:**
+- **Vector storage** - Efficient vector database
+- **Fast search** - Approximate nearest neighbor search
+- **Indexing** - Optimize for performance
+- **Batch operations** - Handle large datasets
+
+**Use Cases:**
+- Semantic search
+- RAG systems
+- Recommendation engines
+- Similarity matching
---
### Graph Store Module
-
-!!! abstract "Purpose"
- Integration with property graph databases for storing and querying knowledge graphs.
-
-**Key Features:**
-
-- Multiple backend support (Neo4j, FalkorDB)
-- Cypher query language
-- Graph algorithms and analytics
-- Transaction support
-- Index management
-- High-performance queries
-- Batch operations
-
-**Components:**
-
-- `GraphStore` โ Main graph store interface
-- `Neo4jStore` โ Neo4j database integration
-- `FalkorDBStore` โ FalkorDB (Redis-based) integration
-- `NodeManager` โ Node CRUD operations
-- `RelationshipManager` โ Relationship CRUD operations
-- `QueryEngine` โ Cypher query execution
-- `GraphAnalytics` โ Graph algorithms and analytics
-
-**Quick Example:**
+**Graph database integration**
```python
from semantica.graph_store import GraphStore
-store = GraphStore(backend="neo4j", uri="bolt://localhost:7687")
-store.connect()
-
-# Create nodes and relationships
-alice = store.create_node(
- labels=["Person"],
- properties={"name": "Alice", "age": 30}
-)
-bob = store.create_node(
- labels=["Person"],
- properties={"name": "Bob", "age": 25}
-)
-store.create_relationship(
- start_node_id=alice["id"],
- end_node_id=bob["id"],
- rel_type="KNOWS",
- properties={"since": 2020}
-)
-
-# Query with Cypher
-results = store.execute_query("MATCH (p:Person) RETURN p.name")
+store = GraphStore(backend="neo4j")
+store.add_nodes(entities)
+store.add_edges(relationships)
+results = store.query("MATCH (n)-[r]->(m) RETURN n, r, m")
```
-**API Reference**: [Graph Store Module](reference/graph_store.md)
+**What it does:**
+- **Graph persistence** - Store graphs in databases
+- **Graph queries** - Cypher and Gremlin support
+- **Graph algorithms** - Path finding, centrality
+- **Transactions** - ACID compliance
+
+**Use Cases:**
+- Knowledge graph storage
+- Graph analytics
+- Network analysis
+- Relationship queries
---
### Triplet Store Module
-
-!!! abstract "Purpose"
- RDF triplet store integration for semantic web applications. Supports SPARQL queries and multiple backends.
-
-**Key Features:**
-
-- Multi-backend support (Blazegraph, Jena, RDF4J)
-- CRUD operations for RDF triplets
-- SPARQL query execution and optimization
-- Bulk data loading with progress tracking
-- Query caching and optimization
-- Transaction support
-- Store backend pattern
-
-**Components:**
-
-- `TripletStore` โ Main triplet store interface
-- `QueryEngine` โ SPARQL query execution and optimization
-- `BulkLoader` โ High-volume data loading with progress tracking
-- `BlazegraphStore` โ Blazegraph integration
-- `JenaStore` โ Apache Jena integration
-- `RDF4JStore` โ Eclipse RDF4J integration
-- `QueryPlan` โ Query execution plan dataclass
-- `LoadProgress` โ Bulk loading progress tracking
-
-**Algorithms:**
-
-| Category | Algorithms |
-| :--- | :--- |
-| **Query Optimization** | Cost estimation, query rewriting, LIMIT injection |
-| **Caching** | MD5-based cache keys, LRU eviction |
-| **Bulk Loading** | Batch processing, retry with exponential backoff |
-
-**Quick Example:**
+**Triple-based storage**
```python
from semantica.triplet_store import TripletStore
-store = TripletStore(backend="blazegraph", endpoint="http://localhost:9999/blazegraph")
-
-# Add triplet
-result = store.add_triplet({
- "subject": "http://example.org/Alice",
- "predicate": "http://example.org/knows",
- "object": "http://example.org/Bob"
-})
-
-# Execute SPARQL
-query_result = store.execute_query("SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10")
+store = TripletStore()
+store.add_triplets(subject, predicate, object)
+triplets = store.get_triplets(entity="Apple Inc.")
```
-**API Reference**: [Triplet Store Module](reference/triplet_store.md)
+**What it does:**
+- **Triple storage** - Store (subject, predicate, object) triples
+- **Pattern matching** - Find specific patterns
+- **RDF support** - Semantic web standards
+- **Bulk operations** - Efficient batch processing
+
+**Use Cases:**
+- Semantic web
+- Knowledge representation
+- Linked data
+- Triple stores
---
-## Quality Assurance Layer
-
-These modules ensure data quality, handle duplicates, and resolve conflicts.
-
----
+## Quality Assurance
### Deduplication Module
-
-!!! abstract "Purpose"
- Comprehensive entity deduplication and merging. Detects duplicates using multiple similarity methods and merges them intelligently.
-
-**Key Features:**
-
-- Multiple similarity methods (exact, Levenshtein, Jaro-Winkler, cosine, embedding)
-- **Advanced String Matching**: Jaro-Winkler by default for better company/person name resolution
-- **Smart Property Handling**: Neutral scoring for disjoint properties to prevent false negatives
-- Duplicate detection with confidence scoring
-- Entity merging with configurable strategies
-- Cluster-based batch deduplication
-- Provenance preservation during merges
-- Relationship preservation
-- Incremental processing support
-
-**Components:**
-
-- `DuplicateDetector` โ Detects duplicate entities using similarity metrics
-- `EntityMerger` โ Merges duplicate entities using configurable strategies
-- `SimilarityCalculator` โ Multi-factor similarity between entities
-- `MergeStrategyManager` โ Manages merge strategies and conflict resolution
-- `ClusterBuilder` โ Builds clusters for batch deduplication
-
-**Merge Strategies:**
-
-| Strategy | Description |
-| :--- | :--- |
-| `"keep_first"` | Preserve first entity, merge others |
-| `"keep_last"` | Preserve last entity, merge others |
-| `"keep_most_complete"` | Preserve entity with most properties |
-| `"keep_highest_confidence"` | Preserve entity with highest confidence |
-| `"merge_all"` | Combine all properties and relationships |
-
-**Quick Example:**
+**Entity deduplication and resolution**
```python
-from semantica.deduplication import DuplicateDetector, EntityMerger
+from semantica.deduplication import EntityResolver
-# Detect duplicates
-detector = DuplicateDetector(similarity_threshold=0.8)
-duplicate_groups = detector.detect_duplicate_groups(entities)
-
-# Merge duplicates
-merger = EntityMerger(preserve_provenance=True)
-merge_operations = merger.merge_duplicates(
- entities,
- strategy="keep_most_complete"
-)
-
-merged_entities = [op.merged_entity for op in merge_operations]
-print(f"Reduced from {len(entities)} to {len(merged_entities)} entities")
+resolver = EntityResolver()
+merged_entities = resolver.resolve(entities, strategy="semantic")
```
+**What it does:**
+- **Duplicate detection** - Find similar entities
+- **Entity resolution** - Merge duplicate records
+- **Similarity scoring** - Quality assessment
+- **Record linkage** - Connect related records
+
+**Use Cases:**
+- Data cleaning
+- Master data management
+- Record linkage
+- Quality improvement
+
---
### Conflicts Module
-
-!!! abstract "Purpose"
- Detects and resolves conflicts from multiple data sources. Provides investigation guides and source tracking.
-
-**Key Features:**
-
-- Multi-source conflict detection (value, type, relationship, temporal, logical)
-- Source tracking and provenance management
-- Conflict analysis and pattern identification
-- Multiple resolution strategies (voting, credibility-weighted, recency)
-- Investigation guide generation
-- Source credibility scoring
-- Conflict reporting and statistics
-
-**Components:**
-
-- `ConflictDetector` โ Detects conflicts from multiple sources
-- `ConflictResolver` โ Resolves conflicts using various strategies
-- `ConflictAnalyzer` โ Analyzes conflict patterns and trends
-- `SourceTracker` โ Tracks source information and provenance
-- `InvestigationGuideGenerator` โ Generates investigation guides
-
-**Resolution Strategies:**
-
-| Strategy | Algorithm |
-| :--- | :--- |
-| **Voting** | Majority value selection using frequency counting |
-| **Credibility Weighted** | Weighted average using source credibility scores |
-| **Temporal Selection** | Newest/oldest value based on timestamps |
-| **Confidence Selection** | Maximum confidence value selection |
-
-**Quick Example:**
+**Conflict detection and resolution**
```python
-from semantica.conflicts import ConflictDetector, ConflictResolver
+from semantica.conflicts import ConflictDetector
detector = ConflictDetector()
-conflicts = detector.detect_value_conflicts(entities, "name")
-
-resolver = ConflictResolver()
-results = resolver.resolve_conflicts(conflicts, strategy="voting")
+conflicts = detector.detect_conflicts(kg)
+resolved = detector.resolve(conflicts, strategy="most_recent")
```
----
+**What it does:**
+- **Conflict detection** - Find contradictory information
+- **Resolution strategies** - Automated conflict resolution
+- **Source reliability** - Trustworthiness assessment
+- **Temporal analysis** - Time-based conflict handling
-### KG Quality Assurance Module
-
-!!! abstract "Purpose"
- Comprehensive quality assessment, validation, and automated fixes for knowledge graphs.
-
-**Key Features:**
-
-- Quality metrics calculation (overall, completeness, consistency)
-- Consistency checking (logical, temporal, hierarchical)
-- Completeness validation (entity, relationship, property)
-- Automated fixes (duplicates, inconsistencies, missing properties)
-- Quality reporting with issue tracking
-- Validation engine with rules and constraints
-- Improvement suggestions
-
-**Components:**
-
-- `KGQualityAssessor` โ Overall quality assessment coordinator
-- `ConsistencyChecker` โ Consistency validation engine
-- `CompletenessValidator` โ Completeness validation engine
-- `QualityMetrics` โ Quality metrics calculator
-- `ValidationEngine` โ Rule and constraint validation
-- `RuleValidator` โ Rule-based validation
-- `ConstraintValidator` โ Constraint-based validation
-- `QualityReporter` โ Quality report generation
-- `IssueTracker` โ Issue tracking and management
-- `ImprovementSuggestions` โ Improvement suggestions generator
-- `AutomatedFixer` โ Automated issue fixing
-- `AutoMerger` โ Automatic merging of duplicates
-- `AutoResolver` โ Automatic conflict resolution
-
-Note: The KG quality assessment module has been temporarily removed and will be reintroduced in a future release.
+**Use Cases:**
+- Data quality
+- Consistency checking
+- Trust management
+- Conflict resolution
---
-## Context & Memory Layer
-
-These modules provide context engineering for agents and foundation data management.
-
----
+## Context & Memory
### Context Module
-
-!!! abstract "Purpose"
- Context engineering infrastructure for agents. Formalizes context as a graph of connections with RAG-enhanced memory. Features GraphRAG with multi-hop reasoning and LLM-generated responses.
-
-**Key Features:**
-
-- Context graph construction from entities, relationships, and conversations
-- Agent memory management with RAG integration
-- Entity linking across sources with URI assignment
-- Hybrid context retrieval (vector + graph + memory)
-- **Multi-hop reasoning** through knowledge graphs
-- **LLM-generated responses** grounded in graph context
-- **Reasoning trace** showing entity relationship paths
-- Conversation history management
-- Context accumulation and synthesis
-- Graph-based context traversal
-
-**Components:**
-
-- `ContextGraph` โ In-memory context graph store and builder methods
-- `ContextNode` โ Context graph node data structure
-- `ContextEdge` โ Context graph edge data structure
-- `AgentMemory` โ Manages persistent agent memory with RAG
-- `AgentContext` โ High-level context interface with GraphRAG capabilities
-- `ContextRetriever` โ Retrieves relevant context with multi-hop reasoning
-- `MemoryItem` โ Memory item data structure
-- `EntityLinker` โ Links entities across sources with URI assignment
-
-**Algorithms:**
-
-| Category | Algorithms |
-| :--- | :--- |
-| **Graph Construction** | BFS/DFS traversal, type-based indexing |
-| **Memory Management** | Vector embedding, similarity search, retention policies |
-| **Context Retrieval** | Vector similarity, multi-hop graph expansion, hybrid scoring |
-| **Multi-Hop Reasoning** | BFS traversal up to N hops, reasoning path construction |
-| **LLM Integration** | Prompt engineering with context and reasoning paths |
-| **Entity Linking** | Hash-based URI generation, text similarity matching |
-
-**Quick Example:**
+**Context management for AI agents**
```python
-from semantica.context import AgentContext, ContextGraph, AgentMemory
-from semantica.llms import Groq
-from semantica.vector_store import VectorStore
-import os
+from semantica.context import ContextManager
-# Using AgentContext with GraphRAG reasoning
-context = AgentContext(
- vector_store=VectorStore(backend="faiss"),
- knowledge_graph=kg
-)
-
-# Configure LLM provider
-llm_provider = Groq(
- model="llama-3.1-8b-instant",
- api_key=os.getenv("GROQ_API_KEY")
-)
-
-# Query with multi-hop reasoning and LLM-generated response
-result = context.query_with_reasoning(
- query="What IPs are associated with security alerts?",
- llm_provider=llm_provider,
- max_results=10,
- max_hops=2
-)
-
-print(f"Response: {result['response']}")
-print(f"Reasoning Path: {result['reasoning_path']}")
-print(f"Confidence: {result['confidence']:.3f}")
-
-# Traditional context graph and memory
-graph = ContextGraph()
-graph_data = graph.build_from_entities_and_relationships(entities, relationships)
-
-memory = AgentMemory(vector_store=vs, knowledge_graph=kg)
-memory_id = memory.store("User asked about Python", metadata={"type": "conversation"})
-results = memory.retrieve("Python", max_results=5)
+manager = ContextManager()
+context = manager.get_context(query, history)
```
-**API Reference**: [Context Module](reference/context.md)
+**What it does:**
+- **Context tracking** - Maintain conversation context
+- **Memory management** - Store and retrieve context
+- **Relevance scoring** - Find relevant context
+- **Session management** - Handle multiple conversations
----
-
-### LLM Providers Module
-
-!!! abstract "Purpose"
- Unified interface for LLM providers. Supports Groq, OpenAI, HuggingFace, and LiteLLM (100+ LLMs) with clean imports and consistent API.
-
-**Key Features:**
-
-- **Unified Interface**: Same `generate()` and `generate_structured()` methods across all providers
-- **Multiple Providers**: Groq, OpenAI, HuggingFace, and LiteLLM (100+ LLMs)
-- **Clean Imports**: Simple `from semantica.llms import Groq, OpenAI, HuggingFaceLLM, LiteLLM`
-- **Structured Output**: JSON generation support
-- **API Key Management**: Environment variable and direct key support
-- **Error Handling**: Graceful fallback when providers unavailable
-
-**Components:**
-
-- `Groq` โ Groq API provider for fast inference
-- `OpenAI` โ OpenAI API provider (GPT-3.5, GPT-4, etc.)
-- `HuggingFaceLLM` โ HuggingFace Transformers for local LLM inference
-- `LiteLLM` โ Unified interface to 100+ LLM providers (OpenAI, Anthropic, Azure, Bedrock, Vertex AI, etc.)
-
-**Supported Providers via LiteLLM:**
-
-- OpenAI, Anthropic, Groq, Azure, Bedrock, Vertex AI, Cohere, Mistral, and 90+ more
-
-**Quick Example:**
-
-```python
-from semantica.llms import Groq, OpenAI, HuggingFaceLLM, LiteLLM
-import os
-
-# Groq - Fast inference
-groq = Groq(
- model="llama-3.1-8b-instant",
- api_key=os.getenv("GROQ_API_KEY")
-)
-response = groq.generate("What is AI?")
-
-# OpenAI
-openai = OpenAI(
- model="gpt-4",
- api_key=os.getenv("OPENAI_API_KEY")
-)
-response = openai.generate("What is AI?")
-
-# HuggingFace - Local models
-hf = HuggingFaceLLM(model_name="gpt2") # or model="gpt2" for consistency
-response = hf.generate("What is AI?")
-
-# LiteLLM - Unified interface to 100+ LLMs
-litellm = LiteLLM(
- model="openai/gpt-4o", # or "anthropic/claude-sonnet-4-20250514", etc.
- api_key=os.getenv("OPENAI_API_KEY")
-)
-response = litellm.generate("What is AI?")
-
-# Structured output
-structured = groq.generate_structured("Extract entities from: Apple Inc. was founded by Steve Jobs.")
-```
-
-**API Reference**: [LLM Providers Module](reference/llms.md)
+**Use Cases:**
+- AI agents
+- Chatbots
+- Conversational AI
+- Context-aware systems
---
### Seed Module
-
-!!! abstract "Purpose"
- Seed data management for initial knowledge graph construction. Builds on verified knowledge from multiple sources.
-
-**Key Features:**
-
-- Multi-source seed data loading (CSV, JSON, Database, API)
-- Foundation graph creation from seed data
-- Seed data quality validation
-- Integration with extracted data using configurable merge strategies
-- Version management for seed sources
-- Export capabilities (JSON, CSV)
-- Schema template validation
-
-**Components:**
-
-- `SeedDataManager` โ Main coordinator for seed data operations
-- `SeedDataSource` โ Seed data source definition
-- `SeedData` โ Seed data container
-
-**Merge Strategies:**
-
-| Strategy | Description |
-| :--- | :--- |
-| `seed_first` | Seed data takes precedence, extracted fills gaps |
-| `extracted_first` | Extracted data takes precedence, seed fills gaps |
-| `merge` | Property merging, seed takes precedence for conflicts |
-
-**Quick Example:**
+**Foundation data and knowledge**
```python
-from semantica.seed import SeedDataManager
+from semantica.seed import SeedData
-manager = SeedDataManager()
-manager.register_source("entities", "json", "data/entities.json")
-foundation = manager.create_foundation_graph()
-validation = manager.validate_quality(foundation)
+seed = SeedData()
+knowledge = seed.get_knowledge("technology", "companies")
```
----
+**What it does:**
+- **Seed knowledge** - Foundation data for domains
+- **Knowledge bases** - Pre-built domain knowledge
+- **Quick start** - Bootstrap applications
+- **Domain models** - Industry-specific data
-## Output & Orchestration Layer
-
-These modules handle export, visualization, and workflow management.
+**Use Cases:**
+- Domain bootstrapping
+- Quick start data
+- Industry knowledge
+- Foundation models
---
+### LLM Providers Module
+**Large Language Model integration**
+
+```python
+from semantica.llms import LLMProvider
+
+provider = LLMProvider(model="gpt-4")
+response = provider.generate(prompt, context=kg)
+```
+
+**What it does:**
+- **LLM integration** - Connect to various LLM providers
+- **Prompt engineering** - Optimize prompts for results
+- **Context injection** - Provide knowledge graph context
+- **Response parsing** - Extract structured outputs
+
+**Use Cases:**
+- AI generation
+- Question answering
+- Text completion
+- Knowledge reasoning
+
+---
+
+## Output & Orchestration
+
### Export Module
-
-!!! abstract "Purpose"
- Export knowledge graphs and data to various formats for use in external tools.
-
-**Key Features:**
-
-- Multiple export formats (JSON, RDF, CSV, OWL, GraphML, GEXF)
-- Custom export formats
-- Batch export
-- Metadata preservation
-- Streaming export for large graphs
-- Vector export support
-
-**Components:**
-
-- `JSONExporter` โ Export to JSON
-- `RDFExporter` โ Export to RDF/XML
-- `CSVExporter` โ Export to CSV
-- `GraphExporter` โ Export to graph formats (GraphML, GEXF)
-- `OWLExporter` โ Export to OWL
-- `VectorExporter` โ Export vectors
-
-**Quick Example:**
+**Data export and serialization**
```python
-from semantica.export import JSONExporter, RDFExporter, CSVExporter
+from semantica.export import GraphExporter
-# Export to multiple formats
-JSONExporter().export(kg, "output.json")
-RDFExporter().export(kg, "output.rdf")
-CSVExporter().export(kg, "output.csv")
+exporter = GraphExporter()
+exporter.export(kg, format="json", filename="output.json")
```
-**API Reference**: [Export Module](reference/export.md)
+**What it does:**
+- **Multiple formats** - JSON, CSV, RDF, GraphML
+- **Database export** - Export to various databases
+- **Streaming** - Handle large datasets
+- **Filtering** - Export specific data subsets
+
+**Use Cases:**
+- Data sharing
+- System integration
+- Backup and restore
+- Format conversion
---
### Visualization Module
-
-!!! abstract "Purpose"
- Visual exploration of knowledge graphs, embeddings, and analytics data.
-
-**Key Features:**
-
-- Interactive graph visualization
-- Embedding visualization (t-SNE, PCA, UMAP)
-- Temporal data visualization
-- Ontology visualization
-- Multiple output formats (HTML, PNG, SVG)
-- Custom styling
-
-**Components:**
-
-- `KGVisualizer` โ Visualize knowledge graphs
-- `EmbeddingVisualizer` โ Visualize embeddings (t-SNE, PCA, UMAP)
-- `AnalyticsVisualizer` โ Visualize graph analytics
-- `TemporalVisualizer` โ Visualize temporal data
-- `OntologyVisualizer` โ Visualize ontology structure
-- `SemanticNetworkVisualizer` โ Visualize semantic networks
-
-**Quick Example:**
+**Graph visualization and analysis**
```python
-from semantica.visualization import KGVisualizer, EmbeddingVisualizer
+from semantica.visualization import GraphVisualizer
-# Visualize knowledge graph
-KGVisualizer().visualize(kg, output_format="html", output_path="graph.html")
-
-# Visualize embeddings
-EmbeddingVisualizer().visualize(embeddings, method="tsne", output_path="embeddings.png")
+visualizer = GraphVisualizer()
+visualizer.plot(kg, layout="force_directed")
```
-**API Reference**: [Visualization Module](reference/visualization.md)
+**What it does:**
+- **Graph visualization** - Interactive graph plots
+- **Custom styling** - Tailored visual appearance
+- **Analytics charts** - Statistics and metrics
+- **Exploration tools** - Interactive data exploration
+
+**Use Cases:**
+- Data exploration
+- Presentation
+- Analysis
+- Reporting
---
### Pipeline Module
-
-!!! abstract "Purpose"
- Orchestrates workflows, connecting modules into robust, executable pipelines.
-
-**Key Features:**
-
-- Pipeline construction DSL
-- Parallel execution
-- Error handling and recovery
-- Resource scheduling
-- Pipeline validation
-- Monitoring and logging
-- Checkpoint support
-
-**Components:**
-
-- `PipelineBuilder` โ Build complex pipelines
-- `ExecutionEngine` โ Execute pipelines
-- `FailureHandler` โ Handle pipeline failures
-- `ParallelismManager` โ Enable parallel processing
-- `ResourceScheduler` โ Schedule resources
-- `PipelineValidator` โ Validate pipeline configuration
-
-**Quick Example:**
+**Workflow orchestration**
```python
-from semantica.pipeline import PipelineBuilder
-from semantica.ingest import FileIngestor
-from semantica.parse import DocumentParser
-from semantica.semantic_extract import NERExtractor
+from semantica.pipeline import Pipeline
-builder = PipelineBuilder()
-pipeline = builder \
- .add_step("ingest", FileIngestor()) \
- .add_step("parse", DocumentParser()) \
- .add_step("extract", NERExtractor()) \
- .build()
-
-result = pipeline.execute(sources=["data/"], parallel=True)
+pipeline = Pipeline()
+pipeline.add_step("ingest", FileIngestor())
+pipeline.add_step("extract", NERExtractor())
+pipeline.add_step("build", GraphBuilder())
+result = pipeline.run("data/")
```
-**API Reference**: [Pipeline Module](reference/pipeline.md)
+**What it does:**
+- **Workflow orchestration** - Coordinate multiple steps
+- **Parallel processing** - Run steps concurrently
+- **Progress tracking** - Monitor pipeline execution
+- **Error handling** - Robust error management
+
+**Use Cases:**
+- Data processing
+- Workflow automation
+- Batch processing
+- System integration
---
-## Integration Patterns
+## New Features & Modules
-### Pattern 1: Complete Knowledge Graph Pipeline
+### Change Management Module
+**Version control and audit trails**
-Build a complete knowledge graph from documents using the full pipeline.
+```python
+from semantica.change_management import TemporalVersionManager
-**For complete examples, see:**
-- **[Your First Knowledge Graph Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/08_Your_First_Knowledge_Graph.ipynb)**: Complete pipeline walkthrough
- - **Topics**: Ingestion, parsing, extraction, graph building, embeddings
- - **Difficulty**: Beginner
- - **Time**: 20-30 minutes
- - **Use Cases**: Learning the complete workflow
+manager = TemporalVersionManager(storage_path="versions.db")
+snapshot = manager.create_snapshot(kg, "v1.0", "user@example.com", "Initial version")
+```
-### Pattern 2: Custom Pipeline with Module Selection
+**What it does:**
+- **Version control** - Track changes over time
+- **Audit trails** - Complete change history
+- **Data integrity** - SHA-256 checksums
+- **Change comparison** - Detailed diff analysis
-Build custom pipelines with specific module selections and quality assurance.
-
-**For examples, see:**
-- **[Building Knowledge Graphs Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/07_Building_Knowledge_Graphs.ipynb)**: Advanced graph construction
- - **Topics**: Custom pipelines, entity merging, conflict resolution
- - **Difficulty**: Intermediate
- - **Time**: 30-45 minutes
- - **Use Cases**: Production graph construction
-
-### Pattern 3: GraphRAG with Hybrid Search
-
-Build GraphRAG systems with hybrid search combining vector and graph retrieval.
-
-**For complete examples, see:**
-- **[GraphRAG Complete Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/use_cases/advanced_rag/01_GraphRAG_Complete.ipynb)**: Production GraphRAG system
- - **Topics**: GraphRAG, hybrid retrieval, graph traversal, LLM integration
- - **Difficulty**: Advanced
- - **Time**: 1-2 hours
- - **Use Cases**: Production RAG applications
-
-### Pattern 4: Temporal Graph with Reasoning
-
-Build temporal graphs with logical reasoning capabilities.
-
-**For examples, see:**
-- **[Temporal Graphs Cookbook](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/advanced/04_Temporal_Graphs.ipynb)**: Temporal graph construction
- - **Topics**: Time-stamped entities, temporal relationships, historical queries
- - **Difficulty**: Intermediate
- - **Time**: 30-45 minutes
- - **Use Cases**: Time-aware knowledge graphs
+**Use Cases:**
+- Knowledge graph versioning
+- Compliance tracking
+- Data governance
+- Change management
---
-## Quick Reference: All Modules
+### Provenance Module
+**W3C PROV-O compliant tracking**
-| Module | Import | Main Class | Purpose |
-| :--- | :--- | :--- | :--- |
-| **Ingest** | `semantica.ingest` | `FileIngestor` | Data ingestion |
-| **Parse** | `semantica.parse` | `DocumentParser` | Document parsing |
-| **Split** | `semantica.split` | `TextSplitter` | Text chunking |
-| **Normalize** | `semantica.normalize` | `TextNormalizer` | Data cleaning |
-| **Semantic Extract** | `semantica.semantic_extract` | `NERExtractor` | Entity extraction |
-| **KG** | `semantica.kg` | `GraphBuilder` | Graph construction |
-| **Ontology** | `semantica.ontology` | `OntologyGenerator` | Ontology generation |
-| **Reasoning** | `semantica.reasoning` | `Reasoner` | Logical inference |
-| **Embeddings** | `semantica.embeddings` | `EmbeddingGenerator` | Vector generation |
-| **Vector Store** | `semantica.vector_store` | `VectorStore` | Vector storage |
-| **Graph Store** | `semantica.graph_store` | `GraphStore` | Graph database |
-| **Triplet Store** | `semantica.triplet_store` | `TripletStore` | RDF storage |
-| **Deduplication** | `semantica.deduplication` | `DuplicateDetector` | Duplicate removal |
-| **Conflicts** | `semantica.conflicts` | `ConflictDetector` | Conflict resolution |
-| **Context** | `semantica.context` | `AgentContext` | Agent context & GraphRAG |
-| **LLM Providers** | `semantica.llms` | `Groq`, `OpenAI`, `HuggingFaceLLM`, `LiteLLM` | LLM integration |
-| **Seed** | `semantica.seed` | `SeedDataManager` | Foundation data |
-| **Export** | `semantica.export` | `JSONExporter` | Data export |
-| **Visualization** | `semantica.visualization` | `KGVisualizer` | Visualization |
-| **Pipeline** | `semantica.pipeline` | `PipelineBuilder` | Workflow orchestration |
+```python
+from semantica.provenance import ProvenanceManager
+
+manager = ProvenanceManager()
+manager.track_entity("entity_1", "document.pdf", "person")
+```
+
+**What it does:**
+- **W3C PROV-O compliant** - Industry standard tracking
+- **Complete lineage** - End-to-end traceability
+- **Source attribution** - Track data origins
+- **Integrity verification** - Tamper detection
+
+**Use Cases:**
+- Regulatory compliance
+- Data provenance
+- Audit trails
+- Source tracking
---
-## Next Steps
+### Core Module
+**Framework orchestration and configuration**
-- **[Core Concepts](concepts.md)** โ Understand the fundamental concepts
-- **[Use Cases](use-cases.md)** โ See real-world applications
-- **[Examples](examples.md)** โ Practical code examples
-- **[Cookbook](cookbook.md)** โ Interactive Jupyter notebook tutorials
-- **[API Reference](reference/core.md)** โ Detailed API documentation
+```python
+from semantica.core import Semantica, Config
-### ๐ณ Recommended Cookbooks
+# Initialize framework
+semantica = Semantica(config=Config())
+result = semantica.process("data/")
+```
-- **[Welcome to Semantica](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/01_Welcome_to_Semantica.ipynb)**: Comprehensive introduction to all modules
- - **Topics**: Framework overview, all modules, architecture
- - **Difficulty**: Beginner
- - **Time**: 30-45 minutes
- - **Use Cases**: Understanding the complete framework
+**What it does:**
+- **Framework orchestration** - Central coordination
+- **Configuration management** - Settings and preferences
+- **Lifecycle management** - Start/stop/restart
+- **Plugin system** - Extensible architecture
-- **[Your First Knowledge Graph](https://github.com/Hawksight-AI/semantica/blob/main/cookbook/introduction/08_Your_First_Knowledge_Graph.ipynb)**: Build your first knowledge graph
- - **Topics**: Complete pipeline from ingestion to graph construction
- - **Difficulty**: Beginner
- - **Time**: 20-30 minutes
- - **Use Cases**: Hands-on practice with all modules
+**Use Cases:**
+- Framework initialization
+- Configuration management
+- Plugin development
+- System orchestration
---
-!!! info "Contribute"
- Found an issue or want to improve this guide? [Contribute on GitHub](https://github.com/Hawksight-AI/semantica)
+## Getting Started
+### Quick Start Example
+
+```python
+# Complete pipeline example
+from semantica.ingest import FileIngestor
+from semantica.semantic_extract import NERExtractor, RelationExtractor
+from semantica.kg import GraphBuilder
+from semantica.pipeline import Pipeline
+
+# Create pipeline
+pipeline = Pipeline()
+pipeline.add_step("ingest", FileIngestor())
+pipeline.add_step("ner", NERExtractor())
+pipeline.add_step("relations", RelationExtractor())
+pipeline.add_step("build", GraphBuilder())
+
+# Run pipeline
+kg = pipeline.run("documents/")
+print(f"Built graph with {len(kg['entities'])} entities")
+```
+
+### Choose Your Modules
+
+**For Document Processing:**
+- Ingest โ Parse โ Split โ Semantic Extract โ Knowledge Graph
+
+**For Web Scraping:**
+- Ingest (Web) โ Normalize โ Semantic Extract โ Graph Store
+
+**For AI Agents:**
+- Context โ LLM Providers โ Reasoning โ Export
+
+**For Analytics:**
+- Knowledge Graph โ Graph Store โ Visualization โ Export
+
+---
+
+## Module Reference
+
+| Module | Purpose | Key Classes | Use Cases |
+|--------|---------|-------------|-----------|
+| [Ingest](reference/ingest.md) | Data ingestion | FileIngestor, WebIngestor | File processing, web scraping |
+| [Parse](reference/parse.md) | Document parsing | DocumentParser | PDF processing, text extraction |
+| [Split](reference/split.md) | Text chunking | TextSplitter | RAG systems, preprocessing |
+| [Normalize](reference/normalize.md) | Data cleaning | DataNormalizer | Quality improvement |
+| [Semantic Extract](reference/semantic_extract.md) | Information extraction | NERExtractor, RelationExtractor | Knowledge graphs |
+| [Knowledge Graph](reference/kg.md) | Graph management | GraphBuilder, GraphAnalyzer | Graph construction |
+| [Ontology](reference/ontology.md) | Schema management | OntologyManager | Data modeling |
+| [Reasoning](reference/reasoning.md) | Logical inference | ReasoningEngine | Knowledge discovery |
+| [Embeddings](reference/embeddings.md) | Vector embeddings | EmbeddingGenerator | Semantic search |
+| [Vector Store](reference/vector_store.md) | Vector database | VectorStore | Similarity search |
+| [Graph Store](reference/graph_store.md) | Graph database | GraphStore | Graph storage |
+| [Triplet Store](reference/triplet_store.md) | Triple storage | TripletStore | Semantic web |
+| [Deduplication](reference/deduplication.md) | Entity resolution | EntityResolver | Data quality |
+| [Conflicts](reference/conflicts.md) | Conflict resolution | ConflictDetector | Consistency |
+| [Context](reference/context.md) | Context management | ContextManager | AI agents |
+| [Seed](reference/seed.md) | Foundation data | SeedData | Domain knowledge |
+| [LLM Providers](reference/llms.md) | LLM integration | LLMProvider | AI generation |
+| [Export](reference/export.md) | Data export | GraphExporter | Data sharing |
+| [Visualization](reference/visualization.md) | Graph visualization | GraphVisualizer | Data exploration |
+| [Pipeline](reference/pipeline.md) | Workflow orchestration | Pipeline | Process automation |
+| [Change Management](reference/change_management.md) | Version control | TemporalVersionManager | Audit trails |
+| [Provenance](reference/provenance.md) | Data lineage | ProvenanceManager | Source tracking |
+| [Core](reference/core.md) | Framework orchestration | Semantica, Config | System management |
+
+---
+
+## Need Help?
+
+- **Documentation**: [Getting Started](getting-started.md)
+- **Examples**: [Cookbook](cookbook.md)
+- **Community**: [Discord](community.md)
+- **Issues**: [GitHub Issues](https://github.com/Hawksight-AI/semantica/issues)
+- **Support**: [Contact Us](community.md)
diff --git a/docs/reference/change_management.md b/docs/reference/change_management.md
index 2fdece50..9773a827 100644
--- a/docs/reference/change_management.md
+++ b/docs/reference/change_management.md
@@ -1,754 +1,274 @@
-# Change Management API Reference
+# Change Management
-Comprehensive API documentation for the Enhanced Change Management module in Semantica.
+**Enterprise-grade version control and audit trails for knowledge graphs and ontologies with data integrity verification**
## Overview
-The `semantica.change_management` module provides enterprise-grade version control, audit trails, and compliance tracking for knowledge graphs and ontologies. It includes persistent storage backends, detailed change tracking, data integrity verification, and standardized metadata structures.
+The Semantica change management module provides enterprise-grade version control, audit trails, and compliance tracking for knowledge graphs and ontologies. Designed for high-stakes domains where every change must be tracked, verified, and auditable with complete data integrity guarantees.
-## Module Structure
+
-```
-semantica.change_management/
-โโโ change_log.py # Standardized metadata structures
-โโโ version_storage.py # Storage abstraction and implementations
-โโโ managers.py # Enhanced version managers
-โโโ ontology_version_manager.py # Ontology version management
-โโโ change_management_usage.md # Usage guide
-```
+- :material-history:{ .lg .middle } **Version Control**
-## Quick Import
+ ---
-```python
-from semantica.change_management import (
- # Metadata
- ChangeLogEntry,
-
- # Storage
- VersionStorage,
- InMemoryVersionStorage,
- SQLiteVersionStorage,
-
- # Utilities
- compute_checksum,
- verify_checksum,
-
- # Version Managers
- BaseVersionManager,
- TemporalVersionManager,
- OntologyVersionManager,
- VersionManager,
- OntologyVersion
-)
-```
+ Complete snapshot management with SHA-256 integrity verification
+
+- :material-database:{ .lg .middle } **Dual Storage**
+
+ ---
+
+ InMemory (development) and SQLite (production) with ACID guarantees
+
+- :material-account-tree:{ .lg .middle } **Knowledge Graph Versioning**
+
+ ---
+
+ Entity and relationship-level change tracking with detailed diffs
+
+- :material-schema:{ .lg .middle } **Ontology Versioning**
+
+ ---
+
+ Structural change tracking for classes, properties, and axioms
+
+- :material-audit:{ .lg .middle } **Audit Trail Compliance**
+
+ ---
+
+ Complete change logs with author attribution and timestamps
+
+- :material-shield-check:{ .lg .middle } **Data Integrity**
+
+ ---
+
+ SHA-256 checksums for tamper detection and verification
+
+- :material-compare:{ .lg .middle } **Change Comparison**
+
+ ---
+
+ Detailed diff algorithms for entities, relationships, and ontology structures
+
+- :material-backup-restore:{ .lg .middle } **Backward Compatibility**
+
+ ---
+
+ Legacy support for existing ontology version management
+
+
+
+### Key Features
+
+- โ
**Enterprise Version Control** โ Complete snapshot management with SHA-256 integrity verification
+- โ
**Dual Storage Backends** โ InMemory (development) and SQLite (production) with ACID guarantees
+- โ
**Knowledge Graph Versioning** โ Entity and relationship-level change tracking with detailed diffs
+- โ
**Ontology Versioning** โ Structural change tracking for classes, properties, and axioms
+- โ
**Audit Trail Compliance** โ Complete change logs with author attribution and timestamps
+- โ
**Data Integrity** โ SHA-256 checksums for tamper detection and verification
+- โ
**Change Comparison** โ Detailed diff algorithms for entities, relationships, and ontology structures
+- โ
**Backward Compatibility** โ Legacy support for existing ontology version management
---
-## Core Classes
-
-### ChangeLogEntry
-
-Standardized metadata structure for version changes with validation.
-
-#### Class Definition
+## Quick Start
```python
-@dataclass
-class ChangeLogEntry:
- """
- Standardized change log entry with validation.
-
- Attributes:
- timestamp: ISO 8601 formatted timestamp
- author: Email address of the change author
- description: Change description (max 500 characters)
- change_id: Optional ID linking to external systems
- """
- timestamp: str
- author: str
- description: str
- change_id: Optional[str] = None
-```
+from semantica.change_management import TemporalVersionManager
-#### Methods
-
-##### `__post_init__()`
-
-Validates all fields after initialization.
-
-**Raises:**
-- `ValidationError`: If any field validation fails
-
-**Example:**
-```python
-entry = ChangeLogEntry(
- timestamp="2024-01-30T12:00:00Z",
- author="user@example.com",
- description="Updated entity relationships",
- change_id="TICKET-123"
-)
-```
-
-##### `create_now(author, description, change_id=None)` (classmethod)
-
-Creates a change log entry with the current timestamp.
-
-**Parameters:**
-- `author` (str): Email address of the change author
-- `description` (str): Change description (max 500 characters)
-- `change_id` (str, optional): ID linking to external systems
-
-**Returns:**
-- `ChangeLogEntry`: New instance with current timestamp
-
-**Example:**
-```python
-entry = ChangeLogEntry.create_now(
- author="developer@company.com",
- description="Fixed entity resolution bug",
- change_id="JIRA-1234"
-)
-```
-
-#### Validation Rules
-
-- **Timestamp**: Must be valid ISO 8601 format with 'T' separator
-- **Author**: Must be valid email format (RFC 5322)
-- **Description**: Maximum 500 characters
-- **Change ID**: Optional, no validation
-
----
-
-### VersionStorage
-
-Abstract base class for storage implementations.
-
-#### Class Definition
-
-```python
-class VersionStorage(ABC):
- """
- Abstract base class for version storage backends.
-
- Provides interface for saving, retrieving, and managing version snapshots.
- """
-```
-
-#### Abstract Methods
-
-##### `save(snapshot)`
-
-Save a version snapshot.
-
-**Parameters:**
-- `snapshot` (Dict[str, Any]): Version snapshot dictionary with metadata
-
-**Raises:**
-- `ValidationError`: If snapshot data is invalid
-- `ProcessingError`: If save operation fails
-
-**Example:**
-```python
-snapshot = {
- "label": "v1.0",
- "timestamp": "2024-01-30T12:00:00Z",
- "author": "user@example.com",
- "description": "Initial version",
- "data": {...}
-}
-storage.save(snapshot)
-```
-
-##### `get(label)`
-
-Retrieve a version snapshot by label.
-
-**Parameters:**
-- `label` (str): Version label to retrieve
-
-**Returns:**
-- `Optional[Dict[str, Any]]`: Snapshot dictionary or None if not found
-
-**Example:**
-```python
-snapshot = storage.get("v1.0")
-if snapshot:
- print(f"Retrieved: {snapshot['label']}")
-```
-
-##### `list_all()`
-
-List all version snapshots.
-
-**Returns:**
-- `List[Dict[str, Any]]`: List of snapshot metadata dictionaries
-
-**Example:**
-```python
-versions = storage.list_all()
-for v in versions:
- print(f"{v['label']}: {v['description']}")
-```
-
-##### `exists(label)`
-
-Check if a version exists.
-
-**Parameters:**
-- `label` (str): Version label to check
-
-**Returns:**
-- `bool`: True if version exists, False otherwise
-
-**Example:**
-```python
-if storage.exists("v1.0"):
- print("Version exists")
-```
-
-##### `delete(label)`
-
-Delete a version snapshot.
-
-**Parameters:**
-- `label` (str): Version label to delete
-
-**Returns:**
-- `bool`: True if deleted, False if not found
-
-**Example:**
-```python
-if storage.delete("v1.0"):
- print("Version deleted")
-```
-
----
-
-### InMemoryVersionStorage
-
-In-memory version storage implementation.
-
-#### Class Definition
-
-```python
-class InMemoryVersionStorage(VersionStorage):
- """
- In-memory version storage implementation.
-
- Fast, volatile storage for development and testing.
- Data is lost when the process ends.
- """
-```
-
-#### Constructor
-
-```python
-def __init__(self):
- """Initialize in-memory storage."""
-```
-
-**Example:**
-```python
-storage = InMemoryVersionStorage()
-```
-
-#### Performance Characteristics
-
-- **Save**: 0.37-16ms (10-1000 entities)
-- **Get**: 0.20-16ms (10-1000 entities)
-- **List**: <0.03ms
-- **Thread-safe**: Yes (uses RLock)
-
-#### Use Cases
-
-- Development and testing
-- Temporary version tracking
-- High-performance scenarios where persistence is not required
-
----
-
-### SQLiteVersionStorage
-
-SQLite-based persistent version storage implementation.
-
-#### Class Definition
-
-```python
-class SQLiteVersionStorage(VersionStorage):
- """
- SQLite-based persistent version storage implementation.
-
- Provides persistence across process restarts with ACID guarantees.
- """
-```
-
-#### Constructor
-
-```python
-def __init__(self, storage_path: str):
- """
- Initialize SQLite storage.
-
- Args:
- storage_path: Path to SQLite database file
- """
-```
-
-**Parameters:**
-- `storage_path` (str): Path to SQLite database file (created if doesn't exist)
-
-**Example:**
-```python
-storage = SQLiteVersionStorage("versions.db")
-```
-
-#### Database Schema
-
-```sql
-CREATE TABLE versions (
- label TEXT PRIMARY KEY,
- timestamp TEXT NOT NULL,
- author TEXT NOT NULL,
- description TEXT,
- checksum TEXT,
- snapshot_data TEXT NOT NULL,
- created_at TEXT NOT NULL
-)
-```
-
-#### Performance Characteristics
-
-- **Save**: 7-25ms (10-1000 entities)
-- **Get**: 2-8ms (10-1000 entities)
-- **List**: 0.6-13ms
-- **Thread-safe**: Yes (uses RLock)
-- **ACID**: Full transaction support
-
-#### Use Cases
-
-- Production deployments
-- Long-term version storage
-- Compliance and audit requirements
-- Multi-process environments
-
----
-
-### BaseVersionManager
-
-Abstract base class for version managers.
-
-#### Class Definition
-
-```python
-class BaseVersionManager(ABC):
- """
- Abstract base class for version managers.
-
- Provides common functionality for version management across
- different data types (knowledge graphs, ontologies, etc.).
- """
-```
-
-#### Constructor
-
-```python
-def __init__(self, storage_path: Optional[str] = None):
- """
- Initialize base version manager.
-
- Args:
- storage_path: Path to SQLite database file for persistent storage.
- If None, uses in-memory storage.
- """
-```
-
-**Parameters:**
-- `storage_path` (str, optional): Path to SQLite database file
-
-**Example:**
-```python
-# In-memory storage
-manager = BaseVersionManager()
-
-# Persistent storage
-manager = BaseVersionManager(storage_path="versions.db")
-```
-
-#### Abstract Methods
-
-##### `create_snapshot(data, version_label, author, description, **options)`
-
-Create a versioned snapshot of the data.
-
-**Parameters:**
-- `data` (Any): Data to snapshot
-- `version_label` (str): Version label
-- `author` (str): Email address of the author
-- `description` (str): Change description
-- `**options`: Additional options
-
-**Returns:**
-- `Dict[str, Any]`: Snapshot with metadata and checksum
-
-##### `compare_versions(version1, version2, **options)`
-
-Compare two versions and return detailed differences.
-
-**Parameters:**
-- `version1` (Any): First version (label or snapshot)
-- `version2` (Any): Second version (label or snapshot)
-- `**options`: Comparison options
-
-**Returns:**
-- `Dict[str, Any]`: Detailed differences
-
-#### Concrete Methods
-
-##### `list_versions()`
-
-List all version snapshots.
-
-**Returns:**
-- `List[Dict[str, Any]]`: List of version metadata
-
-**Example:**
-```python
-versions = manager.list_versions()
-for v in versions:
- print(f"{v['label']}: {v['description']}")
-```
-
-##### `get_version(label)`
-
-Retrieve specific version by label.
-
-**Parameters:**
-- `label` (str): Version label
-
-**Returns:**
-- `Optional[Dict[str, Any]]`: Version snapshot or None
-
-**Example:**
-```python
-version = manager.get_version("v1.0")
-```
-
-##### `verify_checksum(snapshot)`
-
-Verify data integrity using checksum.
-
-**Parameters:**
-- `snapshot` (Dict[str, Any]): Snapshot to verify
-
-**Returns:**
-- `bool`: True if checksum is valid
-
-**Example:**
-```python
-is_valid = manager.verify_checksum(snapshot)
-```
-
----
-
-### TemporalVersionManager
-
-Enhanced temporal version management engine for knowledge graphs.
-
-#### Class Definition
-
-```python
-class TemporalVersionManager(BaseVersionManager):
- """
- Enhanced temporal version management engine for knowledge graphs.
-
- Features:
- - Persistent snapshot storage (SQLite or in-memory)
- - Detailed change tracking with entity-level diffs
- - SHA-256 checksums for data integrity
- - Standardized metadata with author attribution
- - Version comparison with backward compatibility
- - Input validation and security features
- """
-```
-
-#### Constructor
-
-```python
-def __init__(self, storage_path: Optional[str] = None, **config):
- """
- Initialize enhanced temporal version manager.
-
- Args:
- storage_path: Path to SQLite database file for persistent storage.
- If None, uses in-memory storage
- **config: Additional configuration options
- """
-```
-
-**Parameters:**
-- `storage_path` (str, optional): Path to SQLite database file
-- `**config`: Additional configuration options
-
-**Example:**
-```python
-# In-memory storage
-manager = TemporalVersionManager()
-
-# Persistent storage
-manager = TemporalVersionManager(storage_path="kg_versions.db")
-```
-
-#### Methods
-
-##### `create_snapshot(graph, version_label, author, description, **options)`
-
-Create and store snapshot with checksum and metadata.
-
-**Parameters:**
-- `graph` (Dict[str, Any]): Knowledge graph dict with "entities" and "relationships"
-- `version_label` (str): Version string (e.g., "v1.0")
-- `author` (str): Email address of the change author
-- `description` (str): Change description (max 500 chars)
-- `**options`: Additional options
-
-**Returns:**
-- `Dict[str, Any]`: Snapshot with metadata and checksum
-
-**Raises:**
-- `ValidationError`: If input validation fails
-- `ProcessingError`: If snapshot creation fails
-
-**Example:**
-```python
-graph = {
- "entities": [
- {"id": "e1", "name": "Entity 1", "type": "Person"},
- {"id": "e2", "name": "Entity 2", "type": "Organization"}
- ],
- "relationships": [
- {"source": "e1", "target": "e2", "type": "works_for"}
- ]
-}
+# Initialize version manager
+manager = TemporalVersionManager(storage_path="versions.db")
+# Create versioned snapshot
snapshot = manager.create_snapshot(
- graph,
+ graph={"entities": [...], "relationships": [...]},
version_label="v1.0",
author="user@example.com",
description="Initial knowledge graph"
)
-print(f"Created: {snapshot['label']}")
-print(f"Checksum: {snapshot['checksum']}")
-```
-
-##### `compare_versions(version1, version2, **options)`
-
-Compare two versions with detailed entity and relationship diffs.
-
-**Parameters:**
-- `version1` (Union[str, Dict]): First version (label or snapshot dict)
-- `version2` (Union[str, Dict]): Second version (label or snapshot dict)
-- `**options`: Comparison options
-
-**Returns:**
-- `Dict[str, Any]`: Detailed differences including:
- - `summary`: Aggregate statistics
- - `entity_changes`: Entity-level changes
- - `relationship_changes`: Relationship-level changes
-
-**Example:**
-```python
+# Compare versions
diff = manager.compare_versions("v1.0", "v2.0")
-
-print(f"Entities added: {diff['summary']['entities_added']}")
-print(f"Entities modified: {diff['summary']['entities_modified']}")
-print(f"Relationships added: {diff['summary']['relationships_added']}")
-
-# Detailed entity changes
-for entity_id, changes in diff['entity_changes'].items():
- print(f"Entity {entity_id}: {changes['status']}")
- if changes['status'] == 'modified':
- print(f" Before: {changes['before']}")
- print(f" After: {changes['after']}")
```
-#### Performance
-
-- **Snapshot Creation**: 1.40-54ms (50-2000 entities)
-- **Version Retrieval**: 0.65-26ms (50-2000 entities)
-- **Version Comparison**: 3.46-33ms (100-1000 entities)
-- **Concurrent Throughput**: 500+ operations/second
+**What this does:**
+- Initializes version manager with persistent SQLite storage
+- Creates a versioned snapshot of knowledge graph data
+- Compares two versions to detect changes
+- Provides complete audit trail with author attribution
---
+## Core Components
+
+### ChangeLogEntry
+
+Standardized metadata for tracking version changes with validation.
+
+```python
+from semantica.change_management import ChangeLogEntry
+
+@dataclass
+class ChangeLogEntry:
+ timestamp: str # ISO 8601 format
+ author: str # Email address
+ description: str # Max 500 characters
+ change_id: Optional[str] = None
+```
+
+**Key Method:**
+- `create_now(author, description, change_id=None)` - Create entry with current timestamp
+
+### Storage Backends
+
+#### InMemoryVersionStorage
+Fast, volatile storage for development and testing.
+```python
+from semantica.change_management import InMemoryVersionStorage
+
+storage = InMemoryVersionStorage()
+```
+
+#### SQLiteVersionStorage
+Persistent storage with ACID guarantees for production.
+```python
+from semantica.change_management import SQLiteVersionStorage
+
+storage = SQLiteVersionStorage("versions.db")
+```
+
+#### VersionStorage (Abstract)
+Base interface for custom storage implementations.
+
+**Core Methods:**
+- `save(snapshot)` - Store version snapshot
+- `get(label)` - Retrieve by version label
+- `list_all()` - List all versions
+- `exists(label)` - Check if version exists
+- `delete(label)` - Remove version
+
+---
+
+## Version Managers
+
+### BaseVersionManager
+
+Abstract base class providing common version management functionality.
+
+```python
+from semantica.change_management import BaseVersionManager
+
+manager = BaseVersionManager(storage_path="versions.db")
+```
+
+**Common Methods:**
+- `list_versions()` - Get all version metadata
+- `get_version(label)` - Retrieve specific version
+- `verify_checksum(snapshot)` - Validate data integrity
+
+### TemporalVersionManager
+
+**Knowledge Graph Version Management**
+
+Perfect for tracking changes in knowledge graphs with entity and relationship diffs.
+
+```python
+from semantica.change_management import TemporalVersionManager
+
+manager = TemporalVersionManager(storage_path="kg_versions.db")
+
+# Create snapshot
+snapshot = manager.create_snapshot(
+ graph={
+ "entities": [
+ {"id": "e1", "name": "Entity 1", "type": "Person"},
+ {"id": "e2", "name": "Entity 2", "type": "Organization"}
+ ],
+ "relationships": [
+ {"source": "e1", "target": "e2", "type": "works_for"}
+ ]
+ },
+ version_label="v1.0",
+ author="user@example.com",
+ description="Initial knowledge graph"
+)
+
+# Compare versions with detailed diffs
+diff = manager.compare_versions("v1.0", "v2.0")
+print(f"Entities added: {diff['summary']['entities_added']}")
+print(f"Relationships modified: {diff['summary']['relationships_modified']}")
+```
+
+**Key Features:**
+- Entity-level change tracking
+- Relationship diff analysis
+- SHA-256 checksums for integrity
+- Detailed change summaries
+
### OntologyVersionManager
-Enhanced version management for ontologies.
+**Ontology Version Management**
-#### Class Definition
+Designed for structural changes in ontologies with class, property, and axiom tracking.
```python
-class OntologyVersionManager(BaseVersionManager):
- """
- Enhanced version management for ontologies.
-
- Features:
- - Persistent ontology snapshot storage
- - Structural comparison (classes, properties, axioms)
- - SHA-256 checksums for data integrity
- - Standardized metadata with author attribution
- """
-```
+from semantica.change_management import OntologyVersionManager
-#### Constructor
-
-```python
-def __init__(self, storage_path: Optional[str] = None, **config):
- """
- Initialize enhanced version manager for ontologies.
-
- Args:
- storage_path: Path to SQLite database file for persistent storage.
- If None, uses in-memory storage
- **config: Additional configuration options
- """
-```
-
-**Example:**
-```python
manager = OntologyVersionManager(storage_path="ontology_versions.db")
-```
-
-#### Methods
-
-##### `create_snapshot(ontology, version_label, author, description, **options)`
-
-Create ontology snapshot with metadata.
-
-**Parameters:**
-- `ontology` (Dict[str, Any]): Ontology dict with structure information
-- `version_label` (str): Version label
-- `author` (str): Email address of the author
-- `description` (str): Change description
-- `**options`: Additional options
-
-**Returns:**
-- `Dict[str, Any]`: Ontology snapshot with metadata
-
-**Example:**
-```python
-ontology = {
- "uri": "https://example.com/ontology",
- "version_info": {"version": "1.0", "date": "2024-01-30"},
- "structure": {
- "classes": ["Person", "Organization", "Location"],
- "properties": ["name", "address", "email"],
- "individuals": ["JohnDoe", "ACME_Corp"],
- "axioms": ["Person hasAddress exactly 1 Location"]
- }
-}
+# Create ontology snapshot
snapshot = manager.create_snapshot(
- ontology,
+ ontology={
+ "uri": "https://example.com/ontology",
+ "structure": {
+ "classes": ["Person", "Organization"],
+ "properties": ["name", "email"],
+ "axioms": ["Person hasEmail exactly 1 Email"]
+ }
+ },
version_label="ont_v1.0",
author="architect@example.com",
description="Initial ontology design"
)
-```
-##### `compare_versions(version1, version2, **options)`
-
-Compare ontology versions with structural analysis.
-
-**Parameters:**
-- `version1` (Union[str, Dict]): First version
-- `version2` (Union[str, Dict]): Second version
-- `**options`: Comparison options
-
-**Returns:**
-- `Dict[str, Any]`: Structural differences including:
- - `classes_added`, `classes_removed`
- - `properties_added`, `properties_removed`
- - `individuals_added`, `individuals_removed`
- - `axioms_added`, `axioms_removed`, `axioms_modified`
-
-**Example:**
-```python
+# Compare structural changes
diff = manager.compare_versions("ont_v1.0", "ont_v2.0")
-
print(f"Classes added: {diff['classes_added']}")
-print(f"Properties added: {diff['properties_added']}")
print(f"Axioms modified: {diff['axioms_modified']}")
```
+**Key Features:**
+- Class and property tracking
+- Axiom change detection
+- Structural comparison
+- Import/export support
+
---
-## Utility Functions
+## Data Integrity
### compute_checksum
-Compute SHA-256 checksum for data integrity.
+Generate SHA-256 checksum for data integrity verification.
-#### Function Signature
-
-```python
-def compute_checksum(data: Dict[str, Any]) -> str:
- """
- Compute SHA-256 checksum for data.
-
- Args:
- data: Dictionary to compute checksum for
-
- Returns:
- SHA-256 checksum as hexadecimal string
- """
-```
-
-**Parameters:**
-- `data` (Dict[str, Any]): Dictionary to compute checksum for
-
-**Returns:**
-- `str`: SHA-256 checksum as hexadecimal string
-
-**Example:**
```python
from semantica.change_management import compute_checksum
data = {"entities": [...], "relationships": [...]}
checksum = compute_checksum(data)
-print(f"Checksum: {checksum}")
+print(f"SHA-256: {checksum}")
```
-**Performance:** 1.29-110ms (100-10,000 entities)
-
----
+**Use cases:**
+- Verify data integrity before storing snapshots
+- Detect unauthorized modifications to version data
+- Ensure consistency across distributed systems
+- Generate unique identifiers for data versions
### verify_checksum
-Verify data integrity using stored checksum.
+Validate data integrity using stored checksums.
-#### Function Signature
-
-```python
-def verify_checksum(snapshot: Dict[str, Any]) -> bool:
- """
- Verify data integrity using checksum.
-
- Args:
- snapshot: Snapshot dictionary with 'checksum' field
-
- Returns:
- True if checksum is valid, False otherwise
- """
-```
-
-**Parameters:**
-- `snapshot` (Dict[str, Any]): Snapshot dictionary with 'checksum' field
-
-**Returns:**
-- `bool`: True if checksum is valid, False otherwise
-
-**Example:**
```python
from semantica.change_management import verify_checksum
@@ -759,180 +279,72 @@ if not is_valid:
print("WARNING: Data integrity compromised!")
```
-**Performance:** 0.82-96ms (100-10,000 entities)
+**Use cases:**
+- Validate snapshot integrity after retrieval
+- Detect data corruption or tampering
+- Ensure compliance with data integrity requirements
+- Verify backup and restore operations
---
-## Legacy Classes
+## Legacy Support
### VersionManager
-Original ontology version manager (moved from `semantica.ontology`).
-
-#### Import
+Original ontology version manager for backward compatibility.
```python
from semantica.change_management import VersionManager, OntologyVersion
```
-**Note:** This class is maintained for backward compatibility. New projects should use `OntologyVersionManager`.
+**Note:** Use `OntologyVersionManager` for new projects.
---
## Error Handling
-### ValidationError
-
-Raised when input validation fails.
-
-**Common Causes:**
-- Invalid email format
-- Description exceeds 500 characters
-- Invalid ISO 8601 timestamp
-- Missing required fields
-
-**Example:**
```python
-from semantica.utils.exceptions import ValidationError
+from semantica.utils.exceptions import ValidationError, ProcessingError
try:
- entry = ChangeLogEntry(
- timestamp="invalid",
- author="not-an-email",
- description="x" * 501
- )
+ snapshot = manager.create_snapshot(...)
except ValidationError as e:
- print(f"Validation failed: {e}")
-```
-
-### ProcessingError
-
-Raised when operations fail.
-
-**Common Causes:**
-- Database connection issues
-- File system errors
-- Concurrent modification conflicts
-
-**Example:**
-```python
-from semantica.utils.exceptions import ProcessingError
-
-try:
- storage.save(snapshot)
+ print(f"Invalid input: {e}")
except ProcessingError as e:
- print(f"Save failed: {e}")
+ print(f"Operation failed: {e}")
```
----
-
-## Performance Considerations
-
-### Benchmarks
-
-Based on comprehensive performance testing:
-
-| Component | Small (100) | Medium (500) | Large (2000) |
-|-----------|-------------|--------------|--------------|
-| Snapshot Creation | 2.33ms | 10.70ms | 54.23ms |
-| Version Retrieval | 1.88ms | 7.33ms | 26.04ms |
-| Version Comparison | 3.46ms | 17.39ms | 32.83ms |
-| Checksum Compute | 1.29ms | 5.48ms | 22.15ms |
-| SQLite Save | 8.69ms | 13.37ms | 25.33ms |
-| InMemory Save | 1.18ms | 10.60ms | 14.11ms |
-
-### Optimization Tips
-
-1. **Use appropriate storage backend:**
- - Development: `InMemoryVersionStorage`
- - Production: `SQLiteVersionStorage`
-
-2. **Batch operations when possible:**
- ```python
- for data in batch:
- manager.create_snapshot(data, ...)
- ```
-
-3. **Implement retention policies:**
- ```python
- # Delete old versions periodically
- for version in old_versions:
- storage.delete(version['label'])
- ```
-
-4. **Use concurrent operations:**
- - Thread-safe: 500+ operations/second
- - No performance degradation under load
+**Common Errors:**
+- `ValidationError` - Invalid email, missing fields, bad timestamps
+- `ProcessingError` - Database issues, file system errors
---
-## Compliance Features
+## Best Practices
-### HIPAA Compliance
+### Performance Tips
+- Use `InMemoryVersionStorage` for development/testing
+- Use `SQLiteVersionStorage` for production
+- Implement retention policies for old versions
-- Complete audit trails with author attribution
-- Timestamp tracking for all changes
-- Data integrity verification with checksums
-- Secure storage with access controls
-
-### SOX Compliance
-
-- Immutable change records
-- Detailed change descriptions
-- External system linking (change IDs)
-- Comprehensive audit reports
-
-### FDA 21 CFR Part 11
-
-- Electronic signatures (author email)
-- Data integrity verification
-- Audit trail generation
-- Tamper detection
-
----
-
-## Examples
-
-### Complete Healthcare Example
+### Security Considerations
+- Validate author emails for audit trails
+- Use checksums for data integrity
+- Store sensitive data with appropriate permissions
+### Usage Patterns
```python
from semantica.change_management import TemporalVersionManager
-# Initialize with HIPAA-compliant storage
-manager = TemporalVersionManager(storage_path="hipaa_records.db")
+# Development workflow
+dev_manager = TemporalVersionManager() # In-memory
-# Patient knowledge graph
-patient_kg = {
- "entities": [
- {"id": "patient_001", "type": "Patient", "name": "Jane Smith"},
- {"id": "diagnosis_001", "type": "Diagnosis", "code": "I10"}
- ],
- "relationships": [
- {"source": "patient_001", "target": "diagnosis_001", "type": "has_diagnosis"}
- ]
-}
-
-# Create versioned record
-snapshot = manager.create_snapshot(
- patient_kg,
- "patient_001_v1.0",
- "dr.williams@hospital.com",
- "Initial diagnosis - Essential hypertension"
+# Production workflow
+prod_manager = TemporalVersionManager(
+ storage_path="secure/production_versions.db"
)
-# Verify integrity
-assert manager.verify_checksum(snapshot), "Data integrity check failed"
-
-# Generate audit report
-for version in manager.list_versions():
- print(f"{version['timestamp']}: {version['label']} by {version['author']}")
+# Audit trail generation
+for version in prod_manager.list_versions():
+ print(f"{version['timestamp']}: {version['description']} by {version['author']}")
```
-
----
-
-## See Also
-
-- **Usage Guide**: `semantica/change_management/change_management_usage.md`
-- **Performance Tests**: `tests/change_management/test_performance.py`
-- **CHANGELOG**: `CHANGELOG.md`
-- **GitHub**: https://github.com/Hawksight-AI/semantica
diff --git a/docs/reference/ingest.md b/docs/reference/ingest.md
index 55c1cb98..25fff55a 100644
--- a/docs/reference/ingest.md
+++ b/docs/reference/ingest.md
@@ -14,7 +14,7 @@ The **Ingest Module** is the entry point for loading data into Semantica. It pro
- **File Systems**: Local files, cloud storage (S3, GCS, Azure)
- **Web Content**: Websites, RSS feeds, APIs
- **Streams**: Real-time data from Kafka, RabbitMQ, etc.
-- **Databases**: SQL and NoSQL databases
+- **Databases**: SQL, NoSQL, and cloud data warehouses including Snowflake
- **Repositories**: Git repositories (GitHub, GitLab)
- **Email**: IMAP, POP3 servers
- **MCP**: Model Context Protocol servers
@@ -72,7 +72,7 @@ The **Ingest Module** is the entry point for loading data into Semantica. It pro
---
- Ingest tables and query results from SQL databases
+ Ingest tables and query results from SQL, NoSQL, and cloud data warehouses including Snowflake
@@ -173,7 +173,7 @@ Handles IMAP and POP3 servers.
### DBIngestor
-Handles SQL databases.
+Handles SQL and NoSQL databases including Snowflake.
**Methods:**
@@ -181,6 +181,16 @@ Handles SQL databases.
|--------|-------------|
| `ingest_database(conn)` | Export tables |
| `execute_query(sql)` | Run custom SQL |
+| `connect_snowflake(account, user, password, warehouse)` | Connect to Snowflake |
+| `ingest_snowflake_table(table_name)` | Ingest Snowflake table |
+| `execute_snowflake_query(sql)` | Run Snowflake SQL |
+
+**Supported Databases:**
+- **PostgreSQL**, **MySQL**, **SQLite**
+- **Microsoft SQL Server**, **Oracle**
+- **Snowflake** (Cloud Data Warehouse)
+- **MongoDB**, **Cassandra** (NoSQL)
+- **BigQuery**, **Redshift** (Cloud Data Warehouses)
### MCPIngestor
@@ -258,6 +268,64 @@ ingestor.monitor(
)
```
+### Snowflake Data Warehouse Integration
+
+```python
+from semantica.ingest import DBIngestor
+
+# 1. Connect to Snowflake
+ingestor = DBIngestor()
+ingestor.connect_snowflake(
+ account="your_account.snowflakecomputing.com",
+ user="your_username",
+ password="your_password",
+ warehouse="ANALYTICS_WH",
+ database="PRODUCTION_DB",
+ schema="PUBLIC"
+)
+
+# 2. Ingest entire table
+data = ingestor.ingest_snowflake_table("CUSTOMERS")
+
+# 3. Or run custom query
+results = ingestor.execute_snowflake_query("""
+ SELECT
+ CUSTOMER_ID,
+ NAME,
+ EMAIL,
+ CREATED_AT
+ FROM CUSTOMERS
+ WHERE CREATED_AT > '2024-01-01'
+""")
+
+# 4. Process with pipeline
+for row in results:
+ pipeline.process(row)
+```
+
+!!! info "Comprehensive Snowflake Guide"
+ For detailed Snowflake integration including authentication methods, advanced features, and best practices, see the **[Snowflake Integration Guide](../integrations/snowflake.md)**.
+
+### Multi-Database Integration
+
+```python
+from semantica.ingest import DBIngestor
+
+ingestor = DBIngestor()
+
+# Connect to multiple databases
+connections = {
+ "snowflake": ingestor.connect_snowflake(...),
+ "postgres": ingestor.connect_database("postgresql://..."),
+ "mysql": ingestor.connect_database("mysql://...")
+}
+
+# Ingest from all sources
+for name, conn in connections.items():
+ data = ingestor.ingest_database(conn)
+ print(f"Ingested {len(data)} records from {name}")
+```
+
---
## Best Practices
@@ -271,6 +339,7 @@ ingestor.monitor(
## See Also
+- **[Snowflake Integration Guide](../integrations/snowflake.md)** - Comprehensive Snowflake integration with authentication, advanced features, and best practices
- [Parse Module](parse.md) - Processes the raw data ingested here
- [Split Module](split.md) - Chunks the ingested content
- [Utils Module](utils.md) - Validation helpers
diff --git a/docs/reference/provenance.md b/docs/reference/provenance.md
index 5c16e061..044f3020 100644
--- a/docs/reference/provenance.md
+++ b/docs/reference/provenance.md
@@ -6,6 +6,58 @@
The Semantica provenance module provides W3C PROV-O compliant tracking for knowledge graphs, enabling complete end-to-end lineage from source documents to query responses. Designed for high-stakes domains where every decision must be explainable and auditable.
+
+
+- :material-web:{ .lg .middle } **W3C PROV-O Compliant**
+
+ ---
+
+ Implements PROV-O ontology (prov:Entity, prov:Activity, prov:Agent, prov:wasDerivedFrom)
+
+- :material-all-inclusive:{ .lg .middle } **Complete Coverage**
+
+ ---
+
+ All 17 Semantica modules integrated for comprehensive tracking
+
+- :material-source-document:{ .lg .middle } **Source Tracking**
+
+ ---
+
+ Document identifiers, page numbers, sections, and direct quotes supported
+
+- :material-backup-restore:{ .lg .middle } **Backward Compatible**
+
+ ---
+
+ 100% backward compatible, opt-in only with zero breaking changes
+
+- :material-database:{ .lg .middle } **Multiple Storage**
+
+ ---
+
+ InMemory (fast) and SQLite (persistent) backends available
+
+- :material-bridge:{ .lg .middle } **Bridge Axiom Support**
+
+ ---
+
+ Translation chain tracking for domain transformations (L1 โ L2 โ L3)
+
+- :material-shield-check:{ .lg .middle } **Integrity Verification**
+
+ ---
+
+ SHA-256 checksums for tamper detection and verification
+
+- :material-route:{ .lg .middle } **Complete Lineage**
+
+ ---
+
+ End-to-end tracing from document to AI response
+
+
+
### Key Features
- โ
**W3C PROV-O Compliant** โ Implements PROV-O ontology (prov:Entity, prov:Activity, prov:Agent, prov:wasDerivedFrom)
@@ -45,6 +97,12 @@ manager = ProvenanceManager()
manager = ProvenanceManager(storage_path="provenance.db")
```
+**Key capabilities:**
+- Track entities and relationships with complete lineage
+- Store provenance data in memory or persistent SQLite storage
+- Query provenance information for audit and compliance
+- Maintain W3C PROV-O compliant records
+
**Methods:**
- `track_entity(entity_id, source, entity_type, **metadata)` โ Track entity provenance
- `track_relationship(relationship_id, source, subject, predicate, obj, **metadata)` โ Track relationship provenance
@@ -66,6 +124,12 @@ from semantica.provenance import ProvenanceManager, InMemoryStorage
manager = ProvenanceManager(storage=InMemoryStorage())
```
+**Best for:**
+- Development and testing environments
+- Temporary provenance tracking
+- High-performance scenarios where persistence isn't required
+- Rapid prototyping and debugging
+
#### SQLiteStorage
Persistent storage for production use.
@@ -77,6 +141,12 @@ storage = SQLiteStorage("provenance.db")
manager = ProvenanceManager(storage=storage)
```
+**Best for:**
+- Production deployments requiring persistence
+- Long-term provenance storage
+- Compliance and audit requirements
+- Multi-process environments
+
### Data Schemas
#### ProvenanceEntry
@@ -504,9 +574,9 @@ manager = ProvenanceManager(storage=storage)
### Benchmarks
-- **Entity tracking:** <5ms per operation
-- **Lineage retrieval:** <10ms for chains up to 100 levels
-- **Batch operations:** 1000+ entities/second
+- **Entity tracking:** Fast per operation
+- **Lineage retrieval:** Quick retrieval for long chains
+- **Batch operations:** High-throughput batch processing
- **Storage:** InMemory (fastest), SQLite (persistent)
### Optimization Tips
diff --git a/docs/release-guide.md b/docs/release-guide.md
deleted file mode 100644
index 6ee0af20..00000000
--- a/docs/release-guide.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Release Guide
-
---8<-- "RELEASE.md"
diff --git a/mkdocs.yml b/mkdocs.yml
index bcaaed14..9369bcb1 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -133,25 +133,17 @@ nav:
- Visualization: reference/visualization.md
- Guides:
- concepts.md
- - deep-dive.md
- modules.md
- - glossary.md
- use-cases.md
- examples.md
- - Code Examples: CodeExamples.md
- - learning-more.md
+ - glossary.md
- Integrations:
- Docling: integrations/docling.md
+ - Snowflake: integrations/snowflake.md
- Cookbook: cookbook.md
- Resources:
- - community-projects.md
- community.md
- contributing.md
- - architecture.md
- - governance.md
- - citation.md
- - Changelog: changelog.md
- - Release Guide: release-guide.md
- faq.md
- license.md