Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.6.0"
".": "3.7.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-ff2201f4ff8f062673cb93068f6d3efeb46d6ac7ce66632418ec1825b03f6332.yml
openapi_spec_hash: 11b52dea5fc829a46baea91d0c7e3c4e
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-4565eada92d3d7a0434e5896c283f460888b24f3ed5389f32bcbc2b104fb52df.yml
openapi_spec_hash: 124bf13a8b2727edb1b10dd2274cc2d2
config_hash: a478b24249ee4f53abfb5787ca4daf8b
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 3.7.0 (2025-10-30)

Full Changelog: [v3.6.0...v3.7.0](https://github.com/supermemoryai/sdk-ts/compare/v3.6.0...v3.7.0)

### Features

* **api:** api update ([fcc686d](https://github.com/supermemoryai/sdk-ts/commit/fcc686dd749fef68f666a36d9a49c56c51cf6527))
* **api:** api update ([09566db](https://github.com/supermemoryai/sdk-ts/commit/09566dbc809169fcb438a52194f510304b8d0479))

## 3.6.0 (2025-10-07)

Full Changelog: [v3.5.0...v3.6.0](https://github.com/supermemoryai/sdk-ts/compare/v3.5.0...v3.6.0)
Expand Down
36 changes: 14 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ const client = new Supermemory({
apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted
});

const params: Supermemory.MemoryAddParams = {
content: 'This is a detailed article about machine learning concepts...',
};
const params: Supermemory.MemoryAddParams = { content: 'content' };
const response: Supermemory.MemoryAddResponse = await client.memories.add(params);
```

Expand Down Expand Up @@ -88,17 +86,15 @@ a subclass of `APIError` will be thrown:

<!-- prettier-ignore -->
```ts
const response = await client.memories
.add({ content: 'This is a detailed article about machine learning concepts...' })
.catch(async (err) => {
if (err instanceof Supermemory.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
const response = await client.memories.add({ content: 'content' }).catch(async (err) => {
if (err instanceof Supermemory.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
} else {
throw err;
}
});
```

Error codes are as follows:
Expand Down Expand Up @@ -130,7 +126,7 @@ const client = new Supermemory({
});

// Or, configure per-request:
await client.memories.add({ content: 'This is a detailed article about machine learning concepts...' }, {
await client.memories.add({ content: 'content' }, {
maxRetries: 5,
});
```
Expand All @@ -147,7 +143,7 @@ const client = new Supermemory({
});

// Override per-request:
await client.memories.add({ content: 'This is a detailed article about machine learning concepts...' }, {
await client.memories.add({ content: 'content' }, {
timeout: 5 * 1000,
});
```
Expand All @@ -170,15 +166,11 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
```ts
const client = new Supermemory();

const response = await client.memories
.add({ content: 'This is a detailed article about machine learning concepts...' })
.asResponse();
const response = await client.memories.add({ content: 'content' }).asResponse();
console.log(response.headers.get('X-My-Header'));
console.log(response.statusText); // access the underlying Response object

const { data: response, response: raw } = await client.memories
.add({ content: 'This is a detailed article about machine learning concepts...' })
.withResponse();
const { data: response, response: raw } = await client.memories.add({ content: 'content' }).withResponse();
console.log(raw.headers.get('X-My-Header'));
console.log(response.id);
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supermemory",
"version": "3.6.0",
"version": "3.7.0",
"description": "The official TypeScript library for the Supermemory API",
"author": "Supermemory <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
46 changes: 25 additions & 21 deletions src/resources/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export class Documents extends APIResource {
* @example
* ```ts
* const response = await client.documents.add({
* content:
* 'This is a detailed article about machine learning concepts...',
* content: 'content',
* });
* ```
*/
Expand Down Expand Up @@ -105,8 +104,14 @@ export class Documents extends APIResource {
}

export interface DocumentUpdateResponse {
/**
* Unique identifier of the document
*/
id: string;

/**
* Status of the document
*/
status: string;
}

Expand Down Expand Up @@ -219,8 +224,14 @@ export namespace DocumentListResponse {
}

export interface DocumentAddResponse {
/**
* Unique identifier of the document
*/
id: string;

/**
* Status of the document
*/
status: string;
}

Expand Down Expand Up @@ -339,8 +350,14 @@ export interface DocumentGetResponse {
}

export interface DocumentUploadFileResponse {
/**
* Unique identifier of the document
*/
id: string;

/**
* Status of the document
*/
status: string;
}

Expand Down Expand Up @@ -431,41 +448,28 @@ export interface DocumentAddParams {
/**
* The content to extract and process into a document. This can be a URL to a
* website, a PDF, an image, or a video.
*
* Plaintext: Any plaintext format
*
* URL: A URL to a website, PDF, image, or video
*
* We automatically detect the content type from the url's response format.
*/
content: string;

/**
* Optional tag this document should be containerized by. This can be an ID for
* your user, a project ID, or any other identifier you wish to use to group
* documents.
* Optional tag this document should be containerized by. Max 100 characters,
* alphanumeric with hyphens and underscores only.
*/
containerTag?: string;

/**
* @deprecated (DEPRECATED: Use containerTag instead) Optional tags this document
* should be containerized by. This can be an ID for your user, a project ID, or
* any other identifier you wish to use to group documents.
* @deprecated
*/
containerTags?: Array<string>;

/**
* Optional custom ID of the document. This could be an ID from your database that
* will uniquely identify this document.
* Optional custom ID of the document. Max 100 characters, alphanumeric with
* hyphens and underscores only.
*/
customId?: string;

/**
* Optional metadata for the document. This is used to store additional information
* about the document. You can use this to store any additional information you
* need about the document. Metadata can be filtered through. Keys must be strings
* and are case sensitive. Values can be strings, numbers, or booleans. You cannot
* nest objects.
* Optional metadata for the document.
*/
metadata?: { [key: string]: string | number | boolean | Array<string> };
}
Expand Down
46 changes: 25 additions & 21 deletions src/resources/memories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export class Memories extends APIResource {
* @example
* ```ts
* const response = await client.memories.add({
* content:
* 'This is a detailed article about machine learning concepts...',
* content: 'content',
* });
* ```
*/
Expand Down Expand Up @@ -102,8 +101,14 @@ export class Memories extends APIResource {
}

export interface MemoryUpdateResponse {
/**
* Unique identifier of the document
*/
id: string;

/**
* Status of the document
*/
status: string;
}

Expand Down Expand Up @@ -216,8 +221,14 @@ export namespace MemoryListResponse {
}

export interface MemoryAddResponse {
/**
* Unique identifier of the document
*/
id: string;

/**
* Status of the document
*/
status: string;
}

Expand Down Expand Up @@ -336,8 +347,14 @@ export interface MemoryGetResponse {
}

export interface MemoryUploadFileResponse {
/**
* Unique identifier of the document
*/
id: string;

/**
* Status of the document
*/
status: string;
}

Expand Down Expand Up @@ -428,41 +445,28 @@ export interface MemoryAddParams {
/**
* The content to extract and process into a document. This can be a URL to a
* website, a PDF, an image, or a video.
*
* Plaintext: Any plaintext format
*
* URL: A URL to a website, PDF, image, or video
*
* We automatically detect the content type from the url's response format.
*/
content: string;

/**
* Optional tag this document should be containerized by. This can be an ID for
* your user, a project ID, or any other identifier you wish to use to group
* documents.
* Optional tag this document should be containerized by. Max 100 characters,
* alphanumeric with hyphens and underscores only.
*/
containerTag?: string;

/**
* @deprecated (DEPRECATED: Use containerTag instead) Optional tags this document
* should be containerized by. This can be an ID for your user, a project ID, or
* any other identifier you wish to use to group documents.
* @deprecated
*/
containerTags?: Array<string>;

/**
* Optional custom ID of the document. This could be an ID from your database that
* will uniquely identify this document.
* Optional custom ID of the document. Max 100 characters, alphanumeric with
* hyphens and underscores only.
*/
customId?: string;

/**
* Optional metadata for the document. This is used to store additional information
* about the document. You can use this to store any additional information you
* need about the document. Metadata can be filtered through. Keys must be strings
* and are case sensitive. Values can be strings, numbers, or booleans. You cannot
* nest objects.
* Optional metadata for the document.
*/
metadata?: { [key: string]: string | number | boolean | Array<string> };
}
Expand Down
18 changes: 8 additions & 10 deletions src/resources/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ export interface SearchDocumentsParams {
q: string;

/**
* @deprecated Optional category filters
* @deprecated DEPRECATED: Optional category filters
*/
categoriesFilter?: Array<'technology' | 'science' | 'business' | 'health'>;
categoriesFilter?: Array<string>;

/**
* Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
Expand All @@ -415,9 +415,8 @@ export interface SearchDocumentsParams {
docId?: string;

/**
* Threshold / sensitivity for document selection. 0 is least sensitive (returns
* most documents, more results), 1 is most sensitive (returns lesser documents,
* accurate results)
* @deprecated DEPRECATED: This field is no longer used in v3 search. The search
* now uses chunkThreshold only. This parameter will be ignored.
*/
documentThreshold?: number;

Expand Down Expand Up @@ -470,9 +469,9 @@ export interface SearchExecuteParams {
q: string;

/**
* @deprecated Optional category filters
* @deprecated DEPRECATED: Optional category filters
*/
categoriesFilter?: Array<'technology' | 'science' | 'business' | 'health'>;
categoriesFilter?: Array<string>;

/**
* Threshold / sensitivity for chunk selection. 0 is least sensitive (returns most
Expand All @@ -494,9 +493,8 @@ export interface SearchExecuteParams {
docId?: string;

/**
* Threshold / sensitivity for document selection. 0 is least sensitive (returns
* most documents, more results), 1 is most sensitive (returns lesser documents,
* accurate results)
* @deprecated DEPRECATED: This field is no longer used in v3 search. The search
* now uses chunkThreshold only. This parameter will be ignored.
*/
documentThreshold?: number;

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '3.6.0'; // x-release-please-version
export const VERSION = '3.7.0'; // x-release-please-version
Loading
Loading