Sgraal + Conway

Validate every memory access before Conway acts — even at 3am.

Why it matters

Conway runs while you sleep. It persists across sessions, triggers via webhooks, and acts autonomously. Without preflight validation, stale or poisoned memories can drive irreversible actions with no human in the loop.

Integration pattern

Conway webhook trigger
    ↓
Retrieve memory from persistent store
    ↓
Sgraal preflight (POST /v1/preflight)
    ↓
USE_MEMORY → act    |    BLOCK → stop + alert

Code example

from sgraal import SgraalClient
import os

client = SgraalClient(os.environ["SGRAAL_API_KEY"])

def conway_webhook_handler(event):
    # Retrieve memory Conway is about to act on
    memory = event["memory_context"]

    result = client.preflight(
        memory_state=[{
            "id": "conway_mem",
            "content": memory,
            "type": "semantic",
            "timestamp_age_days": 0,
            "source_trust": 0.85,
            "source_conflict": 0.05,
            "downstream_count": 1
        }],
        domain="coding",
        action_type=event.get("action_type", "reversible")
    )

    if result["recommended_action"] == "BLOCK":
        return {"blocked": True, "reason": result.get("explainability_note")}

    # Safe to proceed
    return execute_action(event)

Key detection fields for Conway

timestamp_integrity

Catches stale memory replayed as fresh during overnight runs.

identity_drift

Detects authority creep over long-running persistent sessions.

naturalness_level

Flags too-clean memory from automated sources at 3am.

Read the full docs