Skip to content

Commit 708c20b

Browse files
release: 1.0.0-alpha.7 (#36)
* feat: Revert "feat: revise mcp tool routes [LET-4321]" * codegen metadata * codegen metadata * codegen metadata * fix: sdk config code gen * feat: remove run tool for external sdk * feat: add agent template route to config * feat: deprecate use_assistant_message in list endpoints * codegen metadata * feat: replace agent.identity_ids with agent.identities * feat: rename multi agent group to managed group * feat: remove unused max length parameter * codegen metadata * feat: fix patch approvals endpoint incorrectly using queyr params * codegen metadata * feat: reset message incorrectly using query param * feat: remove relationship fields on identities * feat: deprecate append copy suffix, add override name [LET-5779] * feat: add openai-style include param for agents relationship loading * codegen metadata * codegen metadata * feat: add new archive routes to sdk * chore: add context_window_limit and max_tokens to UpdateAgent [LET-3743] [LET-3741] * codegen metadata * feat: attach/detach identities route on blocks and agents, move archives attach/detach routes to agents * codegen metadata * feat: Support embedding config on the archive [LET-5832] * release: 1.0.0-alpha.7 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent cff9906 commit 708c20b

File tree

168 files changed

+6558
-12093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+6558
-12093
lines changed

.github/workflows/publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
run: |
3030
bash ./bin/publish-npm
3131
env:
32-
NPM_TOKEN: ${{ secrets.LETTA_SDK_NPM_TOKEN || secrets.NPM_TOKEN }}
32+
NPM_TOKEN: ${{ secrets.LETTA_NPM_TOKEN || secrets.NPM_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21-
NPM_TOKEN: ${{ secrets.LETTA_SDK_NPM_TOKEN || secrets.NPM_TOKEN }}
21+
NPM_TOKEN: ${{ secrets.LETTA_NPM_TOKEN || secrets.NPM_TOKEN }}
2222

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.0.0-alpha.6"
2+
".": "1.0.0-alpha.7"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 184
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-283b44f5ec292919111e3328874d393d847d7340482adfa86cfee3dacb0d1331.yml
3-
openapi_spec_hash: 6ff17b6f249c5f4e88e6e833b47f39eb
4-
config_hash: 1310be2f6c53e5fa8d0513cf1774bafe
1+
configured_endpoints: 106
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/letta-ai%2Fletta-sdk-d67ca762c9a9ebc74be3a4d373dc15fae68b375a580d5b126e86b55ac72a36a2.yml
3+
openapi_spec_hash: d4d7cbecb83adc92ccd66fe9a96130af
4+
config_hash: 6566625fdf1964224f4472bd3c9e6c9f

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Changelog
22

3+
## 1.0.0-alpha.7 (2025-10-24)
4+
5+
Full Changelog: [v1.0.0-alpha.6...v1.0.0-alpha.7](https://github.com/letta-ai/letta-node/compare/v1.0.0-alpha.6...v1.0.0-alpha.7)
6+
7+
### Features
8+
9+
* add agent template route to config ([a379f18](https://github.com/letta-ai/letta-node/commit/a379f189b301a71a7f229561327481ec9510ef93))
10+
* add new archive routes to sdk ([389a103](https://github.com/letta-ai/letta-node/commit/389a103835dac6e45720e8c640c4f46050bb0320))
11+
* add openai-style include param for agents relationship loading ([b5d9129](https://github.com/letta-ai/letta-node/commit/b5d91299de0444d848d9d340c1f4e97fcf99003c))
12+
* attach/detach identities route on blocks and agents, move archives attach/detach routes to agents ([3598ad8](https://github.com/letta-ai/letta-node/commit/3598ad8be4b5ba0bc8a52d8804aa356e451fbbb8))
13+
* deprecate append copy suffix, add override name [LET-5779] ([9315a1d](https://github.com/letta-ai/letta-node/commit/9315a1d1ce68b0dc3c569a0798dc57a03f9da945))
14+
* deprecate use_assistant_message in list endpoints ([01dc718](https://github.com/letta-ai/letta-node/commit/01dc71801be25019afd1f78897f549e61b50fa83))
15+
* fix patch approvals endpoint incorrectly using queyr params ([7afe5c8](https://github.com/letta-ai/letta-node/commit/7afe5c8f4e59ea35e227741de29656be9f8d7169))
16+
* remove relationship fields on identities ([46760eb](https://github.com/letta-ai/letta-node/commit/46760ebf5f756ac46ad49fedcfaa6376aa765990))
17+
* remove run tool for external sdk ([7553ec2](https://github.com/letta-ai/letta-node/commit/7553ec211dec69ff9c65492f2810abd5d165c322))
18+
* remove unused max length parameter ([52583f4](https://github.com/letta-ai/letta-node/commit/52583f440712308078b2a7df068500f056ed153c))
19+
* rename multi agent group to managed group ([c28d519](https://github.com/letta-ai/letta-node/commit/c28d5193c93e5388ec9ca439e9fbfda0ac9a14b3))
20+
* replace agent.identity_ids with agent.identities ([d030ea8](https://github.com/letta-ai/letta-node/commit/d030ea82e6e23c691c60bc47268e50db1a02b3ad))
21+
* reset message incorrectly using query param ([8887c58](https://github.com/letta-ai/letta-node/commit/8887c5802c50f782562572c650d8b7ffcc0d9fa6))
22+
* Revert "feat: revise mcp tool routes [LET-4321]" ([839bdbc](https://github.com/letta-ai/letta-node/commit/839bdbcb891119452b16554bb58737c6bb3ccefe))
23+
* Support embedding config on the archive [LET-5832] ([c464e03](https://github.com/letta-ai/letta-node/commit/c464e035785567695f998d18c661b1cfb4a35ed0))
24+
25+
26+
### Bug Fixes
27+
28+
* sdk config code gen ([7c34069](https://github.com/letta-ai/letta-node/commit/7c340694b03d629e1a70081ff392440c30c59023))
29+
30+
31+
### Chores
32+
33+
* add context_window_limit and max_tokens to UpdateAgent [LET-3743] [LET-3741] ([e8a7bd3](https://github.com/letta-ai/letta-node/commit/e8a7bd347e8973beefcf467b8da6532b39f74aa1))
34+
335
## 1.0.0-alpha.6 (2025-10-22)
436

537
Full Changelog: [v0.0.1...v1.0.0-alpha.6](https://github.com/letta-ai/letta-node/compare/v0.0.1...v1.0.0-alpha.6)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 Letta SDK
189+
Copyright 2025 Letta
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 105 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Letta SDK TypeScript API Library
1+
# Letta TypeScript API Library
22

33
[![NPM version](<https://img.shields.io/npm/v/@letta-ai/letta-client.svg?label=npm%20(stable)>)](https://npmjs.org/package/@letta-ai/letta-client) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@letta-ai/letta-client)
44

5-
This library provides convenient access to the Letta SDK REST API from server-side TypeScript or JavaScript.
5+
This library provides convenient access to the Letta REST API from server-side TypeScript or JavaScript.
66

77
The full API of this library can be found in [api.md](api.md).
88

@@ -20,14 +20,21 @@ The full API of this library can be found in [api.md](api.md).
2020

2121
<!-- prettier-ignore -->
2222
```js
23-
import LettaSDK from '@letta-ai/letta-client';
23+
import Letta from '@letta-ai/letta-client';
2424

25-
const client = new LettaSDK({
26-
apiKey: process.env['LETTA_SDK_API_KEY'], // This is the default and can be omitted
27-
environment: 'environment_1', // defaults to 'production'
25+
const client = new Letta({
26+
apiKey: process.env['LETTA_API_KEY'], // This is the default and can be omitted
27+
environment: 'local', // defaults to 'cloud'
2828
});
2929

30-
const archive = await client.archives.update({ name: 'name' });
30+
const archive = await client.archives.create({
31+
embedding_config: {
32+
embedding_dim: 0,
33+
embedding_endpoint_type: 'openai',
34+
embedding_model: 'embedding_model',
35+
},
36+
name: 'name',
37+
});
3138

3239
console.log(archive.id);
3340
```
@@ -38,15 +45,22 @@ This library includes TypeScript definitions for all request params and response
3845

3946
<!-- prettier-ignore -->
4047
```ts
41-
import LettaSDK from '@letta-ai/letta-client';
48+
import Letta from '@letta-ai/letta-client';
4249

43-
const client = new LettaSDK({
44-
apiKey: process.env['LETTA_SDK_API_KEY'], // This is the default and can be omitted
45-
environment: 'environment_1', // defaults to 'production'
50+
const client = new Letta({
51+
apiKey: process.env['LETTA_API_KEY'], // This is the default and can be omitted
52+
environment: 'local', // defaults to 'cloud'
4653
});
4754

48-
const params: LettaSDK.ArchiveUpdateParams = { name: 'name' };
49-
const archive: LettaSDK.Archive = await client.archives.update(params);
55+
const params: Letta.ArchiveCreateParams = {
56+
embedding_config: {
57+
embedding_dim: 0,
58+
embedding_endpoint_type: 'openai',
59+
embedding_model: 'embedding_model',
60+
},
61+
name: 'name',
62+
};
63+
const archive: Letta.Archive = await client.archives.create(params);
5064
```
5165

5266
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -62,22 +76,32 @@ Request parameters that correspond to file uploads can be passed in many differe
6276

6377
```ts
6478
import fs from 'fs';
65-
import LettaSDK, { toFile } from '@letta-ai/letta-client';
79+
import Letta, { toFile } from '@letta-ai/letta-client';
6680

67-
const client = new LettaSDK();
81+
const client = new Letta();
6882

6983
// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
70-
await client.sources.uploadFile('source_id', { file: fs.createReadStream('/path/to/file') });
84+
await client.folders.files.upload('source-123e4567-e89b-42d3-8456-426614174000', {
85+
file: fs.createReadStream('/path/to/file'),
86+
});
7187

7288
// Or if you have the web `File` API you can pass a `File` instance:
73-
await client.sources.uploadFile('source_id', { file: new File(['my bytes'], 'file') });
89+
await client.folders.files.upload('source-123e4567-e89b-42d3-8456-426614174000', {
90+
file: new File(['my bytes'], 'file'),
91+
});
7492

7593
// You can also pass a `fetch` `Response`:
76-
await client.sources.uploadFile('source_id', { file: await fetch('https://somesite/file') });
94+
await client.folders.files.upload('source-123e4567-e89b-42d3-8456-426614174000', {
95+
file: await fetch('https://somesite/file'),
96+
});
7797

7898
// Finally, if none of the above are convenient, you can use our `toFile` helper:
79-
await client.sources.uploadFile('source_id', { file: await toFile(Buffer.from('my bytes'), 'file') });
80-
await client.sources.uploadFile('source_id', { file: await toFile(new Uint8Array([0, 1, 2]), 'file') });
99+
await client.folders.files.upload('source-123e4567-e89b-42d3-8456-426614174000', {
100+
file: await toFile(Buffer.from('my bytes'), 'file'),
101+
});
102+
await client.folders.files.upload('source-123e4567-e89b-42d3-8456-426614174000', {
103+
file: await toFile(new Uint8Array([0, 1, 2]), 'file'),
104+
});
81105
```
82106

83107
## Handling errors
@@ -88,15 +112,24 @@ a subclass of `APIError` will be thrown:
88112

89113
<!-- prettier-ignore -->
90114
```ts
91-
const archive = await client.archives.update({ name: 'name' }).catch(async (err) => {
92-
if (err instanceof LettaSDK.APIError) {
93-
console.log(err.status); // 400
94-
console.log(err.name); // BadRequestError
95-
console.log(err.headers); // {server: 'nginx', ...}
96-
} else {
97-
throw err;
98-
}
99-
});
115+
const archive = await client.archives
116+
.create({
117+
embedding_config: {
118+
embedding_dim: 0,
119+
embedding_endpoint_type: 'openai',
120+
embedding_model: 'embedding_model',
121+
},
122+
name: 'name',
123+
})
124+
.catch(async (err) => {
125+
if (err instanceof Letta.APIError) {
126+
console.log(err.status); // 400
127+
console.log(err.name); // BadRequestError
128+
console.log(err.headers); // {server: 'nginx', ...}
129+
} else {
130+
throw err;
131+
}
132+
});
100133
```
101134

102135
Error codes are as follows:
@@ -123,12 +156,12 @@ You can use the `maxRetries` option to configure or disable this:
123156
<!-- prettier-ignore -->
124157
```js
125158
// Configure the default for all requests:
126-
const client = new LettaSDK({
159+
const client = new Letta({
127160
maxRetries: 0, // default is 2
128161
});
129162

130163
// Or, configure per-request:
131-
await client.archives.update({ name: 'name' }, {
164+
await client.archives.create({ embedding_config: { embedding_dim: 0, embedding_endpoint_type: 'openai', embedding_model: 'embedding_model' }, name: 'name' }, {
132165
maxRetries: 5,
133166
});
134167
```
@@ -140,12 +173,12 @@ Requests time out after 1 minute by default. You can configure this with a `time
140173
<!-- prettier-ignore -->
141174
```ts
142175
// Configure the default for all requests:
143-
const client = new LettaSDK({
176+
const client = new Letta({
144177
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
145178
});
146179

147180
// Override per-request:
148-
await client.archives.update({ name: 'name' }, {
181+
await client.archives.create({ embedding_config: { embedding_dim: 0, embedding_endpoint_type: 'openai', embedding_model: 'embedding_model' }, name: 'name' }, {
149182
timeout: 5 * 1000,
150183
});
151184
```
@@ -166,13 +199,31 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
166199

167200
<!-- prettier-ignore -->
168201
```ts
169-
const client = new LettaSDK();
170-
171-
const response = await client.archives.update({ name: 'name' }).asResponse();
202+
const client = new Letta();
203+
204+
const response = await client.archives
205+
.create({
206+
embedding_config: {
207+
embedding_dim: 0,
208+
embedding_endpoint_type: 'openai',
209+
embedding_model: 'embedding_model',
210+
},
211+
name: 'name',
212+
})
213+
.asResponse();
172214
console.log(response.headers.get('X-My-Header'));
173215
console.log(response.statusText); // access the underlying Response object
174216

175-
const { data: archive, response: raw } = await client.archives.update({ name: 'name' }).withResponse();
217+
const { data: archive, response: raw } = await client.archives
218+
.create({
219+
embedding_config: {
220+
embedding_dim: 0,
221+
embedding_endpoint_type: 'openai',
222+
embedding_model: 'embedding_model',
223+
},
224+
name: 'name',
225+
})
226+
.withResponse();
176227
console.log(raw.headers.get('X-My-Header'));
177228
console.log(archive.id);
178229
```
@@ -187,13 +238,13 @@ console.log(archive.id);
187238

188239
The log level can be configured in two ways:
189240

190-
1. Via the `LETTA_SDK_LOG` environment variable
241+
1. Via the `LETTA_LOG` environment variable
191242
2. Using the `logLevel` client option (overrides the environment variable if set)
192243

193244
```ts
194-
import LettaSDK from '@letta-ai/letta-client';
245+
import Letta from '@letta-ai/letta-client';
195246

196-
const client = new LettaSDK({
247+
const client = new Letta({
197248
logLevel: 'debug', // Show all log messages
198249
});
199250
```
@@ -219,13 +270,13 @@ When providing a custom logger, the `logLevel` option still controls which messa
219270
below the configured level will not be sent to your logger.
220271

221272
```ts
222-
import LettaSDK from '@letta-ai/letta-client';
273+
import Letta from '@letta-ai/letta-client';
223274
import pino from 'pino';
224275

225276
const logger = pino();
226277

227-
const client = new LettaSDK({
228-
logger: logger.child({ name: 'LettaSDK' }),
278+
const client = new Letta({
279+
logger: logger.child({ name: 'Letta' }),
229280
logLevel: 'debug', // Send all messages to pino, allowing it to filter
230281
});
231282
```
@@ -254,7 +305,7 @@ parameter. This library doesn't validate at runtime that the request matches the
254305
send will be sent as-is.
255306

256307
```ts
257-
client.archives.update({
308+
client.archives.create({
258309
// ...
259310
// @ts-expect-error baz is not yet public
260311
baz: 'undocumented option',
@@ -288,20 +339,20 @@ globalThis.fetch = fetch;
288339
Or pass it to the client:
289340

290341
```ts
291-
import LettaSDK from '@letta-ai/letta-client';
342+
import Letta from '@letta-ai/letta-client';
292343
import fetch from 'my-fetch';
293344

294-
const client = new LettaSDK({ fetch });
345+
const client = new Letta({ fetch });
295346
```
296347

297348
### Fetch options
298349

299350
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
300351

301352
```ts
302-
import LettaSDK from '@letta-ai/letta-client';
353+
import Letta from '@letta-ai/letta-client';
303354

304-
const client = new LettaSDK({
355+
const client = new Letta({
305356
fetchOptions: {
306357
// `RequestInit` options
307358
},
@@ -316,11 +367,11 @@ options to requests:
316367
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
317368

318369
```ts
319-
import LettaSDK from '@letta-ai/letta-client';
370+
import Letta from '@letta-ai/letta-client';
320371
import * as undici from 'undici';
321372

322373
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
323-
const client = new LettaSDK({
374+
const client = new Letta({
324375
fetchOptions: {
325376
dispatcher: proxyAgent,
326377
},
@@ -330,9 +381,9 @@ const client = new LettaSDK({
330381
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
331382

332383
```ts
333-
import LettaSDK from '@letta-ai/letta-client';
384+
import Letta from '@letta-ai/letta-client';
334385

335-
const client = new LettaSDK({
386+
const client = new Letta({
336387
fetchOptions: {
337388
proxy: 'http://localhost:8888',
338389
},
@@ -342,10 +393,10 @@ const client = new LettaSDK({
342393
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
343394

344395
```ts
345-
import LettaSDK from 'npm:@letta-ai/letta-client';
396+
import Letta from 'npm:@letta-ai/letta-client';
346397

347398
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
348-
const client = new LettaSDK({
399+
const client = new Letta({
349400
fetchOptions: {
350401
client: httpClient,
351402
},

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Letta SDK, please follow the respective company's security reporting guidelines.
19+
or products provided by Letta, please follow the respective company's security reporting guidelines.
2020

2121
---
2222

0 commit comments

Comments
 (0)