npm install @motionos/sdk
import { MotionOS } from '@motionos/sdk';
const motion = new MotionOS({
apiKey: 'sb_secret_xxx',
projectId: 'proj-123'
});
await motion.ingest('User prefers dark mode');
const ctx = await motion.retrieve('user preferences');See Examples for more code samples.
Store memory in MotionOS
{
"project_id": "proj-123",
"raw_text": "User prefers dark mode",
"agent_id": "assistant-1"
}Retrieve memory from MotionOS
{
"project_id": "proj-123",
"query": "user preferences",
"mode": "inject",
"limit": 10
}| Code | Description |
|---|---|
| invalid_api_key | API key is missing or invalid |
| project_mismatch | Project ID doesn't match API key |
| rate_limited | Rate limit exceeded |
| bad_payload | Invalid request payload |