Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

docs: fix broken extension point and explorer examples

KaifAhmad1ff2d89dc2de6
diff --git a/docs/architecture.md b/docs/architecture.md
index 6c4d0a72..9cb9a2ff 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -111,34 +111,40 @@ Deliver → GraphRAG, agents, export, visualization
<CodeGroup>
```python Custom Ingestor
-from semantica.ingest import BaseIngestor
+from semantica.ingest.registry import method_registry
-class CustomIngestor(BaseIngestor):
- def ingest(self, source: str) -> list[dict]:
- # Return a list of document dicts with 'text', 'metadata', 'source'
- return [{"text": "...", "metadata": {}, "source": source}]
+def custom_file_ingestor(source):
+ # Return a list of document dicts with 'text', 'metadata', 'source'
+ return [{"text": "...", "metadata": {}, "source": source}]
+
+# Register under the "file" task category with a unique name
+method_registry.register("file", "my_custom_format", custom_file_ingestor)
+
+# Verify registration
+available = method_registry.list_all("file")
```
```python Custom Extractor
-from semantica.semantic_extract import BaseExtractor
+from semantica.semantic_extract.registry import method_registry
-class CustomExtractor(BaseExtractor):
- def extract(self, text: str) -> list[dict]:
- # Return a list of entity dicts with 'text', 'type', 'confidence'
- return [{"text": "...", "type": "CUSTOM_TYPE", "confidence": 0.9}]
+def custom_entity_extractor(text, config=None):
+ # Return a list of entity dicts with 'text', 'type', 'confidence'
+ return [{"text": "...", "type": "CUSTOM_TYPE", "confidence": 0.9}]
+
+# Register under the "entity" extraction task
+method_registry.register("entity", "my_extractor", custom_entity_extractor)
```
```python Custom Plugin
-from semantica.core import PluginRegistry, BasePlugin
-
-class MyPlugin(BasePlugin):
- name = "my_plugin"
+from semantica.core import PluginRegistry
+class MyPlugin:
def process(self, graph, config):
# Modify the graph in place
return graph
-PluginRegistry.register(MyPlugin)
+registry = PluginRegistry()
+registry.register_plugin("my_plugin", MyPlugin, version="1.0.0")
```
</CodeGroup>
diff --git a/docs/reference/explorer.md b/docs/reference/explorer.md
index 6367a438..d4f2c394 100644
--- a/docs/reference/explorer.md
+++ b/docs/reference/explorer.md
@@ -34,15 +34,15 @@ semantica-explorer --graph my_graph.json --no-browser
```
```python Python
+import subprocess
from semantica.context import ContextGraph
-from semantica.explorer import start_explorer
graph = ContextGraph(advanced_analytics=True)
# ... build or load your graph ...
-graph.save("my_graph.json")
+graph.save_to_file("my_graph.json")
-# Launch the dashboard
-start_explorer(graph_path="my_graph.json", port=8000)
+# Launch the dashboard via CLI
+subprocess.run(["semantica-explorer", "--graph", "my_graph.json", "--port", "8000"])
```
```python Module