Skip to content

Commit 12d61b9

Browse files
authored
docs: add Temporal & Distance Intelligence reference pages with accurate API (#650)
- Add docs/reference/temporal.md: full Temporal Intelligence reference covering bi-temporal model (TemporalBound.OPEN sentinel, BiTemporalFact.from_relationship() factory), TemporalGraphQuery (query_at_time, reconstruct_at_time, query_time_range, find_temporal_paths, analyze_evolution, validate_temporal_consistency), TemporalPatternDetector, TemporalReasoningEngine with all 13 Allen interval relations over TemporalInterval objects, TemporalNormalizer (returns Optional[Tuple[datetime, datetime]]), TemporalQueryRewriter.rewrite() returning TemporalQueryResult, and TemporalVersionManager with SQLite storage and correct method names (list_versions, compare_versions, get_version, apply_revision, validate_snapshot, verify_checksum) - Add docs/reference/distance.md: Distance Intelligence reference with corrected SimilarityCalculator API (pairwise_similarity, batch_similarity, find_most_similar) and semantic neighborhood / proximity-blended retrieval patterns - Update docs/reference/kg.md: expand Exported Classes table to include all TemporalPatternDetector, TemporalInterval, IntervalRelation, TemporalQueryResult, AlgorithmTrackerWithProvenance, AlgorithmRegistry, ProvenanceTracker, SeedManager, KGConfig; fix all temporal code examples to use correct constructors and method names - Update docs/reference/context.md: add Distance Intelligence section - Update docs/index.md: add v0.3.0 release accordion with feature highlights - Update docs/docs.json: wire temporal and distance pages into Modules navigation
1 parent 0765cfe commit 12d61b9

6 files changed

Lines changed: 1793 additions & 32 deletions

File tree

docs/docs.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
"pages": [
121121
"reference/context",
122122
"reference/kg",
123+
"reference/temporal",
124+
"reference/distance",
123125
"reference/semantic_extract",
124126
"reference/reasoning",
125127
"reference/ontology"

docs/index.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ If your stack can't answer those questions with a traceable record, you have a g
1515

1616
**Semantica closes that gap.** It's the context and accountability layer that sits beneath your existing agent framework: not a replacement for LangChain or LlamaIndex, but the infrastructure that makes their outputs trustworthy.
1717

18-
<div style={{display:"flex",flexWrap:"wrap",gap:"3rem",margin:"2rem 0",padding:"1.5rem 2rem",borderRadius:"10px",border:"1px solid rgba(16,185,129,0.2)",background:"rgba(16,185,129,0.03)"}}>
18+
<div style={{display:"flex",flexWrap:"wrap",gap:"2rem",margin:"2rem 0",padding:"1.5rem 2rem",borderRadius:"10px",border:"1px solid rgba(16,185,129,0.2)",background:"rgba(16,185,129,0.03)"}}>
1919
<div><div style={{fontSize:"1.75rem",fontWeight:700,color:"#10B981",lineHeight:1.1}}>1,000+</div><div style={{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"}}>passing tests</div></div>
20-
<div><div style={{fontSize:"1.75rem",fontWeight:700,color:"#10B981",lineHeight:1.1}}>25+</div><div style={{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"}}>modules</div></div>
21-
<div><div style={{fontSize:"1.75rem",fontWeight:700,color:"#10B981",lineHeight:1.1}}>12</div><div style={{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"}}>LLM providers</div></div>
20+
<div><div style={{fontSize:"1.75rem",fontWeight:700,color:"#10B981",lineHeight:1.1}}>29</div><div style={{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"}}>modules</div></div>
21+
<div><div style={{fontSize:"1.75rem",fontWeight:700,color:"#10B981",lineHeight:1.1}}>13</div><div style={{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"}}>LLM providers</div></div>
22+
<div><div style={{fontSize:"1.75rem",fontWeight:700,color:"#10B981",lineHeight:1.1}}>6,000×</div><div style={{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"}}>search speedup</div></div>
23+
<div><div style={{fontSize:"1.75rem",fontWeight:700,color:"#10B981",lineHeight:1.1}}>109</div><div style={{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"}}>REST endpoints</div></div>
2224
<div><div style={{fontSize:"1.75rem",fontWeight:700,color:"#10B981",lineHeight:1.1}}>MIT</div><div style={{fontSize:"0.8rem",color:"rgba(255,255,255,0.5)",marginTop:"4px"}}>open source</div></div>
2325
</div>
2426

@@ -300,11 +302,37 @@ pip install semantica==0.5.0
300302

301303
<Accordion title="v0.4.0: Temporal Intelligence & Knowledge Explorer" icon="clock">
302304

303-
- **Temporal Intelligence** — 6-PR system: temporal data model, point-in-time queries, Allen interval algebra (all 13 relations), OWL-Time export
304-
- **Knowledge Explorer API** — Full FastAPI backend: 99 tests, 12 export formats, WebSocket progress, thread-safe sessions, audit trail
305-
- **Ontology Foundations** — SHACL generation/validation, SKOS vocabulary, ontology alignment API, diff & migration tooling
305+
Released **April 8, 2026**
306+
307+
- **Temporal Intelligence** — Bi-temporal data model (`BiTemporalFact`, `TemporalBound`), point-in-time query engine, Allen interval algebra (all 13 relations), `TemporalNormalizer` (zero LLM calls), `TemporalQueryRewriter`, OWL-Time export
308+
- **Knowledge Explorer API** — Full FastAPI backend: 99 integration tests, 12 export formats, WebSocket progress, thread-safe `RLock` sessions, audit trail, rollback protection
309+
- **Ontology Foundations** — SHACL generation/validation (basic/standard/strict tiers), SKOS vocabulary, ontology alignment API, diff & migration with change impact analysis
306310
- **Datalog Reasoning** — Pure-Python bottom-up semi-naive fixpoint, recursive Horn clause rules, guaranteed termination
307311
- **Agno Integration** — 5 components: graph-backed memory, multi-hop GraphRAG, decision toolkit, KG toolkit, shared team context; 110 tests
312+
- **Novita AI provider** — OpenAI-compatible provider for 200+ open-weight models
313+
314+
```bash
315+
pip install semantica==0.4.0
316+
```
317+
318+
</Accordion>
319+
320+
<Accordion title="v0.3.0: Context Graph Features & Decision Intelligence" icon="brain">
321+
322+
Released **March 10, 2026**
323+
324+
- **Context Graph completeness**`valid_from`/`valid_until` on every node, `find_active_nodes()` temporal filtering, `get_neighbors(min_weight)` confidence-filtered traversal
325+
- **Cross-graph navigation**`link_graph()`, `navigate_to()`, `resolve_links()`, `cross_graph_path()` for multi-graph agent architectures
326+
- **Decision tracking system** — Full lifecycle: `record_decision()``add_causal_relationship()``find_similar_decisions()``trace_decision_chain()``analyze_decision_impact()``check_decision_rules()``get_decision_insights()`
327+
- **Advanced KG algorithms** — Node2Vec embeddings, betweenness / closeness / eigenvector centrality, Louvain community detection
328+
- **Policy management** — Versioned policy storage with policy exception tracking and approver audit trail
329+
- **Vector store** — Hybrid search (dense + sparse), PgVector HNSW/IVFFlat indexing with JSONB metadata filtering
330+
- **Apache AGE backend** — Full graph store support for PostgreSQL-native AGE graphs
331+
- **ResourceScheduler fix**`RLock` deadlock fix for concurrent agent pipelines
332+
333+
```bash
334+
pip install semantica==0.3.0
335+
```
308336

309337
</Accordion>
310338

docs/reference/context.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,81 @@ print("Nodes: {}, Edges: {}".format(stats["node_count"], stats["edge_count"]))
443443
| `cross_graph_path(source_node_id, target_graph, target_node_id, max_hops)` | `Dict` | Shortest path across linked graphs |
444444
| `clear()` | `None` | Reset graph state and all indexes |
445445

446-
### Cross-Graph Navigation
446+
### Distance Intelligence (v0.5.0)
447+
448+
`ContextGraph` exposes a full Distance Intelligence API for exploring semantic neighborhoods and blending proximity into retrieval.
449+
450+
<Info>
451+
Full Distance Intelligence reference — distance matrices, API endpoints, embedding cache, Explorer UI — is covered in the dedicated [Distance Intelligence](distance) page. This section documents the context-layer API.
452+
</Info>
453+
454+
### Neighbors with Distance Metadata
455+
456+
Pass `include_distance_metadata=True` to `get_neighbors()` to receive distance band, confidence decay, and path information alongside every neighbor:
457+
458+
```python
459+
graph = ContextGraph(advanced_analytics=True)
460+
461+
# ... populate graph ...
462+
463+
neighbors = graph.get_neighbors(
464+
"python",
465+
hops=3,
466+
include_distance_metadata=True,
467+
min_weight=0.3, # exclude low-confidence edges
468+
)
469+
470+
for n in neighbors:
471+
print(
472+
f"{n['node_id']:15s} "
473+
f"band={n['distance_band']:10s} "
474+
f"decay={n['confidence_decay']:.3f} "
475+
f"hops={n['hop_count']}"
476+
)
477+
```
478+
479+
| Added field | Type | Description |
480+
| :---------- | :---- | :----------- |
481+
| `distance_band` | `str` | `"direct"` (1 hop) / `"near"` (2) / `"mid-range"` (3–4) / `"distant"` (5+) |
482+
| `confidence_decay` | `float` | `edge_weight ^ hop_count` — decays with each hop |
483+
| `path_to_anchor` | `List[str]` | Shortest path from anchor node to this neighbor |
484+
| `hop_count` | `int` | BFS depth from anchor |
485+
486+
### Proximity-Blended Retrieval
487+
488+
Set `proximity_weight` on `AgentContext` to blend graph proximity into every `retrieve()` and `find_precedents()` call:
489+
490+
```python
491+
context = AgentContext(
492+
vector_store=VectorStore(backend="faiss", dimension=768),
493+
knowledge_graph=ContextGraph(advanced_analytics=True),
494+
proximity_weight=0.3, # 0.7×semantic + 0.3×proximity
495+
)
496+
497+
# combined_score is returned alongside semantic_score and proximity_score
498+
results = context.retrieve("web API frameworks", max_results=10)
499+
for r in results:
500+
print(
501+
f"[{r['combined_score']:.3f}] "
502+
f"semantic={r['semantic_score']:.3f} "
503+
f"proximity={r['proximity_score']:.3f} "
504+
f"{r['content'][:60]}"
505+
)
506+
507+
# Override weight per-call
508+
precedents = context.find_precedents(
509+
"infrastructure scaling decisions",
510+
proximity_weight=0.5,
511+
limit=5,
512+
)
513+
```
514+
515+
<Tip>
516+
`proximity_weight=0.0` disables proximity blending entirely (pure semantic). `proximity_weight=1.0` returns results ranked purely by graph proximity to the query anchor. Values between `0.2``0.4` work well for most production use cases.
517+
</Tip>
518+
519+
520+
## Cross-Graph Navigation
447521

448522
Link multiple independent `ContextGraph` instances so agents can traverse across problem spaces:
449523

0 commit comments

Comments
 (0)