Try our new Setup Skill to automatically integrate Hyperspell into your project
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const memoryStatus = await client.sessions.add({ history: 'history' });
console.log(memoryStatus.resource_id);{
"source": "reddit",
"resource_id": "<string>",
"status": "pending"
}Add an agent trace/transcript to the index.
Accepts traces as a string in Hyperdoc format (native), Vercel AI SDK format, or OpenClaw JSONL format. The format is auto-detected if not specified.
Hyperdoc format (JSON array, snake_case with type discriminators):
{"history": "[{\"type\": \"trace_message\", \"role\": \"user\", \"text\": \"Hello\"}]"}
Vercel AI SDK format (JSON array, camelCase):
{"history": "[{\"role\": \"user\", \"content\": \"Hello\"}]"}
OpenClaw JSONL format (newline-delimited JSON):
{"history": "{\"type\":\"session\",\"id\":\"abc\"}\n{\"type\":\"message\",\"message\":{\"role\":\"user\",...}}"}
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const memoryStatus = await client.sessions.add({ history: 'history' });
console.log(memoryStatus.resource_id);{
"source": "reddit",
"resource_id": "<string>",
"status": "pending"
}API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Request to add an agent trace.
The trace history as a string. Can be a JSON array of Hyperdoc steps, a JSON array of Vercel AI SDK steps, or OpenClaw JSONL.
Resource identifier for the trace.
Trace format: 'vercel', 'hyperdoc', or 'openclaw'. Auto-detected if not set.
vercel, hyperdoc, openclaw Title of the trace
Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars.
Show child attributes
Date of the trace
What kind of memories to extract from the trace
procedure, memory Successful Response
reddit, notion, slack, google_calendar, google_mail, box, dropbox, google_drive, github, vault, web_crawler, trace, microsoft_teams, gmail_actions pending, processing, completed, failed, pending_review, skipped Was this page helpful?