client.tools.get(toolId) -> Letta.LettaSchemasToolTool
-
-
-
Get a tool by ID
-
-
-
await client.tools.get("tool_id");
-
-
-
toolId:
string
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.delete(toolId) -> unknown
-
-
-
Delete a tool by name
-
-
-
await client.tools.delete("tool_id");
-
-
-
toolId:
string
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.update(toolId, { ...params }) -> Letta.LettaSchemasToolTool
-
-
-
Update an existing tool
-
-
-
await client.tools.update("tool_id");
-
-
-
toolId:
string
-
request:
Letta.ToolUpdate
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.getByName(toolName) -> string
-
-
-
Get a tool ID by name
-
-
-
await client.tools.getByName("tool_name");
-
-
-
toolName:
string
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.list({ ...params }) -> Letta.LettaSchemasToolTool[]
-
-
-
Get a list of all tools available to agents belonging to the org of the user
-
-
-
await client.tools.list();
-
-
-
request:
Letta.ToolsListRequest
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.create({ ...params }) -> Letta.LettaSchemasToolTool
-
-
-
Create a new tool
-
-
-
await client.tools.create({ sourceCode: "source_code", });
-
-
-
request:
Letta.ToolCreate
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.upsert({ ...params }) -> Letta.LettaSchemasToolTool
-
-
-
Create or update a tool
-
-
-
await client.tools.upsert({ sourceCode: "source_code", });
-
-
-
request:
Letta.ToolCreate
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.addBaseTool() -> Letta.LettaSchemasToolTool[]
-
-
-
Upsert base tools
-
-
-
await client.tools.addBaseTool();
-
-
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.runToolFromSource({ ...params }) -> Letta.ToolReturnMessage
-
-
-
Attempt to build a tool from source, then run it on the provided arguments
-
-
-
await client.tools.runToolFromSource({ sourceCode: "source_code", args: { key: "value", }, });
-
-
-
request:
Letta.ToolRunFromSource
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.listComposioApps() -> Letta.AppModel[]
-
-
-
Get a list of all Composio apps
-
-
-
await client.tools.listComposioApps();
-
-
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.listComposioActionsByApp(composioAppName) -> Letta.ActionModel[]
-
-
-
Get a list of all Composio actions for a specific app
-
-
-
await client.tools.listComposioActionsByApp("composio_app_name");
-
-
-
composioAppName:
string
-
requestOptions:
Tools.RequestOptions
-
-
client.tools.addComposioTool(composioActionName) -> Letta.LettaSchemasToolTool
-
-
-
Add a new Composio tool by action name (Composio refers to each tool as an
Action
)
-
-
-
await client.tools.addComposioTool("composio_action_name");
-
-
-
composioActionName:
string
-
requestOptions:
Tools.RequestOptions
-
-
client.sources.get(sourceId) -> Letta.Source
-
-
-
Get all sources
-
-
-
await client.sources.get("source_id");
-
-
-
sourceId:
string
-
requestOptions:
Sources.RequestOptions
-
-
client.sources.delete(sourceId) -> unknown
-
-
-
Delete a data source.
-
-
-
await client.sources.delete("source_id");
-
-
-
sourceId:
string
-
requestOptions:
Sources.RequestOptions
-
-
client.sources.update(sourceId, { ...params }) -> Letta.Source
-
-
-
Update the name or documentation of an existing data source.
-
-
-
await client.sources.update("source_id");
-
-
-
sourceId:
string
-
request:
Letta.SourceUpdate
-
requestOptions:
Sources.RequestOptions
-
-
client.sources.getByName(sourceName) -> string
-
-
-
Get a source by name
-
-
-
await client.sources.getByName("source_name");
-
-
-
sourceName:
string
-
requestOptions:
Sources.RequestOptions
-
-
client.sources.list() -> Letta.Source[]
-
-
-
List all data sources created by a user.
-
-
-
await client.sources.list();
-
-
-
requestOptions:
Sources.RequestOptions
-
-
client.sources.create({ ...params }) -> Letta.Source
-
-
-
Create a new data source.
-
-
-
await client.sources.create({ name: "name", });
-
-
-
request:
Letta.SourceCreate
-
requestOptions:
Sources.RequestOptions
-
-
client.sources.attach(sourceId, { ...params }) -> Letta.Source
-
-
-
Attach a data source to an existing agent.
-
-
-
await client.sources.attach("source_id", { agentId: "agent_id", });
-
-
-
sourceId:
string
-
request:
Letta.SourcesAttachRequest
-
requestOptions:
Sources.RequestOptions
-
-
client.sources.detach(sourceId, { ...params }) -> Letta.Source
-
-
-
Detach a data source from an existing agent.
-
-
-
await client.sources.detach("source_id", { agentId: "agent_id", });
-
-
-
sourceId:
string
-
request:
Letta.SourcesDetachRequest
-
requestOptions:
Sources.RequestOptions
-
-
client.agents.list({ ...params }) -> Letta.AgentState[]
-
-
-
List all agents associated with a given user. This endpoint retrieves a list of all agents and their configurations associated with the specified user ID.
-
-
-
await client.agents.list();
-
-
-
request:
Letta.AgentsListRequest
-
requestOptions:
Agents.RequestOptions
-
-
client.agents.create({ ...params }) -> Letta.AgentState
-
-
-
Create a new agent with the specified configuration.
-
-
-
await client.agents.create();
-
-
-
request:
Letta.CreateAgentRequest
-
requestOptions:
Agents.RequestOptions
-
-
client.agents.get(agentId) -> Letta.AgentState
-
-
-
Get the state of the agent.
-
-
-
await client.agents.get("agent_id");
-
-
-
agentId:
string
-
requestOptions:
Agents.RequestOptions
-
-
client.agents.delete(agentId) -> unknown
-
-
-
Delete an agent.
-
-
-
await client.agents.delete("agent_id");
-
-
-
agentId:
string
-
requestOptions:
Agents.RequestOptions
-
-
client.agents.update(agentId, { ...params }) -> Letta.AgentState
-
-
-
Update an exsiting agent
-
-
-
await client.agents.update("agent_id");
-
-
-
agentId:
string
-
request:
Letta.UpdateAgent
-
requestOptions:
Agents.RequestOptions
-
-
client.agents.resetMessages(agentId, { ...params }) -> Letta.AgentState
-
-
-
Resets the messages for an agent
-
-
-
await client.agents.resetMessages("agent_id");
-
-
-
agentId:
string
-
request:
Letta.ResetMessagesRequest
-
requestOptions:
Agents.RequestOptions
-
-
client.agents.search({ ...params }) -> void
-
-
-
This endpoint is only available on Letta Cloud.
Search deployed agents.
-
-
-
await client.agents.search();
-
-
-
request:
Letta.AgentsSearchRequest
-
requestOptions:
Agents.RequestOptions
-
-
client.models.listLlms() -> Letta.LlmConfig[]
-
-
-
await client.models.listLlms();
-
-
-
requestOptions:
Models.RequestOptions
-
-
client.models.listEmbeddingModels() -> Letta.EmbeddingConfig[]
-
-
-
await client.models.listEmbeddingModels();
-
-
-
requestOptions:
Models.RequestOptions
-
-
client.blocks.list({ ...params }) -> Letta.Block[]
-
-
-
await client.blocks.list();
-
-
-
request:
Letta.BlocksListRequest
-
requestOptions:
Blocks.RequestOptions
-
-
client.blocks.create({ ...params }) -> Letta.Block
-
-
-
await client.blocks.create({ value: "value", label: "label", });
-
-
-
request:
Letta.CreateBlock
-
requestOptions:
Blocks.RequestOptions
-
-
client.blocks.get(blockId) -> Letta.Block
-
-
-
await client.blocks.get("block_id");
-
-
-
blockId:
string
-
requestOptions:
Blocks.RequestOptions
-
-
client.blocks.delete(blockId) -> Letta.Block
-
-
-
await client.blocks.delete("block_id");
-
-
-
blockId:
string
-
requestOptions:
Blocks.RequestOptions
-
-
client.blocks.update(blockId, { ...params }) -> Letta.Block
-
-
-
await client.blocks.update("block_id", {});
-
-
-
blockId:
string
-
request:
Letta.BlockUpdate
-
requestOptions:
Blocks.RequestOptions
-
-
client.blocks.linkAgentMemoryBlock(blockId, { ...params }) -> void
-
-
-
Link a memory block to an agent.
-
-
-
await client.blocks.linkAgentMemoryBlock("block_id", { agentId: "agent_id", });
-
-
-
blockId:
string
-
request:
Letta.LinkAgentMemoryBlockRequest
-
requestOptions:
Blocks.RequestOptions
-
-
client.blocks.unlinkAgentMemoryBlock(blockId, { ...params }) -> void
-
-
-
Unlink a memory block from an agent
-
-
-
await client.blocks.unlinkAgentMemoryBlock("block_id", { agentId: "agent_id", });
-
-
-
blockId:
string
-
request:
Letta.UnlinkAgentMemoryBlockRequest
-
requestOptions:
Blocks.RequestOptions
-
-
client.jobs.list({ ...params }) -> Letta.Job[]
-
-
-
List all jobs.
-
-
-
await client.jobs.list();
-
-
-
request:
Letta.JobsListRequest
-
requestOptions:
Jobs.RequestOptions
-
-
client.jobs.listActive() -> Letta.Job[]
-
-
-
List all active jobs.
-
-
-
await client.jobs.listActive();
-
-
-
requestOptions:
Jobs.RequestOptions
-
-
client.jobs.get(jobId) -> Letta.Job
-
-
-
Get the status of a job.
-
-
-
await client.jobs.get("job_id");
-
-
-
jobId:
string
-
requestOptions:
Jobs.RequestOptions
-
-
client.jobs.delete(jobId) -> Letta.Job
-
-
-
Delete a job by its job_id.
-
-
-
await client.jobs.delete("job_id");
-
-
-
jobId:
string
-
requestOptions:
Jobs.RequestOptions
-
-
client.health.check() -> Letta.Health
-
-
-
await client.health.check();
-
-
-
requestOptions:
Health.RequestOptions
-
-
client.providers.listProviders({ ...params }) -> Letta.Provider[]
-
-
-
Get a list of all custom providers in the database
-
-
-
await client.providers.listProviders();
-
-
-
request:
Letta.ListProvidersRequest
-
requestOptions:
Providers.RequestOptions
-
-
client.providers.createProvider({ ...params }) -> Letta.Provider
-
-
-
Create a new custom provider
-
-
-
await client.providers.createProvider({ name: "name", apiKey: "api_key", });
-
-
-
request:
Letta.ProviderCreate
-
requestOptions:
Providers.RequestOptions
-
-
client.providers.updateProvider({ ...params }) -> Letta.Provider
-
-
-
Update an existing custom provider
-
-
-
await client.providers.updateProvider({ id: "id", apiKey: "api_key", });
-
-
-
request:
Letta.ProviderUpdate
-
requestOptions:
Providers.RequestOptions
-
-
client.providers.deleteProvider({ ...params }) -> unknown
-
-
-
Delete an existing custom provider
-
-
-
await client.providers.deleteProvider({ providerId: "provider_id", });
-
-
-
request:
Letta.DeleteProviderRequest
-
requestOptions:
Providers.RequestOptions
-
-
client.runs.listRuns() -> Letta.Run[]
-
-
-
List all runs.
-
-
-
await client.runs.listRuns();
-
-
-
requestOptions:
Runs.RequestOptions
-
-
client.runs.listActiveRuns() -> Letta.Run[]
-
-
-
List all active runs.
-
-
-
await client.runs.listActiveRuns();
-
-
-
requestOptions:
Runs.RequestOptions
-
-
client.runs.getRun(runId) -> Letta.Run
-
-
-
Get the status of a run.
-
-
-
await client.runs.getRun("run_id");
-
-
-
runId:
string
-
requestOptions:
Runs.RequestOptions
-
-
client.runs.deleteRun(runId) -> Letta.Run
-
-
-
Delete a run by its run_id.
-
-
-
await client.runs.deleteRun("run_id");
-
-
-
runId:
string
-
requestOptions:
Runs.RequestOptions
-
-
client.runs.getRunMessages(runId, { ...params }) -> Letta.LettaMessageUnion[]
-
-
-
Get messages associated with a run with filtering options.
Args: run_id: ID of the run cursor: Cursor for pagination limit: Maximum number of messages to return ascending: Sort order by creation time role: Filter by role (user/assistant/system/tool) return_message_object: Whether to return Message objects or LettaMessage objects user_id: ID of the user making the request
Returns: A list of messages associated with the run. Default is List[LettaMessage].
-
-
-
await client.runs.getRunMessages("run_id");
-
-
-
runId:
string
-
request:
Letta.GetRunMessagesRequest
-
requestOptions:
Runs.RequestOptions
-
-
client.runs.getRunUsage(runId) -> Letta.UsageStatistics
-
-
-
Get usage statistics for a run.
-
-
-
await client.runs.getRunUsage("run_id");
-
-
-
runId:
string
-
requestOptions:
Runs.RequestOptions
-
-
client.tag.listTags({ ...params }) -> string[]
-
-
-
Get a list of all tags in the database
-
-
-
await client.tag.listTags();
-
-
-
request:
Letta.ListTagsRequest
-
requestOptions:
Tag.RequestOptions
-
-
client.agents.context.get(agentId) -> Letta.ContextWindowOverview
-
-
-
Retrieve the context window of a specific agent.
-
-
-
await client.agents.context.get("agent_id");
-
-
-
agentId:
string
-
requestOptions:
Context.RequestOptions
-
-
client.agents.tools.list(agentId) -> Letta.LettaSchemasToolTool[]
-
-
-
Get tools from an existing agent
-
-
-
await client.agents.tools.list("agent_id");
-
-
-
agentId:
string
-
requestOptions:
Tools.RequestOptions
-
-
client.agents.tools.add(agentId, toolId) -> Letta.AgentState
-
-
-
Add tools to an existing agent
-
-
-
await client.agents.tools.add("agent_id", "tool_id");
-
-
-
agentId:
string
-
toolId:
string
-
requestOptions:
Tools.RequestOptions
-
-
client.agents.tools.remove(agentId, toolId) -> Letta.AgentState
-
-
-
Add tools to an existing agent
-
-
-
await client.agents.tools.remove("agent_id", "tool_id");
-
-
-
agentId:
string
-
toolId:
string
-
requestOptions:
Tools.RequestOptions
-
-
client.agents.sources.get(agentId) -> Letta.Source[]
-
-
-
Get the sources associated with an agent.
-
-
-
await client.agents.sources.get("agent_id");
-
-
-
agentId:
string
-
requestOptions:
Sources.RequestOptions
-
-
client.agents.coreMemory.listInContext(agentId) -> Letta.LettaSchemasMessageMessage[]
-
-
-
Retrieve the messages in the context of a specific agent.
-
-
-
await client.agents.coreMemory.listInContext("agent_id");
-
-
-
agentId:
string
-
requestOptions:
CoreMemory.RequestOptions
-
-
client.agents.coreMemory.get(agentId) -> Letta.Memory
-
-
-
Retrieve the memory state of a specific agent. This endpoint fetches the current memory state of the agent identified by the user ID and agent ID.
-
-
-
await client.agents.coreMemory.get("agent_id");
-
-
-
agentId:
string
-
requestOptions:
CoreMemory.RequestOptions
-
-
client.agents.coreMemory.getBlock(agentId, blockLabel) -> Letta.Block
-
-
-
Retrieve a memory block from an agent.
-
-
-
await client.agents.coreMemory.getBlock("agent_id", "block_label");
-
-
-
agentId:
string
-
blockLabel:
string
-
requestOptions:
CoreMemory.RequestOptions
-
-
client.agents.coreMemory.removeBlock(agentId, blockLabel) -> Letta.Memory
-
-
-
Removes a memory block from an agent by unlnking it. If the block is not linked to any other agent, it is deleted.
-
-
-
await client.agents.coreMemory.removeBlock("agent_id", "block_label");
-
-
-
agentId:
string
-
blockLabel:
string
-
requestOptions:
CoreMemory.RequestOptions
-
-
client.agents.coreMemory.updateBlock(agentId, blockLabel, { ...params }) -> Letta.Block
-
-
-
Removes a memory block from an agent by unlnking it. If the block is not linked to any other agent, it is deleted.
-
-
-
await client.agents.coreMemory.updateBlock("agent_id", "block_label", {});
-
-
-
agentId:
string
-
blockLabel:
string
-
request:
Letta.BlockUpdate
-
requestOptions:
CoreMemory.RequestOptions
-
-
client.agents.coreMemory.getBlocks(agentId) -> Letta.Block[]
-
-
-
Retrieve the memory blocks of a specific agent.
-
-
-
await client.agents.coreMemory.getBlocks("agent_id");
-
-
-
agentId:
string
-
requestOptions:
CoreMemory.RequestOptions
-
-
client.agents.coreMemory.addBlock(agentId, { ...params }) -> Letta.Memory
-
-
-
Creates a memory block and links it to the agent.
-
-
-
await client.agents.coreMemory.addBlock("agent_id", { value: "value", label: "label", });
-
-
-
agentId:
string
-
request:
Letta.CreateBlock
-
requestOptions:
CoreMemory.RequestOptions
-
-
client.agents.recallMemory.getSummary(agentId) -> Letta.RecallMemorySummary
-
-
-
Retrieve the summary of the recall memory of a specific agent.
-
-
-
await client.agents.recallMemory.getSummary("agent_id");
-
-
-
agentId:
string
-
requestOptions:
RecallMemory.RequestOptions
-
-
client.agents.archivalMemory.getSummary(agentId) -> Letta.ArchivalMemorySummary
-
-
-
Retrieve the summary of the archival memory of a specific agent.
-
-
-
await client.agents.archivalMemory.getSummary("agent_id");
-
-
-
agentId:
string
-
requestOptions:
ArchivalMemory.RequestOptions
-
-
client.agents.archivalMemory.list(agentId, { ...params }) -> Letta.Passage[]
-
-
-
Retrieve the memories in an agent's archival memory store (paginated query).
-
-
-
await client.agents.archivalMemory.list("agent_id");
-
-
-
agentId:
string
-
request:
Letta.agents.ArchivalMemoryListRequest
-
requestOptions:
ArchivalMemory.RequestOptions
-
-
client.agents.archivalMemory.create(agentId, { ...params }) -> Letta.Passage[]
-
-
-
Insert a memory into an agent's archival memory store.
-
-
-
await client.agents.archivalMemory.create("agent_id", { text: "text", });
-
-
-
agentId:
string
-
request:
Letta.agents.CreateArchivalMemory
-
requestOptions:
ArchivalMemory.RequestOptions
-
-
client.agents.archivalMemory.delete(agentId, memoryId) -> unknown
-
-
-
Delete a memory from an agent's archival memory store.
-
-
-
await client.agents.archivalMemory.delete("agent_id", "memory_id");
-
-
-
agentId:
string
-
memoryId:
string
-
requestOptions:
ArchivalMemory.RequestOptions
-
-
client.agents.messages.list(agentId, { ...params }) -> Letta.MessagesListResponse
-
-
-
Retrieve message history for an agent.
-
-
-
await client.agents.messages.list("agent_id");
-
-
-
agentId:
string
-
request:
Letta.agents.MessagesListRequest
-
requestOptions:
Messages.RequestOptions
-
-
client.agents.messages.send(agentId, { ...params }) -> Letta.LettaResponse
-
-
-
Process a user message and return the agent's response. This endpoint accepts a message from a user and processes it through the agent.
-
-
-
await client.agents.messages.send("agent_id", { messages: [ { role: "user", text: "text", }, ], });
-
-
-
agentId:
string
-
request:
Letta.LettaRequest
-
requestOptions:
Messages.RequestOptions
-
-
client.agents.messages.update(agentId, messageId, { ...params }) -> Letta.LettaSchemasMessageMessage
-
-
-
Update the details of a message associated with an agent.
-
-
-
await client.agents.messages.update("agent_id", "message_id");
-
-
-
agentId:
string
-
messageId:
string
-
request:
Letta.agents.MessageUpdate
-
requestOptions:
Messages.RequestOptions
-
-
client.agents.messages.stream(agentId, { ...params }) -> core.Stream
-
-
-
Process a user message and return the agent's response. This endpoint accepts a message from a user and processes it through the agent. It will stream the steps of the response always, and stream the tokens if 'stream_tokens' is set to True.
-
-
-
const response = await client.agents.messages.stream("agent_id", { messages: [ { role: "user", text: "text", }, ], }); for await (const item of response) { console.log(item); }
-
-
-
agentId:
string
-
request:
Letta.agents.LettaStreamingRequest
-
requestOptions:
Messages.RequestOptions
-
-
client.agents.messages.sendAsync(agentId, { ...params }) -> Letta.Run
-
-
-
Asynchronously process a user message and return a run object. The actual processing happens in the background, and the status can be checked using the run ID.
-
-
-
await client.agents.messages.sendAsync("agent_id", { messages: [ { role: "user", text: "text", }, ], });
-
-
-
agentId:
string
-
request:
Letta.LettaRequest
-
requestOptions:
Messages.RequestOptions
-
-
client.agents.templates.createVersion(agentId, { ...params }) -> void
-
-
-
This endpoint is only available on Letta Cloud.
Creates a new version of the template version of the agent.
-
-
-
await client.agents.templates.createVersion("agent_id");
-
-
-
agentId:
string
β The agent ID of the agent to migrate, if this agent is not a template, it will create a agent template from the agent provided as well
-
request:
Letta.agents.TemplatesCreateVersionRequest
-
requestOptions:
Templates.RequestOptions
-
-
client.agents.templates.migrate(agentId, { ...params }) -> Letta.TemplatesMigrateResponse
-
-
-
This endpoint is only available on Letta Cloud.
Migrate an agent to a new versioned agent template.
-
-
-
await client.agents.templates.migrate("agent_id", { toTemplate: "to_template", preserveCoreMemories: true, });
-
-
-
agentId:
string
-
request:
Letta.agents.TemplatesMigrateRequest
-
requestOptions:
Templates.RequestOptions
-
-
client.agents.templates.create(agentId, { ...params }) -> void
-
-
-
This endpoint is only available on Letta Cloud.
Creates a template from an agent.
-
-
-
await client.agents.templates.create("agent_id");
-
-
-
agentId:
string
-
request:
Letta.agents.TemplatesCreateRequest
-
requestOptions:
Templates.RequestOptions
-
-
client.agents.memoryVariables.get(agentId) -> Letta.MemoryVariablesGetResponse
-
-
-
This endpoint is only available on Letta Cloud.
Returns the memory variables associated with an agent.
-
-
-
await client.agents.memoryVariables.get("agent_id");
-
-
-
agentId:
string
-
requestOptions:
MemoryVariables.RequestOptions
-
-
client.sources.files.upload(file, sourceId) -> Letta.Job
-
-
-
Upload a file to a data source.
-
-
-
await client.sources.files.upload(fs.createReadStream("/path/to/your/file"), "source_id");
-
-
-
file:
File | fs.ReadStream | Blob
-
sourceId:
string
-
requestOptions:
Files.RequestOptions
-
-
client.sources.files.list(sourceId, { ...params }) -> Letta.FileMetadata[]
-
-
-
List paginated files associated with a data source.
-
-
-
await client.sources.files.list("source_id");
-
-
-
sourceId:
string
-
request:
Letta.sources.FilesListRequest
-
requestOptions:
Files.RequestOptions
-
-
client.sources.files.delete(sourceId, fileId) -> void
-
-
-
Delete a data source.
-
-
-
await client.sources.files.delete("source_id", "file_id");
-
-
-
sourceId:
string
-
fileId:
string
-
requestOptions:
Files.RequestOptions
-
-
client.sources.passages.list(sourceId) -> Letta.Passage[]
-
-
-
List all passages associated with a data source.
-
-
-
await client.sources.passages.list("source_id");
-
-
-
sourceId:
string
-
requestOptions:
Passages.RequestOptions
-
-