Stitch AI SDK for managing memory spaces and memories
Project description
Stitch SDK
Stitch SDK is a Python library that wraps the API for managing memory spaces and memories. It provides both a Python SDK and a command-line interface (CLI).
Installation
pip install stitch_ai
CLI Usage
Before using the CLI, set your API key as an environment variable:
export STITCH_API_KEY=your_api_key
Available Commands
- Create a new API key:
stitch key <user_id> <hashed_id> <name>
- Create a new memory space:
stitch create-space <space_name>
- Push memory to a space:
stitch push <space_name> [-m COMMIT_MESSAGE] [-e EPISODIC_FILE_PATH] [-c CHARACTER_FILE_PATH]
- Pull memory from a space:
stitch pull <user_id> <repository> -p <db_path> [--ref REF]
- Pull external memory:
stitch pull-external <user_id> <repository> -p <rag_path> [--ref REF]
- User Management Commands:
# Get user info
stitch user-get <user_id>
# Get user statistics
stitch user-stat <user_id>
# Get user histories
stitch user-histories <user_id> [--paginate PAGINATE] [--sort SORT] [--filters FILTERS]
# Get user memory
stitch user-memory <user_id> <api_key> [--memory-names MEMORY_NAMES]
# Get user purchases
stitch user-purchases <user_id> [--paginate PAGINATE] [--sort SORT] [--filters FILTERS]
- Marketplace Commands:
# List memory spaces in marketplace
stitch market-list-spaces <type> [--user-id USER_ID] [--paginate PAGINATE] [--sort SORT] [--filters FILTERS]
# List memory in a marketplace space
stitch market-list-memory <user_id> <repository> <api_key> <body>
# Purchase memory from marketplace
stitch market-purchase <user_id> <api_key> <body>
Examples
# Create a new memory space
stitch create-space my_space
# Push memory with a message and files
stitch push my_space -m "Initial memory" -e ./agent/data/db.sqlite -c ./characters/default.character.json
# Pull memory
stitch pull user123 my_space -p ./db/chroma.sqlite3
# Pull external memory
stitch pull-external user123 my_space -p ./rag/rag.json
# Get user info
stitch user-get user123
# List marketplace spaces
stitch market-list-spaces public
Environment Variables
STITCH_API_KEY: Your API key (required)STITCH_API_URL: API endpoint (optional, defaults to https://api-demo.stitch-ai.co)
SDK Usage
from stitch_ai import StitchSDK
sdk = StitchSDK()
sdk.create_space("my_space")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stitch_ai-0.3.11.tar.gz
(15.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stitch_ai-0.3.11.tar.gz.
File metadata
- Download URL: stitch_ai-0.3.11.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08847d05f628eb6578e782e5771d6b247e0e68c7e411bb6c8de7236fc4d336cc
|
|
| MD5 |
686f1f74f086002cd7343217b0f8dea8
|
|
| BLAKE2b-256 |
655798cc7645c9b88ac072ad84769639e01dff1b0df451a509f1cbf03ae5a261
|
File details
Details for the file stitch_ai-0.3.11-py3-none-any.whl.
File metadata
- Download URL: stitch_ai-0.3.11-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c796920c2515d3932a4c2fc87166d798acb29cfc5037a3f0a315874568b25256
|
|
| MD5 |
1c2fc1cacc45a54d0eaad0b23b52a85b
|
|
| BLAKE2b-256 |
3f94606fc9e3ff983e1361a8f8fbb8a4291164cc6c9464e6985c7eb11d9b1a1b
|