> ## Documentation Index
> Fetch the complete documentation index at: /dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Python SDK

> The same calls, for Python.

> [!NOTE]
>
> `constella-sdk` is not on PyPI yet. Until it is, call the [HTTP routes](/dev/docs/api-reference/introduction.md) (the client below is about 15 lines), or [email us](mailto:team@constella.app) for the package.

```python theme={"system"}
import os
from constella_sdk import Constella

# Your own memory
constella = Constella(key=os.environ["CONSTELLA_API_KEY"], client="my-script")
constella.me.memory.add("We ship on Fridays.", id="team:ship-day")
constella.me.memory.recall("when do we ship?")

# Your app's users
app = Constella(key=os.environ["CONSTELLA_APP_KEY"])
app.users("u_123").memory.add("Prefers short answers.")
```

## Without the SDK

```python theme={"system"}
import os
from urllib.parse import quote

import requests

API = "https://api.constella.app/platform/v1"


def call_tool(name: str, arguments: dict, uid: str | None = None):
    path = f"/users/{quote(uid, safe='')}/tools/{name}" if uid else f"/me/tools/{name}"
    key = os.environ["CONSTELLA_APP_KEY" if uid else "CONSTELLA_API_KEY"]
    r = requests.post(API + path, headers={"Authorization": f"Bearer {key}"}, json={"arguments": arguments})
    if not r.ok:
        detail = r.json().get("detail", {})
        raise RuntimeError(f"{detail.get('code')}: {detail.get('message')}")
    return r.json()["result"]
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.