Python SDK
Integrate Sgraal directly into your Python agent workflows.
pip install sgraal
from sgraal import SgraalClient
client = SgraalClient(api_key="sg_demo_playground")
result = client.preflight(
memory_state=[{"id": "mem_001", "content": "User communication preference",
"type": "tool_state", "timestamp_age_days": 54, "source_trust": 0.6}],
action_type="irreversible",
domain="fintech"
)
print(result.recommended_action) # BLOCK
print(result.omega_mem_final) # 78.4
Node.js SDK
Use Sgraal in your Node.js or TypeScript agent projects.
npm install @sgraal/sdk
const { SgraalClient } = require('@sgraal/sdk');
const client = new SgraalClient({ apiKey: 'sg_demo_playground' });
const result = await client.preflight({
memory_state: [{ id: 'mem_001', type: 'tool_state',
timestamp_age_days: 54, source_trust: 0.6 }],
action_type: 'irreversible',
domain: 'fintech'
});
console.log(result.recommended_action); // BLOCK
REST API
Call Sgraal directly via HTTPS from any language or platform.
curl -X POST https://api.sgraal.com/v1/preflight \
-H "Authorization: Bearer sg_demo_playground" \
-H "Content-Type: application/json" \
-d '{
"memory_state": [{"id": "mem_001", "content": "User communication preference",
"type": "tool_state", "timestamp_age_days": 54, "source_trust": 0.6}],
"action_type": "irreversible",
"domain": "fintech"
}'