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
Update README: Add Docling, AWS Neptune, and custom ontology support mentions. Remove metrics and accuracy claims. Tone down promotional language.
KaifAhmad1a3e3b3cc2be2
diff --git a/README.md b/README.mdindex 82a4e01f..ad47ee60 100644--- a/README.md+++ b/README.md@@ -1,5 +1,3 @@-<div align="center">-<img src="semantica_logo.png" alt="Semantica Logo" width="460"/># π§ Semantica@@ -17,22 +15,16 @@> **Transform Choas into Intelligence. Build AI systems that are explainable and trustworthy β not black boxes.**-</div>----## π Why Semantica?-<div align="center">-### Transform Black-Box AI into Trustworthy, Explainable Systems**Semantica** bridges the **semantic gap** between text similarity and true meaning. It's the **semantic intelligence layer** that makes your AI agents auditable, explainable, and compliant.Perfect for **high-stakes domains** where mistakes have real consequences.-</div>----### β‘ Get Started in 30 Seconds@@ -53,26 +45,18 @@ kg = GraphBuilder().build({"entities": entities, "relationships": []})print(f"Built KG with {len(kg.get('entities', []))} entities")```-<div align="center">-**[π Full Quick Start](#-quick-start)** β’ **[π³ Cookbook Examples](#-semantica-cookbook)** β’ **[π¬ Join Discord](https://discord.gg/RgaGTj9J)** β’ **[β Star Us](https://github.com/Hawksight-AI/semantica)**-</div>----## Core Value Proposition-<div align="center">-| **Trustworthy** | **Explainable** | **Auditable** ||:------------------:|:------------------:|:-----------------:|| Conflict detection & validation | Transparent reasoning paths | Complete provenance tracking || Rule-based governance | Entity relationships & ontologies | Source-level provenance || Production-grade QA | Multi-hop graph reasoning | Audit-ready compliance |-</div>----## Key Features & Benefits@@ -81,8 +65,6 @@ print(f"Built KG with {len(kg.get('entities', []))} entities")**Semantica complements** LangChain, LlamaIndex, AutoGen, CrewAI, Google ADK, Agno, and other frameworks to enhance your agents with:-<div align="center">-| Feature | Benefit ||:--------|:--------|| **Auditable** | Complete provenance tracking with full audit trails |@@ -91,12 +73,8 @@ print(f"Built KG with {len(kg.get('entities', []))} entities")| **Validated** | Built-in conflict detection, deduplication, QA || **Governed** | Rule-based validation and semantic consistency |-</div>-### Perfect For High-Stakes Use Cases-<div align="center">-| π₯ **Healthcare** | π° **Finance** | βοΈ **Legal** ||:-----------------:|:--------------:|:------------:|| Clinical decisions | Fraud detection | Evidence-backed research |@@ -108,15 +86,19 @@ print(f"Built KG with {len(kg.get('entities', []))} entities")| Threat attribution | Policy decisions | Power grids | Decision logs || Incident response | Classified info | Transportation | Safety validation |-</div>-### Powers Your AI Stack-- **GraphRAG Systems** β Enhanced retrieval with graph reasoning (30% accuracy improvement)-- **AI Agents** β Trustworthy, accountable multi-agent systems+- **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 for compliance+### Integrations++- **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)+> **Built for environments where every answer must be explainable and governed.**@@ -124,12 +106,8 @@ print(f"Built KG with {len(kg.get('entities', []))} entities")## π¨ The Problem: The Semantic Gap-<div align="center">-### Most AI systems fail in high-stakes domains because they operate on **text similarity**, not **meaning**.-</div>-### Understanding the Semantic GapThe **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).@@ -152,8 +130,6 @@ The **semantic gap** is the fundamental disconnect between what AI systems can p### What Organizations Have vs What They Need-<div align="center">-| **Current State** | **Required for High-Stakes AI** ||:---------------------|:-----------------------------------|| PDFs, DOCX, emails, logs | Formal domain rules (ontologies) |@@ -163,8 +139,6 @@ The **semantic gap** is the fundamental disconnect between what AI systems can p| | **Source-level provenance** || | **Audit-ready compliance** |-</div>-### The Cost of Missing Semantics- **Decisions cannot be explained** β No transparency in AI reasoning@@ -172,18 +146,12 @@ The **semantic gap** is the fundamental disconnect between what AI systems can p- **Conflicts go undetected** β Contradictory information causes failures- **Compliance becomes impossible** β No audit trails for regulations-<div align="center">-**Trustworthy AI requires semantic accountability.**-</div>----## π Semantica vs Traditional RAG-<div align="center">-| Feature | Traditional RAG | Semantica ||:--------|:----------------|:----------|| **Reasoning** | β Black-box answers | β Explainable reasoning paths |@@ -193,16 +161,15 @@ The **semantic gap** is the fundamental disconnect between what AI systems can p| **Safety** | β οΈ Unsafe for high-stakes | β Designed for governed environments || **Compliance** | β No audit trails | β Audit-ready provenance |-</div>----## π§© Semantica Architecture### 1οΈβ£ Input Layer β Governed Ingestion-- π **Multiple Formats** β PDFs, DOCX, HTML, JSON, CSV-- πΎ **Data Sources** β Databases, APIs, streams, archives-- π¨ **Multi-Modal** β Text, images, structured data+- π **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@@ -216,8 +183,9 @@ The **semantic gap** is the fundamental disconnect between what AI systems can p### 3οΈβ£ Output Layer β Auditable Knowledge Assets- π **Knowledge Graphs** β Queryable, temporal, explainable-- π **OWL Ontologies** β HermiT/Pellet validated+- π **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@@ -319,7 +287,7 @@ print(f" Ingested {len(sources)} sources")### Document Parsing & Processing-> **Multi-format parsing** β’ **Text normalization** β’ **Intelligent chunking**+> **Multi-format parsing** β’ **Docling Support** β’ **Text normalization** β’ **Intelligent chunking**```pythonfrom semantica.parse import DocumentParser, DoclingParser@@ -330,7 +298,7 @@ from semantica.split import TextSplitterparser = DocumentParser()parsed = parser.parse("document.pdf", format="auto")-# Enhanced parsing with Docling (recommended for complex layouts/tables)+# Parsing with Docling (for complex layouts/tables)# Requires: pip install doclingdocling_parser = DoclingParser(enable_ocr=True)result = docling_parser.parse("complex_table.pdf")@@ -421,7 +389,7 @@ results = vector_store.search(query="supply chain", top_k=5)### Graph Store & Triplet Store-> **Neo4j, FalkorDB, Amazon Neptune support** β’ **SPARQL queries** β’ **RDF triplets**+> **Neo4j, FalkorDB, Amazon Neptune** β’ **SPARQL queries** β’ **RDF triplets**```pythonfrom semantica.graph_store import GraphStore@@ -459,15 +427,19 @@ results = triplet_store.execute_query("SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT### Ontology Generation & Management-> **6-Stage LLM Pipeline** β’ Automatic OWL Generation β’ HermiT/Pellet Validation+> **6-Stage LLM Pipeline** β’ Automatic OWL Generation β’ HermiT/Pellet Validation β’ **Custom Ontology Import** (OWL, RDF, Turtle, JSON-LD)```pythonfrom semantica.ontology import OntologyGenerator+from semantica.ingest import ingest_ontology+# Generate ontology automaticallygenerator = OntologyGenerator(llm_provider="openai", model="gpt-4")ontology = generator.generate_from_documents(sources=["domain_docs/"])-print(f"Classes: {len(ontology.classes)}")+# Or import your existing ontology+custom_ontology = ingest_ontology("my_ontology.ttl") # Supports OWL, RDF, Turtle, JSON-LD+print(f"Classes: {len(custom_ontology.classes)}")```[**Cookbook: Ontology**](https://github.com/Hawksight-AI/semantica/tree/main/cookbook/introduction/14_Ontology.ipynb)@@ -537,7 +509,7 @@ reasoned_result = context.query_with_reasoning(### Knowledge Graph-Powered RAG (GraphRAG)-> **30% Accuracy Improvement** β’ Vector + Graph Hybrid Search β’ 91% Accuracy β’ **Multi-Hop Reasoning** β’ **LLM-Generated Responses**+> **Vector + Graph Hybrid Search** β’ **Multi-Hop Reasoning** β’ **LLM-Generated Responses** β’ **Semantic Re-ranking**```pythonfrom semantica.context import AgentContext@@ -586,7 +558,7 @@ print(f"Confidence: {result['confidence']:.3f}")from semantica.llms import Groq, OpenAI, HuggingFaceLLM, LiteLLMimport os-# Groq - Fast inference+# Groqgroq = Groq(model="llama-3.1-8b-instant",api_key=os.getenv("GROQ_API_KEY")@@ -616,7 +588,7 @@ structured = groq.generate_structured("Extract entities from: Apple Inc. was fou```**Supported Providers:**-- **Groq**: Fast inference with Llama models+- **Groq**: Inference with Llama models- **OpenAI**: GPT-3.5, GPT-4, and other OpenAI models- **HuggingFace**: Local LLM inference with Transformers- **LiteLLM**: Unified interface to 100+ LLM providers (OpenAI, Anthropic, Azure, Bedrock, Vertex AI, and more)@@ -816,7 +788,7 @@ print(f"Found {len(results)} results")#### Cybersecurity- [**Real-Time Anomaly Detection**](cookbook/use_cases/cybersecurity/01_Real_Time_Anomaly_Detection.ipynb) - CVE RSS, Kafka streams, temporal KGs, sentence chunking-- [**Threat Intelligence Hybrid RAG**](cookbook/use_cases/cybersecurity/02_Threat_Intelligence_Hybrid_RAG.ipynb) - Security RSS, entity-aware chunking, enhanced GraphRAG, deduplication+- [**Threat Intelligence Hybrid RAG**](cookbook/use_cases/cybersecurity/02_Threat_Intelligence_Hybrid_RAG.ipynb) - Security RSS, entity-aware chunking, GraphRAG, deduplication#### Intelligence & Law Enforcement- [**Criminal Network Analysis**](cookbook/use_cases/intelligence/01_Criminal_Network_Analysis.ipynb) - OSINT RSS, deduplication, network centrality, graph analytics@@ -833,12 +805,16 @@ print(f"Found {len(results)} results")## π¬ Advanced Features+**Docling Integration** β Document parsing with table extraction for PDFs, DOCX, PPTX, and XLSX files. Supports OCR and multiple export formats.++**AWS Neptune Support** β Amazon Neptune graph database integration with IAM authentication and OpenCypher queries.++**Custom Ontology Import** β Import existing ontologies (OWL, RDF, Turtle, JSON-LD, N3) and extend Schema.org, FOAF, Dublin Core, or custom ontologies.+**Incremental Updates** β Real-time stream processing with Kafka, RabbitMQ, Kinesis for live updates.**Multi-Language Support** β Process multiple languages with automatic detection.-**Custom Ontology Import** β Import and extend Schema.org and custom ontologies.-**Advanced Reasoning** β Forward/backward chaining, Rete-based pattern matching, and automated explanation generation.**Graph Analytics** β Centrality, community detection, path finding, temporal analysis.@@ -938,10 +914,6 @@ git push origin feature/your-featureSemantica is licensed under the **MIT License** - see the [LICENSE](https://github.com/Hawksight-AI/semantica/blob/main/LICENSE) file for details.-<div align="center">-**Built by the Semantica Community**[GitHub](https://github.com/Hawksight-AI/semantica) β’ [Discord](https://discord.gg/pMHguUzG)--</div>