# Temporal

Temporal graph operations on Semantica, scoped queries at a point in time, graph...

- Repository: https://github.com/semantica-agi/semantica (14373 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add semantica-agi/semantica --skill temporal -g -a claude-code -y`
Codex: `npx skills add semantica-agi/semantica --skill temporal -g -a codex -y`
Cursor: `npx skills add semantica-agi/semantica --skill temporal -g -a cursor -y`
Gemini CLI: `npx skills add semantica-agi/semantica --skill temporal -g -a gemini-cli -y`

## Description

Temporal graph operations on Semantica, scoped queries at a point in time, graph snapshots, node change timelines, temporal causal analysis, and graph state reconstruction. Uses AgentContext.find_precedents(as_of=), ContextGraph.state_at(), CausalChainAnalyzer.trace_at_time(), and TemporalQueryRewriter. Sub-commands: query, snapshot, timeline, causal-at, precedents-at.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# /semantica:temporal

Temporal graph operations. Usage: `/semantica:temporal <sub-command> [args]`

`$ARGUMENTS` = sub-command + query/node + date expression.

---

## `query "<question>" [at|before|after <date>]`

Temporally-scoped natural-language graph query.

```python
from semantica.kg.temporal_query_rewriter import TemporalQueryRewriter
from semantica.kg.temporal_normalizer import TemporalNormalizer

normalizer = TemporalNormalizer()
# Normalize natural date expressions: "last month", "Q3 2024", "2025-01-15"
date = normalizer.normalize(date_expr)

rewriter = TemporalQueryRewriter()
# Rewrite query with temporal constraint
rewritten = rewriter.rewrite(
    query=question,
    temporal_constraint={"op": direction, "value": date},  # op: "at"|"before"|"after"
)
```

Then run the rewritten query through `AgentContext.retrieve()` or `ContextGraph.query()`.

Return ranked results with `Valid From`, `Valid Until`, `Active At <date>` columns. Mark nodes that were not yet created at the target time as `[not yet created]`.

---

## `snapshot <date>`

Reconstruct the full graph state as it existed at a specific point in time.

```python
from semantica.context import ContextGraph

graph = ContextGraph(advanced_analytics=True)

# state_at returns a dict snapshot of the graph at that timestamp
snapshot = graph.state_at(timestamp=date)  # ISO string or datetime
```

Output:
```
Graph snapshot at <date>:
  Nodes:       N  (M added since prev snapshot, K removed)
  Edges:       P
  Density:     0.21
  Communities: Q

Active decision categories at <date>:
  | Category | Count | Avg Confidence |

Top 10 nodes (by degree at <date>):
  | Node | Type | Degree |

[Compact Mermaid graph TD, top-10 most connected nodes at that time]
```

---

## `timeline <node_id>`

Show attribute and relationship changes for a node across its full history.

```python
from semantica.context import ContextGraph

graph = ContextGraph()

The rest: https://github.com/semantica-agi/semantica/blob/HEAD/plugins/skills/temporal/SKILL.md
