Metadata-Version: 2.4
Name: syntarus
Version: 0.2.0
Summary: Project-scoped memory client for Syntarus
Project-URL: Documentation, https://www.syntarus.com/pages/developers.html
Project-URL: Homepage, https://www.syntarus.com
Project-URL: Source, https://github.com/sujalkherawat25-stack/memoryos/tree/main/sdk
Author: Syntarus
License: MIT License
        
        Copyright (c) 2026 Syntarus
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: agents,ai,llm,memory
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Provides-Extra: test
Requires-Dist: build<2,>=1.2; extra == 'test'
Requires-Dist: pytest-asyncio<1,>=0.24; extra == 'test'
Requires-Dist: pytest<9,>=8; extra == 'test'
Requires-Dist: twine<7,>=5; extra == 'test'
Description-Content-Type: text/markdown

# Syntarus Python SDK

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

## Install

```bash
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

```python
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

```python
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

```python
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

```python
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)
