Metadata-Version: 2.4
Name: quis-sdk
Version: 0.1.0
Summary: Official Python SDK for the Quis Memory API
Author-email: Quis Lab <sdk@quis.ai>
License: MIT
Project-URL: Homepage, https://quis.ai
Project-URL: Documentation, https://docs.quis.ai
Project-URL: Repository, https://github.com/Quis-Lab/quis-sdk
Project-URL: Issues, https://github.com/Quis-Lab/quis-sdk/issues
Keywords: memory,ai,agents,llm,quis
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"
Dynamic: license-file

# quis-sdk

Official Python SDK for the [Quis Memory API](https://quis.ai) — a human-centric, affect-aware memory layer for LLM agents.

## Installation

```bash
pip install quis-sdk
```

## Quickstart

```python
import asyncio
from quis_sdk import Quis

async def main():
    async with Quis(api_key="quis_sk_...") as q:

        # Ingest a conversation message
        await q.ingest(
            messages=[
                {
                    "message_id": "msg-001",
                    "sender_id": "user-uuid",
                    "timestamp": "2026-03-15T10:00:00Z",
                    "text": "I just visited Paris for the first time!",
                    "user_name": "Alice",
                }
            ],
            conversation_id="conv-123",
        )

        # Retrieve memories when answering a question
        result = await q.retrieve(
            user_id="user-uuid",
            question="Where has this user traveled?",
        )

        # Inject the memory context into your LLM system prompt
        print(result["prompt"])

asyncio.run(main())
```

## Configuration

| Parameter | Description | Default |
|-----------|-------------|---------|
| `api_key` | Your Quis API key (starts with `quis_sk_`) | required |
| `base_url` | API base URL (override for self-hosted) | `https://api.quis.ai` |
| `timeout` | Request timeout in seconds | `60` |

Get your API key at [app.quis.ai](https://app.quis.ai).

## Error Handling

```python
from quis_sdk import Quis, QuisAuthError, QuisRateLimitError, QuisAPIError

async with Quis(api_key="quis_sk_...") as q:
    try:
        result = await q.retrieve(user_id="u1", question="What do I like?")
    except QuisAuthError:
        print("Invalid API key")
    except QuisRateLimitError as e:
        print(f"Rate limited. Retry after {e.retry_after}s")
    except QuisAPIError as e:
        print(f"Server error {e.status_code}: {e.detail}")
```

## Self-hosted Deployments

Point the SDK at your own instance:

```python
q = Quis(api_key="quis_sk_...", base_url="https://memory.your-company.com")
```

## License

MIT — see [LICENSE](LICENSE).
