Skip to main content

Project-scoped memory client for Syntarus

Project description

Syntarus Python SDK

The official Python client for the project-scoped Syntarus memory API.

Install

pip install syntarus

Python 3.10 or newer is required. Keep project API keys in a server-side secret manager; never ship them in browser or mobile applications.

Add and search memory

from syntarus import MemoryClient

with MemoryClient(api_key="sk_mem_...") as memory:
    accepted = memory.add(
        user_id="customer_123",
        agent_id="support_agent",
        run_id="ticket_456",
        messages=[
            {"role": "user", "content": "I prefer vegetarian food."},
            {"role": "assistant", "content": "I will remember that."},
        ],
        metadata={"channel": "voice"},
        idempotency_key="call-456-final",
    )
    memory.wait_for_event(accepted["event_id"])
    result = memory.search(
        "What food does the customer prefer?",
        user_id="customer_123",
        agent_id="support_agent",
    )
    print(result["context"])

agent_id creates an isolated memory namespace. Omit it for a user profile shared by every agent in the project. run_id groups the conversation history used during ingestion. metadata is event metadata and is returned by event status and webhook payloads; it is not currently a memory-search filter.

Async client

from syntarus import AsyncMemoryClient

async with AsyncMemoryClient(api_key="sk_mem_...") as memory:
    accepted = await memory.add(
        user_id="customer_123",
        messages=[{"role": "user", "content": "Call me after 5 PM."}],
    )
    await memory.wait_for_event(accepted["event_id"])

Lifecycle operations

memory.export(user_id="customer_123", agent_id="support_agent")
memory.delete("memory-uuid")
memory.delete_user(user_id="customer_123", agent_id="support_agent")

Deleting a user without agent_id deletes only the shared user namespace. Delete each agent namespace separately when an application uses agent-scoped memory.

Webhooks

created = memory.create_webhook("https://example.com/syntarus/events")
signing_secret = created["signing_secret"]  # returned once
memory.list_webhooks()
memory.webhook_deliveries(webhook_id=created["webhook"]["id"])
memory.delete_webhook(created["webhook"]["id"])

Deliveries include X-Syntarus-Timestamp, X-Syntarus-Delivery, and X-Syntarus-Signature-256. Verify the signature as HMAC-SHA256 over <timestamp>.<raw_request_body> and reject timestamps outside a five-minute window. A non-2xx response is retried durably and eventually becomes a dead-letter delivery visible through webhook_deliveries.

Errors

The SDK raises typed exceptions derived from SyntarusError:

  • AuthenticationError
  • PermissionDenied
  • RateLimitError (retry_after is available when the API sends it)
  • APIConnectionError
  • APITimeoutError
  • EventFailedError (event contains the terminal event record)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syntarus-0.2.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syntarus-0.2.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file syntarus-0.2.0.tar.gz.

File metadata

  • Download URL: syntarus-0.2.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for syntarus-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7bd1d7de0f53931a468be69a58306c6be4e69b849f6c82f663fd140c36d3f011
MD5 78a72ec54d8f9b434b647c79b2be0bf8
BLAKE2b-256 72ece090197592d8407f35896e3bf80911a42f2f316ae7fed96ffd827e3066a9

See more details on using hashes here.

File details

Details for the file syntarus-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: syntarus-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for syntarus-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0347314eabfd7adb3baed7540fda8183db2a2cd149480e9778b7495c4aa16d11
MD5 2b82cd53b57ec6ffb26ae576fcbb71b3
BLAKE2b-256 bbd5c11502f9720726f6d2b1a9b670725baa80954c14ef376564f4f5130d12da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page