Graph-Native Infrastructure for Context and Accountable AI Systems
Python agent-memoryaiai-governanceai-infrastructureartificial-intelligencecontext-engineeringcontext-graphsdata-engineeringdecision-intelligencedeveloper-toolsexplainable-aigenerative-aigraph-ragknowledge-graphllmontologyprovenancepythonreasoningsemantic-search
docs: enhance documentation with interactive elements and improved visuals
KaifAhmad105e5620f0156
diff --git a/docs/concepts.md b/docs/concepts.mdindex b44c97df..3ab703cc 100644--- a/docs/concepts.md+++ b/docs/concepts.md@@ -13,6 +13,13 @@ Understand the fundamental concepts behind Semantica. This guide covers the theo- **Properties**: Attributes of entities and relationships- **Metadata**: Additional information (sources, timestamps, confidence)+??? info "Deep Dive: Graph Theory Basics"+ At its core, a knowledge graph is a directed multigraph $G = (V, E)$ where:+ - $V$ is a set of vertices (entities)+ - $E$ is a set of edges (relationships)+ - Edges are directed: $(u, v) \in E$ implies a relationship from $u$ to $v$.+ - Multigraph property allows multiple edges between the same pair of vertices (e.g., "Friend" and "Colleague").+**Benefits**:- Structured representation of unstructured data- Enables complex queries and reasoning@@ -44,6 +51,9 @@ graph LR| **Money** | Monetary values | $100 million || **Event** | Events and occurrences | WWDC 2024 |+!!! tip "Custom Entities"+ Semantica allows you to define custom entity types via the `Ontology` module. You aren't limited to the standard set!+**Methods**:- **Rule-based**: Pattern matching (Regex)- **Machine Learning**: Trained models (spaCy, transformers)@@ -53,19 +63,30 @@ graph LR**Definition**: Identifying and extracting relationships between entities in text.-- **Semantic**: `works_for`, `located_in`, `causes`-- **Temporal**: `before`, `after`, `during`-- **Causal**: `causes`, `results_in`, `prevents`-- **Hierarchical**: `part_of`, `subclass_of`, `instance_of`+=== "Semantic"+ Relationships that define meaning and connection.+ - `works_for`+ - `located_in`+ - `founded_by`++=== "Temporal"+ Relationships defined by time.+ - `happened_before`+ - `happened_after`+ - `during`++=== "Causal"+ Cause and effect relationships.+ - `causes`+ - `results_in`+ - `prevents`### 4. Embeddings**Definition**: Dense vector representations of text, images, or other data that capture semantic meaning in a continuous vector space.-- **Properties**:- - Similar entities have similar embeddings (close in vector space).- - Enable semantic search and similarity calculations.- - Fixed dimensions (typically 128-4096).+> [!NOTE]+> Embeddings are the bridge between human language and machine understanding.**Example**:```python@@ -78,11 +99,16 @@ Embedding: [0.123, -0.456, 0.789, ..., 0.234]**Definition**: Knowledge graphs that track changes over time, allowing queries about the state of the graph at specific time points.-- **Features**:- - Timestamps on entities and relationships- - Version history- - Time-point queries- - Temporal pattern detection+```mermaid+timeline+ title Temporal Graph Evolution+ 2020 : Entity A created+ : Relationship A->B+ 2021 : Entity B updated+ : Relationship B->C+ 2022 : Entity A deleted+ : New Relationship D->C+```### 6. GraphRAG@@ -96,12 +122,24 @@ Embedding: [0.123, -0.456, 0.789, ..., 0.234]```mermaidflowchart TD- Q[User Query] --> VS[Vector Search]- Q --> KG[Graph Traversal]- VS --> C[Context]- KG --> C- C --> LLM[LLM Generation]- LLM --> A[Answer]+ subgraph Query [Query Processing]+ Q[User Query] --> VS[Vector Search]+ Q --> KE[Keyword Extraction]+ end++ subgraph Retrieval [Hybrid Retrieval]+ VS --> Docs[Relevant Docs]+ KE --> Nodes[Start Nodes]+ Nodes --> Trav[Graph Traversal]+ Trav --> Context[Graph Context]+ end++ subgraph Synthesis [Answer Generation]+ Docs --> Prompt+ Context --> Prompt+ Prompt --> LLM[LLM Generation]+ LLM --> A[Answer]+ endstyle Q fill:#e1f5festyle LLM fill:#e8f5e9@@ -133,9 +171,8 @@ flowchart TDFollowing these practices will help you build high-quality knowledge graphs and avoid common pitfalls.### 1. Start Small-- Begin with simple documents.-- Validate each step before moving forward.-- Build incrementally.+!!! tip "Iterative Approach"+ Don't try to model the entire world at once. Start with a small, well-defined domain and expand incrementally.### 2. Configure Properly- Use environment variables for sensitive data.@@ -143,9 +180,8 @@ Following these practices will help you build high-quality knowledge graphs and- Configure appropriate model sizes.### 3. Validate Data-- Always validate extracted entities.-- Check relationship quality.-- Use quality assurance tools.+!!! warning "Garbage In, Garbage Out"+ Always validate extracted entities. A knowledge graph with incorrect facts is worse than no graph at all.### 4. Handle Errors- Implement error handling.diff --git a/docs/index.md b/docs/index.mdindex 71631bff..4a4cce8c 100644--- a/docs/index.md+++ b/docs/index.md@@ -2,179 +2,240 @@<img src="assets/img/semantica_logo.png" alt="Semantica Logo" width="450" height="auto"></div>-# Semantica+<p align="center">+ <h1 align="center">π§ Semantica</h1>+</p>++<p align="center">+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="Python 3.8+"></a>+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>+ <a href="https://badge.fury.io/py/semantica"><img src="https://badge.fury.io/py/semantica.svg" alt="PyPI version"></a>+ <a href="https://pepy.tech/project/semantica"><img src="https://pepy.tech/badge/semantica" alt="Downloads"></a>+ <a href="https://semantica.readthedocs.io/"><img src="https://img.shields.io/badge/docs-latest-brightgreen.svg" alt="Documentation"></a>+ <a href="https://discord.gg/semantica"><img src="https://img.shields.io/discord/semantica?color=7289da&label=discord" alt="Discord"></a>+</p>++<p align="center">+ <strong>Open Source Framework for building Semantic Layers and Knowledge Engineering</strong>+</p>++<p align="center">+ <strong>Transform chaotic data into intelligent knowledge.</strong>+</p>++<p align="center">+ <em>The missing fabric between raw data and AI engineering. A comprehensive open-source framework for building semantic layers and knowledge engineering systems that transform unstructured data into AI-ready knowledge β powering Knowledge Graph-Powered RAG (GraphRAG), AI Agents, Multi-Agent Systems, and AI applications with structured semantic knowledge.</em>+</p>++<p align="center">+ π <strong>100% Open Source</strong> β’ π <strong>MIT Licensed</strong> β’ π <strong>Production Ready</strong> β’ π <strong>Community Driven</strong>+</p>++<p align="center">+ <a href="getting-started/" class="md-button md-button--primary">Get Started</a>+ <a href="https://github.com/Hawksight-AI/semantica" class="md-button">View on GitHub</a>+</p>-[](https://www.python.org/downloads/)-[](https://opensource.org/licenses/MIT)-[](https://badge.fury.io/py/semantica)-[](https://pepy.tech/project/semantica)-[](https://semantica.readthedocs.io/)-[](https://discord.gg/semantica)+----**Open Source Framework for Semantic Intelligence & Knowledge Engineering**+## π― The Problem We Solve-> **Transform chaotic data into intelligent knowledge.**+### The Data-to-AI Gap-*The missing fabric between raw data and AI engineering. A comprehensive open-source framework for building semantic layers and knowledge engineering systems that transform unstructured data into AI-ready knowledge β powering Knowledge Graph-Powered RAG (GraphRAG), AI Agents, Multi-Agent Systems, and AI applications with structured semantic knowledge.*+Modern organizations face a fundamental challenge: **the semantic gap between raw data and AI systems**.-**π 100% Open Source** β’ **π MIT Licensed** β’ **π Production Ready** β’ **π Community Driven**+You have mountains of dataβPDFs, emails, documents, databasesβbut AI systems need structured, validated knowledge with semantic relationships. This gap is the #1 blocker for production AI.----+```mermaid+flowchart TD+ subgraph RawData ["π¦ RAW DATA CHAOS"]+ direction TB+ A["π PDFs & Documents"]+ B["π§ Emails & Chat"]+ C["πΎ Databases"]+ D["π Web Content"]+ end++ subgraph Gap ["β THE SEMANTIC GAP"]+ direction TB+ X["MISSING LAYER"]+ X1["No Context"]+ X2["No Relationships"]+ X3["No Validation"]+ X --> X1+ X --> X2+ X --> X3+ end++ subgraph AI ["π€ AI SYSTEMS NEEDS"]+ direction TB+ F["AI Agents"]+ G["GraphRAG"]+ H["Reasoning"]+ I["Multi-Agent"]+ end++ RawData ==>|"Unstructured Noise"| Gap+ Gap ==>|"Hallucinations & Errors"| AI++ style Gap fill:#ffebee,stroke:#c62828,stroke-width:3px,stroke-dasharray: 5 5+ style RawData fill:#f5f5f5,stroke:#616161,stroke-width:2px+ style AI fill:#e3f2fd,stroke:#1565c0,stroke-width:2px+```++### Real-World Consequences++**Without a semantic layer, your AI systems fail:**<div class="grid cards" markdown>-- :material-rocket-launch: **Quick Start**+- **π΄ RAG Systems Fail**---- Get up and running with Semantica in minutes.-- [Get Started](getting-started.md)+ - Vector search alone misses crucial relationships+ - No graph traversal for context expansion+ - **30% lower accuracy** than hybrid approaches+ - Can't answer multi-hop questions-- :material-book-open-page-variant: **Core Concepts**+- **π΄ AI Agents Hallucinate**---- Understand the fundamental concepts behind Semantica.-- [Learn Concepts](concepts.md)+ - No ontological constraints to validate actions+ - Missing semantic routing for intent understanding+ - No persistent memory across conversations+ - Can't reason about domain rules-- :material-code-braces: **API Reference**+- **π΄ Multi-Agent Coordination Fails**---- Detailed documentation for all Semantica modules.-- [View API](reference/core.md)+ - No shared semantic models for collaboration+ - Unable to validate actions against domain rules+ - Conflicting knowledge representations+ - Agents work in silos, not as a team-- :material-chef-hat: **Cookbook**+- **π΄ Knowledge Is Untrusted**---- Interactive tutorials and real-world examples.-- [Explore Cookbook](cookbook.md)+ - Duplicate entities pollute graphs+ - Conflicting facts from different sources+ - No provenance tracking or validation+ - Can't explain where knowledge came from</div>+---+## π What is Semantica?-Semantica is the **first comprehensive open-source framework** that bridges the critical gap between raw data chaos and AI-ready knowledge. It's not just another data processing libraryβit's a complete **semantic intelligence platform** that transforms unstructured information into structured, queryable knowledge graphs that power the next generation of AI applications.+Semantica is the **first comprehensive open-source framework** that bridges the critical gap between raw data chaos and AI-ready knowledge. It's not just another data processing libraryβit's a complete **semantic intelligence platform** that transforms unstructured information into structured, queryable knowledge graphs.### The Vision-In the era of AI agents and autonomous systems, data alone isn't enough. **Context is king**. Semantica provides the semantic infrastructure that enables AI systems to truly understand, reason about, and act upon information with human-like comprehension.+In the era of AI agents and autonomous systems, **data alone isn't enough. Context is king.** Semantica provides the semantic infrastructure that enables AI systems to truly understand, reason about, and act upon information with human-like comprehension.### What Makes Semantica Different?| Traditional Approaches | Semantica's Approach ||------------------------|---------------------|-| Process data as isolated documents | Understands semantic relationships across all content |-| Extract text and store vectors | Builds knowledge graphs with meaningful connections |-| Generic entity recognition | General-purpose ontology generation and validation |-| Manual schema definition | Automatic semantic modeling from content patterns |-| Disconnected data silos | Unified semantic layer across all data sources |-| Basic quality checks | Production-grade QA with conflict detection & resolution |+| Process data as isolated documents | **Understands semantic relationships across all content** |+| Extract text and store vectors | **Builds knowledge graphs with meaningful connections** |+| Generic entity recognition | **General-purpose ontology generation and validation** |+| Manual schema definition | **Automatic semantic modeling from content patterns** |+| Disconnected data silos | **Unified semantic layer across all data sources** |+| Basic quality checks | **Production-grade QA with conflict detection & resolution** |----## π― The Problem We Solve+## β The Semantica Solution-### The Data-to-AI Gap--Modern organizations face a fundamental challenge: **the semantic gap between raw data and AI systems**.+Semantica fills the semantic gap with a **complete intelligence framework**:```mermaid-graph TD- subgraph RawData [Raw Data Chaos]+flowchart TD+ subgraph Input ["π₯ INPUT LAYER"]direction TB- A[π PDFs & Docs]- B[π§ Emails & Chat]- C[πΎ Databases]- D[π Web Content]+ I1["Files & Documents"]+ I2["API Streams"]+ I3["Databases"]end- subgraph Gap [THE SEMANTIC GAP]+ subgraph Engine ["π§ SEMANTICA ENGINE"]direction TB- X{β MISSING LAYER}- X1[No Context]- X2[No Relationships]- X3[No Validation]- X --> X1- X --> X2- X --> X3+ S1["Entity Extraction"]+ S2["Relation Mapping"]+ S3["Ontology Generation"]+ S4["Conflict Resolution"]end- subgraph AI [AI Systems Needs]+ subgraph Output ["π€ KNOWLEDGE OUTPUT"]direction TB- F[π€ AI Agents]- G[π GraphRAG]- H[π§ Reasoning]- I[π€ Multi-Agent]+ O1["Knowledge Graph"]+ O2["Vector Store"]+ O3["Reasoning API"]end- RawData == "Unstructured Noise" ==> Gap- Gap == "Hallucinations & Errors" ==> AI-- style Gap fill:#ffebee,stroke:#ff5252,stroke-width:2px,stroke-dasharray: 5 5- style RawData fill:#f5f5f5,stroke:#9e9e9e,stroke-width:1px- style AI fill:#e3f2fd,stroke:#2196f3,stroke-width:1px-```+ Input ====>|"<b>Ingest & Parse</b>"| Engine+ Engine ====>|"<b>Synthesize & Validate</b>"| Output-### Real-World Consequences+ style Engine fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px+ style Input fill:#f5f5f5,stroke:#616161,stroke-width:2px+ style Output fill:#e3f2fd,stroke:#1565c0,stroke-width:2px+```-**Without a semantic layer:**+### Powers Next-Gen AI Applications-<div class="grid cards" markdown>+- **GraphRAG**: Hybrid retrieval combining vector search + graph traversal for 30% better accuracy+- **AI Agents**: Ontology-constrained actions with semantic routing and persistent memory+- **Multi-Agent Systems**: Shared semantic models for coordinated decision-making+- **Knowledge Engineering**: Production-grade knowledge graphs with provenance and validation-- **RAG Systems Fail**- ---- Vector search alone misses crucial relationships. No graph traversal for context expansion leads to 30% lower accuracy than hybrid approaches.+----- **AI Agents Hallucinate**- ---- No ontological constraints to validate actions. Missing semantic routing for intent understanding and no persistent memory across conversations.+## π» See It In Action-- **Multi-Agent Coordination Fails**- ---- No shared semantic models for collaboration. Unable to validate actions against domain rules, leading to conflicting knowledge representations.+<div class="termy">-- **Knowledge Is Untrusted**- ---- Duplicate entities pollute graphs. Conflicting facts from different sources with no provenance tracking or validation.+```console+$ pip install semantica+---> 100%+$ semantica ingest --source ./documents --output ./knowledge_graph+[INFO] Ingesting 15 documents...+[INFO] Extracting entities using NER...+[INFO] Building Knowledge Graph...+[SUCCESS] Knowledge Graph built with 1,240 nodes and 3,500 edges!+$ semantica query "Who founded Apple?"+[RESULT] Steve Jobs, Steve Wozniak, Ronald Wayne+```</div>-### The Semantica Solution+----Semantica fills this gap with a **complete semantic intelligence framework**:+## π Choose Your Path-```mermaid-graph LR- subgraph Input [π₯ Input Layer]- direction TB- I1[Files & Docs]- I2[API Streams]- I3[Databases]- end+<div class="grid cards" markdown>- subgraph Core [π§ Semantica Engine]- direction TB- S1[Entity Extraction]- S2[Relation Mapping]- S3[Ontology Gen]- S4[Conflict Resolution]- S1 --> S2- S2 --> S3- S3 --> S4- end+- :material-rocket-launch: **Quick Start**+ ---+ Get up and running with Semantica in minutes. Learn the basics of ingestion and extraction.++ [:arrow_right: Start Here](getting-started.md)- subgraph Output [π€ Knowledge Output]- direction TB- O1[Knowledge Graph]- O2[Vector Store]- O3[Reasoning API]- end+- :material-book-open-page-variant: **Core Concepts**+ ---+ Deep dive into Knowledge Graphs, Ontologies, and Semantic Reasoning.++ [:arrow_right: Learn Concepts](concepts.md)- Input == "Ingest" ==> Core- Core == "Synthesize" ==> Output+- :material-code-braces: **API Reference**+ ---+ Detailed technical documentation for all Semantica modules and classes.++ [:arrow_right: View API](reference/core.md)- style Core fill:#e8f5e9,stroke:#4caf50,stroke-width:2px- style Input fill:#fff3e0,stroke:#ff9800,stroke-width:1px- style Output fill:#f3e5f5,stroke:#9c27b0,stroke-width:1px-```+- :material-chef-hat: **Cookbook**+ ---+ Interactive tutorials, real-world examples, and copy-paste recipes.++ [:arrow_right: Explore Cookbook](cookbook.md)++</div>---@@ -197,6 +258,8 @@ graph LR=== "Development"+ For contributors who want to modify the framework:+```bash# Clone the repositorygit clone https://github.com/semantica-dev/semantica.git@@ -206,18 +269,16 @@ graph LRpip install -e ".[dev]"```-=== "Custom"+=== "Docker"++ Run Semantica in a containerized environment:```bash- # Install specific extras as needed- pip install -e ".[llm-openai]" # LLM providers- pip install -e ".[graph-neo4j]" # Graph databases- pip install -e ".[vector-pinecone]" # Vector stores- pip install -e ".[dev]" # Development tools- pip install -e ".[gpu]" # GPU support+ docker pull semantica/semantica:latest+ docker run -it semantica/semantica```-!!! note+!!! note "PyPI Release Coming Soon"Once published to PyPI, you'll be able to install with `pip install semantica`---@@ -235,15 +296,13 @@ Process **50+ file formats** with intelligent semantic extraction:- PDF (with OCR)- DOCX, XLSX, PPTX- TXT, RTF, ODT- - EPUB, LaTeX- - Markdown, RST+ - EPUB, LaTeX, Markdown- __π Web & Feeds__---- HTML, XHTML, XML- RSS, Atom feeds- JSON-LD, RDFa- - Sitemap XML- Web scraping- __πΎ Structured Data__@@ -251,8 +310,7 @@ Process **50+ file formats** with intelligent semantic extraction:- JSON, YAML, TOML- CSV, TSV, Excel- Parquet, Avro, ORC- - SQL databases- - NoSQL databases+ - SQL/NoSQL databases- __π§ Communication__---@@ -275,3 +333,130 @@ Process **50+ file formats** with intelligent semantic extraction:- Citation networks</div>++### 2. π§ Semantic Intelligence Engine++Transform raw text into structured semantic knowledge with state-of-the-art NLP and AI models:++- **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+- **Triple Extraction**: Generate RDF triples for knowledge graph construction++### 3. πΈοΈ Knowledge Graph Construction++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++### 4. π Ontology Generation & Management++Generate formal ontologies automatically using a **6-stage LLM-based pipeline**:++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)++### 5. π Hybrid Search & Retrieval++Power GraphRAG applications with:++- **Vector Search**: Semantic similarity using embeddings+- **Graph Traversal**: Multi-hop reasoning for context expansion+- **Hybrid Retrieval**: Combine vector + graph for 30% better accuracy+- **Temporal Queries**: Query knowledge at specific time points++---++## π― Why Semantica?++<div class="grid cards" markdown>++- **π 100% Open Source**+ ---+ MIT licensed. No vendor lock-in. Full transparency.++- **π Production Ready**+ ---+ Battle-tested with quality assurance, conflict resolution, and validation.++- **π§© Modular Architecture**+ ---+ Use only what you need. Swap components easily.++- **π Community Driven**+ ---+ Built by developers, for developers. Active Discord community.++- **π Comprehensive**+ ---+ End-to-end solution from ingestion to reasoning. No duct-taping required.++- **π¬ Research-Backed**+ ---+ Based on latest research in knowledge graphs, ontologies, and semantic web.++</div>++---++## ποΈ Built For++- **Data Scientists**: Transform messy data into clean knowledge graphs+- **Data Engineers**: Build scalable data pipelines with semantic enrichment+- **AI Engineers**: Build GraphRAG, AI agents, and multi-agent systems+- **Knowledge Engineers**: Generate and manage formal ontologies+- **Ontologists**: Design and validate domain-specific ontologies and taxonomies+- **Researchers**: Analyze scientific literature and build citation networks+- **ML Engineers**: Create semantic features for machine learning models+- **Enterprises**: Unify data silos into a semantic layer++---++## π¦ Quick Example++```python+from semantica import Semantica++# Initialize+core = Semantica()++# Ingest documents+docs = core.ingest.load("documents/", recursive=True)++# Build knowledge graph+kg = core.kg.build_graph(docs, merge_entities=True)++# Query+result = kg.query("Who founded Apple Inc.?")+print(result.answer) # Steve Jobs, Steve Wozniak, Ronald Wayne+print(result.confidence) # 0.98+```++---++## οΏ½ Learn More++- [Getting Started Guide](getting-started.md) - Your first knowledge graph in 5 minutes+- [Core Concepts](concepts.md) - Deep dive into knowledge graphs and ontologies+- [Cookbook](cookbook.md) - Real-world examples and tutorials+- [API Reference](reference/core.md) - Complete technical documentation++---++<div align="center">++**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 }++</div>diff --git a/docs/modules.md b/docs/modules.mdindex bb887014..ed9d3502 100644--- a/docs/modules.md+++ b/docs/modules.md@@ -56,18 +56,41 @@ The `ingest` module is the entry point for data. It handles the complexity of co- `EmailIngestor`: Process email messages- `RepoIngestor`: Git repository analysis+ - `RepoIngestor`: Git repository analysis++```mermaid+classDiagram+ class BaseIngestor {+ +ingest(source)+ +validate(source)+ }+ class FileIngestor {+ +supported_formats: List+ +ingest_file(path)+ }+ class WebIngestor {+ +scrape(url)+ +extract_metadata(html)+ }+ BaseIngestor <|-- FileIngestor+ BaseIngestor <|-- WebIngestor+```+```pythonfrom semantica.ingest import FileIngestor, WebIngestor# Ingest local filesfile_ingestor = FileIngestor()-documents = file_ingestor.ingest("data/")+documents = file_ingestor.ingest("data/") # (1)# Ingest web contentweb_ingestor = WebIngestor()-web_docs = web_ingestor.ingest("https://example.com")+web_docs = web_ingestor.ingest("https://example.com") # (2)```+1. Recursively scans the directory for supported file types (PDF, DOCX, etc.) and converts them to standard Document objects.+2. Fetches the URL, renders JavaScript if necessary, and extracts the main content while stripping boilerplate.+### 2. Parse Module**Purpose**: Parse and extract content from various raw formats.@@ -83,13 +106,35 @@ Once data is ingested, the `parse` module extracts the raw text and metadata. It- `ImageParser`: OCR and image analysis- `CodeParser`: Parse source code files+ - `CodeParser`: Parse source code files++```mermaid+classDiagram+ class DocumentParser {+ +parse(documents)+ +register_parser(format, parser)+ }+ class PDFParser {+ +extract_text()+ +extract_tables()+ }+ class JSONParser {+ +flatten()+ +extract_schema()+ }+ DocumentParser *-- PDFParser+ DocumentParser *-- JSONParser+```+```pythonfrom semantica.parse import DocumentParserparser = DocumentParser()-parsed_docs = parser.parse(documents)+parsed_docs = parser.parse(documents) # (1)```+1. Automatically detects the file type of each document and routes it to the appropriate specialized parser (e.g., PDFParser for .pdf).+### 3. Normalize Module**Purpose**: Clean and normalize text for processing.@@ -152,18 +197,42 @@ The `kg` module constructs the graph from extracted entities and relationships,- `TemporalQuery`: Query temporal knowledge graphs- `Deduplicator`: Remove duplicate entities/relationships+ - `Deduplicator`: Remove duplicate entities/relationships++```mermaid+classDiagram+ class GraphBuilder {+ +build(entities, relations)+ +merge_nodes()+ }+ class GraphAnalyzer {+ +compute_centrality()+ +detect_communities()+ }+ class KnowledgeGraph {+ +nodes: List+ +edges: List+ +query(cypher)+ }+ GraphBuilder ..> KnowledgeGraph : Creates+ GraphAnalyzer ..> KnowledgeGraph : Analyzes+```+```pythonfrom semantica.kg import GraphBuilder, GraphAnalyzer# Build graphbuilder = GraphBuilder()-kg = builder.build(entities, relationships)+kg = builder.build(entities, relationships) # (1)# Analyze graphanalyzer = GraphAnalyzer()-metrics = analyzer.analyze(kg)+metrics = analyzer.analyze(kg) # (2)```+1. Constructs a NetworkX or Neo4j graph from the extracted entities and relationships, handling node merging and edge attributes.+2. Computes graph-theoretic metrics like density, diameter, and centrality to assess the quality and structure of the knowledge graph.+### 6. Embeddings Module**Purpose**: Generate vector embeddings for various data types.diff --git a/docs/use-cases.md b/docs/use-cases.mdindex d85d8403..8d7bc4eb 100644--- a/docs/use-cases.md+++ b/docs/use-cases.md@@ -56,6 +56,38 @@ Semantica is designed to solve complex data challenges across various domains. T</div>+### π Financial Data Pipeline Architecture++```mermaid+graph LR+ subgraph Sources+ N[News Feeds]+ M[Market Data]+ R[Reports]+ end++ subgraph Processing+ NER[Entity Extraction]+ SA[Sentiment Analysis]+ TC[Trend Correlation]+ end++ subgraph Knowledge+ KG[Financial KG]+ Signals[Alpha Signals]+ end++ Sources --> NER+ Sources --> SA+ NER --> KG+ SA --> KG+ KG --> TC+ TC --> Signals++ style KG fill:#e8f5e9,stroke:#2e7d32+ style Signals fill:#fff3e0,stroke:#ef6c00+```+---## π₯ Healthcare & Life Sciences@@ -108,6 +140,34 @@ Semantica is designed to solve complex data challenges across various domains. T</div>+### π‘οΈ Threat Intelligence Architecture++```mermaid+graph TD+ subgraph Ingest+ F[Threat Feeds]+ L[System Logs]+ end++ subgraph Analysis+ P[Pattern Match]+ A[Anomaly Detect]+ end++ subgraph Response+ G[Threat Graph]+ Alert[Alert System]+ end++ F --> P+ L --> A+ P --> G+ A --> G+ G --> Alert++ style G fill:#ffebee,stroke:#c62828+```+---## π Industry & Operations