mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
- Migrate from mint.json to docs.json (Mintlify v4) - Theme: maple, emerald green + near-black dark / cream light palette (#059669 primary, #0A0A0A dark bg, #FAF7F0 light bg) - Typography: Lexend headings, Inter body - 5-tab navigation: Documentation, Quick Start, API Reference, Cookbook, FAQ - Homepage: removed badge stickers, redundant h2, added blockquote tagline, full 27-module reference table with semantica.mcp_server added - quickstart.md: CodeGroup per pipeline step, pattern vs LLM options, AccordionGroup for patterns and troubleshooting - faq.md: full AccordionGroup structure across 5 sections - reference/explorer.md: NEW — FastAPI explorer, Ontology Hub, Distance Intelligence, CLI reference, REST API endpoints - reference/mcp_server.md: NEW — MCP stdio server, 12 tools with I/O examples, 3 resources, Claude Desktop/VS Code/Windsurf/Cline config - docs.json: explorer added to Output group, mcp_server to Utilities group - Chat, feedback (thumbs/suggest/raise), OG/Twitter metadata, search topbar - All reference pages reformatted with Mintlify JSX components Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5.1 KiB
5.1 KiB
title, description, icon
| title | description | icon |
|---|---|---|
| Getting Started | The context and intelligence layer for AI — turning raw data into explainable, auditable knowledge graphs. | rocket |
What You Can Build
Enhanced retrieval with semantic graph reasoning — ground LLM responses in traceable, structured knowledge. Agents with structured decision history, causal chains, and precedent search. Every choice is recorded and auditable. Build, validate, and maintain enterprise-grade semantic knowledge bases from multi-source data. W3C PROV-O provenance on every fact. HIPAA, SOX, GDPR, FDA 21 CFR Part 11 infrastructure built in.Installation
pip install semantica
With all optional dependencies:
pip install semantica[all]
Verify:
import semantica
print(semantica.__version__)
Quick Start
from semantica.ingest import FileIngestor
from semantica.parse import DocumentParser
from semantica.semantic_extract import NERExtractor, RelationExtractor
from semantica.kg import GraphBuilder
# Ingest → Parse → Extract → Build
ingestor = FileIngestor()
sources = ingestor.ingest("data/sample.pdf")
parser = DocumentParser()
parsed = parser.parse(sources[0])
ner = NERExtractor()
entities = ner.extract(parsed)
rel = RelationExtractor()
relationships = rel.extract(parsed, entities=entities)
graph = GraphBuilder(merge_entities=True).build(
entities=entities, relationships=relationships
)
print(f"{len(graph.nodes)} nodes, {len(graph.edges)} edges")
from semantica.context import AgentContext, ContextGraph
from semantica.vector_store import VectorStore
context = AgentContext(
vector_store=VectorStore(backend="faiss", dimension=768),
knowledge_graph=ContextGraph(advanced_analytics=True),
decision_tracking=True,
)
# Store a memory with provenance
context.store("GPT-4 outperforms GPT-3.5 on reasoning benchmarks by 40%")
# Record a decision with causal chain
decision_id = context.record_decision(
category="model_selection",
scenario="Choose LLM for production pipeline",
reasoning="GPT-4 benchmark advantage justifies cost increase",
outcome="selected_gpt4",
confidence=0.91,
)
# Find similar past decisions
precedents = context.find_precedents("model selection", limit=5)
from semantica.context import AgentContext, ContextGraph
from semantica.vector_store import VectorStore
from semantica.reasoning import ReasoningEngine
context = AgentContext(
vector_store=VectorStore(backend="faiss", dimension=768),
knowledge_graph=ContextGraph(advanced_analytics=True),
)
# Load your knowledge graph
context.load_graph("company_kg.json")
# Multi-hop GraphRAG query
result = context.query(
"What companies were founded by people who worked at Apple?",
mode="graphrag",
reasoning=True,
)
# Every claim links back to a source node
for claim in result.claims:
print(f"{claim.text} → source: {claim.source_node}")
Core Architecture
Semantica uses a modular, layered architecture — import only what you need.
| Layer | Modules | Purpose |
|---|---|---|
| Input | ingest, parse, split, normalize |
Load and prepare data |
| Semantic | semantic_extract, kg, ontology, reasoning |
Extract meaning |
| Storage | embeddings, vector_store, graph_store |
Persist knowledge |
| Quality | deduplication, conflicts |
Validate and clean |
| Context | context, provenance, change_management |
Track decisions and lineage |
| Output | export, visualization, pipeline |
Deliver results |