# semantica-agi/semantica architecture

> Architecture diagram of the GitHub repository semantica-agi/semantica, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/semantica-agi/semantica
- Repository: https://github.com/semantica-agi/semantica

## Overview

Semantica is graph-native infrastructure for turning enterprise data into governed context and knowledge graphs, then querying them for reasoning, decisions, and auditable provenance. The documented user workflow is ingest, extract and model data, build/query graphs, and inspect results through the Knowledge Explorer; optional ontology, memory, and agent-tool capabilities extend that core. Relationships are cited to the README where it documents product-level flows, or to indexed source references where they show module connections; unsampled route behavior is not inferred beyond those references.

Main entry points: [`semantica/explorer/app.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/app.py) (Explorer API), [`semantica/kg/knowledge_graph.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/kg/knowledge_graph.py) (Knowledge graph), [`semantica/context/context_graph.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/context/context_graph.py) (Context graph), [`semantica/explorer/markdown_resources.py`](https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/markdown_resources.py) (Markdown resources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_acquisition["Data acquisition"]
  node_ingest["Data ingestion"]
  node_parse_extract["Parse and extract"]
  node_pipeline["Pipeline execution"]
end

subgraph group_modeling["Knowledge modeling"]
  node_ontology["Ontology engine<br/>[engine.py]"]
  node_kg["Knowledge graph<br/>[knowledge_graph.py]"]
  node_graph_store[("Graph storage")]
  node_triplet_store[("RDF storage and query<br/>[query_engine.py]")]
end

subgraph group_context["Context and reasoning"]
  node_context_graph["Context graph<br/>[context_graph.py]"]
  node_memory["Agent memory<br/>[agent_memory.py]"]
  node_reasoner["Deterministic reasoning<br/>[reasoner.py]"]
  node_decision["Decision context"]
end

subgraph group_governance["Trust and governance"]
  node_provenance["Provenance tracking<br/>[manager.py]"]
  node_provenance_store[("Provenance storage<br/>[storage.py]")]
end

subgraph group_explorer["Knowledge Explorer"]
  node_explorer_ui["Explorer workspaces<br/>[App.tsx]"]
  node_explorer_api["Explorer API<br/>[app.py]"]
  node_explorer_graph["Graph API routes<br/>[graph.py]"]
  node_explorer_ontology["Ontology API routes<br/>[ontology.py]"]
  node_explorer_enrich["Enrichment routes<br/>[enrich.py]"]
  node_markdown_resources["Markdown resources"]
end

node_engineer(("Data / AI engineer"))

node_engineer -->|"provides data"| node_ingest
node_ingest -->|"feeds extraction"| node_parse_extract
node_parse_extract -->|"builds graph"| node_kg
node_pipeline -.->|"orchestrates workflows"| node_ingest
node_ontology -->|"queries and validates"| node_triplet_store
node_kg -.->|"uses graph storage"| node_graph_store
node_kg -.->|"exports to RDF"| node_triplet_store
node_context_graph -->|"integrates graph analytics"| node_kg
node_reasoner -.->|"reasons over context"| node_context_graph
node_decision -.->|"records decisions"| node_context_graph
node_decision -.->|"tracks decision history"| node_provenance
node_provenance -->|"persists records"| node_provenance_store
node_engineer -->|"explores results"| node_explorer_ui
node_explorer_ui -.->|"uses API"| node_explorer_api
node_explorer_api -->|"registers routes"| node_explorer_graph
node_explorer_api -->|"registers routes"| node_explorer_ontology
node_explorer_api -->|"registers routes"| node_explorer_enrich
node_explorer_api -->|"initializes resources"| node_markdown_resources
node_markdown_resources -->|"adapts Markdown access"| node_context_graph
node_markdown_resources -->|"adapts Markdown access"| node_memory

click node_ingest "https://github.com/semantica-agi/semantica/tree/main/semantica/ingest"
click node_parse_extract "https://github.com/semantica-agi/semantica/tree/main/semantica/semantic_extract"
click node_pipeline "https://github.com/semantica-agi/semantica/blob/main/semantica/pipeline/execution_engine.py"
click node_ontology "https://github.com/semantica-agi/semantica/blob/main/semantica/ontology/engine.py"
click node_kg "https://github.com/semantica-agi/semantica/blob/main/semantica/kg/knowledge_graph.py"
click node_graph_store "https://github.com/semantica-agi/semantica/tree/main/semantica/graph_store"
click node_triplet_store "https://github.com/semantica-agi/semantica/blob/main/semantica/triplet_store/query_engine.py"
click node_context_graph "https://github.com/semantica-agi/semantica/blob/main/semantica/context/context_graph.py"
click node_memory "https://github.com/semantica-agi/semantica/blob/main/semantica/context/agent_memory.py"
click node_reasoner "https://github.com/semantica-agi/semantica/blob/main/semantica/reasoning/reasoner.py"
click node_decision "https://github.com/semantica-agi/semantica/blob/main/semantica/context/decision_context.py"
click node_provenance "https://github.com/semantica-agi/semantica/blob/main/semantica/provenance/manager.py"
click node_provenance_store "https://github.com/semantica-agi/semantica/blob/main/semantica/provenance/storage.py"
click node_explorer_ui "https://github.com/semantica-agi/semantica/blob/main/explorer/src/App.tsx"
click node_explorer_api "https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/app.py"
click node_explorer_graph "https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/routes/graph.py"
click node_explorer_ontology "https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/routes/ontology.py"
click node_explorer_enrich "https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/routes/enrich.py"
click node_markdown_resources "https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/markdown_resources.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ingest,node_parse_extract,node_pipeline toneBlue
class node_ontology,node_kg,node_graph_store,node_triplet_store toneAmber
class node_context_graph,node_memory,node_reasoner,node_decision toneMint
class node_provenance,node_provenance_store toneRose
class node_explorer_ui,node_explorer_api,node_explorer_graph,node_explorer_ontology,node_explorer_enrich,node_markdown_resources,node_engineer toneIndigo
```

## Components

### Data acquisition

- [Data ingestion](https://github.com/semantica-agi/semantica/tree/main/semantica/ingest): `semantica/ingest`
- [Parse and extract](https://github.com/semantica-agi/semantica/tree/main/semantica/semantic_extract): `semantica/semantic_extract`
- [Pipeline execution](https://github.com/semantica-agi/semantica/blob/main/semantica/pipeline/execution_engine.py): `semantica/pipeline/execution_engine.py`

### Knowledge modeling

- [Ontology engine](https://github.com/semantica-agi/semantica/blob/main/semantica/ontology/engine.py): `semantica/ontology/engine.py`
- [Knowledge graph](https://github.com/semantica-agi/semantica/blob/main/semantica/kg/knowledge_graph.py): `semantica/kg/knowledge_graph.py`
- [Graph storage](https://github.com/semantica-agi/semantica/tree/main/semantica/graph_store): `semantica/graph_store`
- [RDF storage and query](https://github.com/semantica-agi/semantica/blob/main/semantica/triplet_store/query_engine.py): `semantica/triplet_store/query_engine.py`

### Context and reasoning

- [Context graph](https://github.com/semantica-agi/semantica/blob/main/semantica/context/context_graph.py): `semantica/context/context_graph.py`
- [Agent memory](https://github.com/semantica-agi/semantica/blob/main/semantica/context/agent_memory.py): `semantica/context/agent_memory.py`
- [Deterministic reasoning](https://github.com/semantica-agi/semantica/blob/main/semantica/reasoning/reasoner.py): `semantica/reasoning/reasoner.py`
- [Decision context](https://github.com/semantica-agi/semantica/blob/main/semantica/context/decision_context.py): `semantica/context/decision_context.py`

### Trust and governance

- [Provenance tracking](https://github.com/semantica-agi/semantica/blob/main/semantica/provenance/manager.py): `semantica/provenance/manager.py`
- [Provenance storage](https://github.com/semantica-agi/semantica/blob/main/semantica/provenance/storage.py): `semantica/provenance/storage.py`

### Knowledge Explorer

- [Explorer workspaces](https://github.com/semantica-agi/semantica/blob/main/explorer/src/App.tsx): `explorer/src/App.tsx`
- [Explorer API](https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/app.py): `semantica/explorer/app.py`
- [Graph API routes](https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/routes/graph.py): `semantica/explorer/routes/graph.py`
- [Ontology API routes](https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/routes/ontology.py): `semantica/explorer/routes/ontology.py`
- [Enrichment routes](https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/routes/enrich.py): `semantica/explorer/routes/enrich.py`
- [Markdown resources](https://github.com/semantica-agi/semantica/blob/main/semantica/explorer/markdown_resources.py): `semantica/explorer/markdown_resources.py`

### Other components

- **Data / AI engineer**

## Connections

- Data / AI engineer → Data ingestion: provides data (evidence: `README.md`)
- Data ingestion → Parse and extract: feeds extraction (evidence: `README.md`)
- Parse and extract → Knowledge graph: builds graph (evidence: `README.md`)
- Pipeline execution → Data ingestion: orchestrates workflows
- Ontology engine → RDF storage and query: queries and validates (evidence: `semantica/ontology/engine.py`)
- Knowledge graph → Graph storage: uses graph storage
- Knowledge graph → RDF storage and query: exports to RDF
- Context graph → Knowledge graph: integrates graph analytics (evidence: `semantica/context/context_graph.py`)
- Deterministic reasoning → Context graph: reasons over context
- Decision context → Context graph: records decisions
- Decision context → Provenance tracking: tracks decision history
- Provenance tracking → Provenance storage: persists records (evidence: `semantica/provenance/manager.py`)
- Data / AI engineer → Explorer workspaces: explores results (evidence: `README.md`)
- Explorer workspaces → Explorer API: uses API
- Explorer API → Graph API routes: registers routes (evidence: `semantica/explorer/app.py`)
- Explorer API → Ontology API routes: registers routes (evidence: `semantica/explorer/app.py`)
- Explorer API → Enrichment routes: registers routes (evidence: `semantica/explorer/app.py`)
- Explorer API → Markdown resources: initializes resources (evidence: `semantica/explorer/app.py`)
- Markdown resources → Context graph: adapts Markdown access (evidence: `semantica/explorer/markdown_resources.py`)
- Markdown resources → Agent memory: adapts Markdown access (evidence: `semantica/explorer/markdown_resources.py`)
