Try our new Claude Code 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.memories.add({ text: 'text' });
console.log(memoryStatus.resource_id);{
"source": "collections",
"resource_id": "<string>",
"status": "pending"
}Adds an arbitrary document to the index. This can be any text, email, call transcript, etc. The document will be processed and made available for querying once the processing is complete.
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.memories.add({ text: 'text' });
console.log(memoryStatus.resource_id);{
"source": "collections",
"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.
Full text of the document.
The resource ID to add the document to. If not provided, a new resource ID will be generated. If provided, the document will be updated if it already exists.
The collection to add the document to for easier retrieval.
Title of the document.
Date of the document. Depending on the document, this could be the creation date or date the document was last updated (eg. for a chat transcript, this would be the date of the last message). This helps the ranking algorithm and allows you to filter by date range.
Custom metadata for filtering. Keys must be alphanumeric with underscores, max 64 chars. Values must be string, number, or boolean.
Show child attributes
Was this page helpful?