Skip to main content

Temporal Memory

Query memories from specific points in time using temporal queries. All temporal endpoints are POST and accept a JSON body. Authentication uses X-Session-Token only — clients do not send a Moorcheh API key.

Temporal Queries

Memanto supports three time-based query variants:

1. As Of (Point in Time)

Return memories that were valid at a specific moment, excluding memories created after that moment or expired before it:
Query: "What did we know on May 1?"
Result: Memories valid as of May 1 — created before that date,
        not expired before it.
Use case: Historical audit trail.
import httpx

response = httpx.post(
    f"{base}/agents/{agent}/recall/as-of",
    headers={"X-Session-Token": session_token, "Content-Type": "application/json"},
    json={
        "as_of": "2026-05-01T14:00:00Z",
        "type": ["fact", "decision"],
    },
)
There is no query parameter for /recall/as-of; results are listed chronologically. Use type to narrow the listing server-side.

2. Changed Since (Time Range)

Return memories created or updated after a given timestamp:
Query: "What changed in the last 7 days?"
Result: All memories created or updated since that date.
Use case: Recent updates and changes.
import httpx

response = httpx.post(
    f"{base}/agents/{agent}/recall/changed-since",
    headers={"X-Session-Token": session_token, "Content-Type": "application/json"},
    json={
        "since": "2026-05-01",
        "limit": 50,
    },
)
There is no query parameter for /recall/changed-since; results are sorted by updated_at descending. Each item carries a change_type field ("created" or "updated"). Use type to narrow by memory type.

3. Recent (Newest-First)

Return the most recently stored memories, sorted by created_at descending. Useful when you want the latest context without a semantic query:
Result: The N latest memories for the agent (optionally filtered by type).
Use case: “What did the agent learn most recently?”
import httpx

response = httpx.post(
    f"{base}/agents/{agent}/recall/recent",
    headers={"X-Session-Token": session_token, "Content-Type": "application/json"},
    json={"limit": 10, "type": ["fact", "decision"]},
)
There is no query parameter for /recall/recent; results are purely chronological.

Time Format

Temporal endpoints accept ISO 8601 (with UTC) or date-only:
2026-05-09T16:30:00Z   ← full ISO 8601
2026-05-09             ← date-only
                         /recall/as-of:        end-of-day UTC
                         /recall/changed-since: start-of-day UTC

Use Cases

1. Audit Trail

Verify what was known at a specific time:
import httpx

response = httpx.post(
    f"{base}/agents/support/recall/as-of",
    headers=headers,
    json={
        "as_of": "2026-05-01T00:00:00Z",
        "type": ["fact"],
    },
)

2. Change Tracking

See what changed during a project window:
import httpx

response = httpx.post(
    f"{base}/agents/project/recall/changed-since",
    headers=headers,
    json={
        "since": "2026-05-01",
        "limit": 50,
    },
)

3. Latest Activity

Pull the most recent memories without a query:
import httpx

response = httpx.post(
    f"{base}/agents/project/recall/recent",
    headers=headers,
    json={"limit": 10},
)
# Returns the 10 newest memories, sorted newest-first

4. Time Series Analysis

Track how information changed over time:
import httpx

dates = ["2026-04-01", "2026-04-15", "2026-05-01"]

for date in dates:
    response = httpx.post(
        f"{base}/agents/project/recall/as-of",
        headers=headers,
        json={"as_of": date},
    )
    memories = response.json().get("memories", [])
    if memories:
        print(f"{date}: {memories[0]['content']}")

5. Regression Detection

Find when something changed:
import httpx

test_dates = ["2026-04-20", "2026-04-25", "2026-05-01"]

for date in test_dates:
    response = httpx.post(
        f"{base}/agents/support/recall/as-of",
        headers=headers,
        json={"as_of": date},
    )
    memories = response.json().get("memories", [])
    if memories:
        print(f"{date}: {memories[0]['content']}")

Memory Versioning

Memories carry a status field — Memanto’s conflict resolution flow can mark older memories as superseded when newer information replaces them. recall/as-of reflects the state that existed at the queried timestamp, regardless of later supersession.
Memory A
  └─ Created: 2026-04-20
     Content: "Project deadline: April 30"
     Status: superseded (after the resolution below)

Memory B (created during conflict resolution)
  └─ Created: 2026-04-25
     Content: "Project deadline: May 15 (extended)"
     Status: active

"As of" Queries:
  └─ Before April 25: returns Memory A as it was — active
  └─ After April 25:  returns Memory B

Best Practices

DO

  • Use ISO 8601 timestamps for precision
  • Resolve conflicts explicitly via Resolve Conflict
  • Use /recall/recent to surface fresh context quickly

DON’T

  • Delete old memories — let conflict resolution mark them superseded
  • Ignore temporal information when results look ambiguous
  • Mix old and new data without checking created_at

Next Steps