Attach Folder To Agent
agents.folders.attach(strfolder_id, FolderAttachParams**kwargs) -> AgentState
/v1/agents/{agent_id}/folders/attach/{folder_id}
Attach a folder to an agent.
Parameters
Returns
Attach Folder To Agent
from letta_client import Letta
client = Letta(
api_key="My API Key",
)
agent_state = client.agents.folders.attach(
folder_id="source-123e4567-e89b-42d3-8456-426614174000",
agent_id="agent-123e4567-e89b-42d3-8456-426614174000",
)
print(agent_state.id)
{
"id": "id",
"agent_type": "memgpt_agent",
"blocks": [
{
"value": "value",
"id": "block-123e4567-e89b-12d3-a456-426614174000",
"base_template_id": "base_template_id",
"created_by_id": "created_by_id",
"deployment_id": "deployment_id",
"description": "description",
"entity_id": "entity_id",
"hidden": true,
"is_template": true,
"label": "label",
"last_updated_by_id": "last_updated_by_id",
"limit": 0,
"metadata": {
"foo": "bar"
},
"preserve_on_migration": true,
"project_id": "project_id",
"read_only": true,
"template_id": "template_id",
"template_name": "template_name"
}
],
"embedding_config": {
"embedding_dim": 0,
"embedding_endpoint_type": "openai",
"embedding_model": "embedding_model",
"azure_deployment": "azure_deployment",
"azure_endpoint": "azure_endpoint",
"azure_version": "azure_version",
"batch_size": 0,
"embedding_chunk_size": 0,
"embedding_endpoint": "embedding_endpoint",
"handle": "handle"
},
"llm_config": {
"context_window": 0,
"model": "model",
"model_endpoint_type": "openai",
"compatibility_type": "gguf",
"display_name": "display_name",
"enable_reasoner": true,
"frequency_penalty": 0,
"handle": "handle",
"max_reasoning_tokens": 0,
"max_tokens": 0,
"model_endpoint": "model_endpoint",
"model_wrapper": "model_wrapper",
"parallel_tool_calls": true,
"provider_category": "base",
"provider_name": "provider_name",
"put_inner_thoughts_in_kwargs": true,
"reasoning_effort": "minimal",
"temperature": 0,
"tier": "tier",
"verbosity": "low"
},
"memory": {
"blocks": [
{
"value": "value",
"id": "block-123e4567-e89b-12d3-a456-426614174000",
"base_template_id": "base_template_id",
"created_by_id": "created_by_id",
"deployment_id": "deployment_id",
"description": "description",
"entity_id": "entity_id",
"hidden": true,
"is_template": true,
"label": "label",
"last_updated_by_id": "last_updated_by_id",
"limit": 0,
"metadata": {
"foo": "bar"
},
"preserve_on_migration": true,
"project_id": "project_id",
"read_only": true,
"template_id": "template_id",
"template_name": "template_name"
}
],
"agent_type": "memgpt_agent",
"file_blocks": [
{
"file_id": "file_id",
"is_open": true,
"source_id": "source_id",
"value": "value",
"id": "block-123e4567-e89b-12d3-a456-426614174000",
"base_template_id": "base_template_id",
"created_by_id": "created_by_id",
"deployment_id": "deployment_id",
"description": "description",
"entity_id": "entity_id",
"hidden": true,
"is_template": true,
"label": "label",
"last_accessed_at": "2019-12-27T18:11:19.117Z",
"last_updated_by_id": "last_updated_by_id",
"limit": 0,
"metadata": {
"foo": "bar"
},
"preserve_on_migration": true,
"project_id": "project_id",
"read_only": true,
"template_id": "template_id",
"template_name": "template_name"
}
],
"prompt_template": "prompt_template"
},
"name": "name",
"sources": [
{
"id": "source-123e4567-e89b-12d3-a456-426614174000",
"embedding_config": {
"embedding_dim": 0,
"embedding_endpoint_type": "openai",
"embedding_model": "embedding_model",
"azure_deployment": "azure_deployment",
"azure_endpoint": "azure_endpoint",
"azure_version": "azure_version",
"batch_size": 0,
"embedding_chunk_size": 0,
"embedding_endpoint": "embedding_endpoint",
"handle": "handle"
},
"name": "name",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by_id": "created_by_id",
"description": "description",
"instructions": "instructions",
"last_updated_by_id": "last_updated_by_id",
"metadata": {
"foo": "bar"
},
"updated_at": "2019-12-27T18:11:19.117Z",
"vector_db_provider": "native"
}
],
"system": "system",
"tags": [
"string"
],
"tools": [
{
"id": "tool-123e4567-e89b-12d3-a456-426614174000",
"args_json_schema": {
"foo": "bar"
},
"created_by_id": "created_by_id",
"default_requires_approval": true,
"description": "description",
"enable_parallel_execution": true,
"json_schema": {
"foo": "bar"
},
"last_updated_by_id": "last_updated_by_id",
"metadata_": {
"foo": "bar"
},
"name": "name",
"npm_requirements": [
{
"name": "x",
"version": "version"
}
],
"pip_requirements": [
{
"name": "x",
"version": "version"
}
],
"return_char_limit": 1,
"source_code": "source_code",
"source_type": "source_type",
"tags": [
"string"
],
"tool_type": "custom"
}
],
"base_template_id": "base_template_id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by_id": "created_by_id",
"deployment_id": "deployment_id",
"description": "description",
"embedding": {
"model": "model",
"provider": "openai"
},
"enable_sleeptime": true,
"entity_id": "entity_id",
"hidden": true,
"identities": [
{
"id": "identity-123e4567-e89b-12d3-a456-426614174000",
"agent_ids": [
"string"
],
"block_ids": [
"string"
],
"identifier_key": "identifier_key",
"identity_type": "org",
"name": "name",
"project_id": "project_id",
"properties": [
{
"key": "key",
"type": "string",
"value": "string"
}
]
}
],
"identity_ids": [
"string"
],
"last_run_completion": "2019-12-27T18:11:19.117Z",
"last_run_duration_ms": 0,
"last_stop_reason": "end_turn",
"last_updated_by_id": "last_updated_by_id",
"managed_group": {
"id": "id",
"agent_ids": [
"string"
],
"description": "description",
"manager_type": "round_robin",
"base_template_id": "base_template_id",
"deployment_id": "deployment_id",
"hidden": true,
"last_processed_message_id": "last_processed_message_id",
"manager_agent_id": "manager_agent_id",
"max_message_buffer_length": 0,
"max_turns": 0,
"min_message_buffer_length": 0,
"project_id": "project_id",
"shared_block_ids": [
"string"
],
"sleeptime_agent_frequency": 0,
"template_id": "template_id",
"termination_token": "termination_token",
"turns_counter": 0
},
"max_files_open": 0,
"message_buffer_autoclear": true,
"message_ids": [
"string"
],
"metadata": {
"foo": "bar"
},
"model": {
"model": "model",
"max_output_tokens": 0,
"parallel_tool_calls": true
},
"multi_agent_group": {
"id": "id",
"agent_ids": [
"string"
],
"description": "description",
"manager_type": "round_robin",
"base_template_id": "base_template_id",
"deployment_id": "deployment_id",
"hidden": true,
"last_processed_message_id": "last_processed_message_id",
"manager_agent_id": "manager_agent_id",
"max_message_buffer_length": 0,
"max_turns": 0,
"min_message_buffer_length": 0,
"project_id": "project_id",
"shared_block_ids": [
"string"
],
"sleeptime_agent_frequency": 0,
"template_id": "template_id",
"termination_token": "termination_token",
"turns_counter": 0
},
"per_file_view_window_char_limit": 0,
"project_id": "project_id",
"response_format": {
"type": "text"
},
"secrets": [
{
"agent_id": "agent_id",
"key": "key",
"value": "value",
"id": "agent-env-123e4567-e89b-12d3-a456-426614174000",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by_id": "created_by_id",
"description": "description",
"last_updated_by_id": "last_updated_by_id",
"updated_at": "2019-12-27T18:11:19.117Z",
"value_enc": "value_enc"
}
],
"template_id": "template_id",
"timezone": "timezone",
"tool_exec_environment_variables": [
{
"agent_id": "agent_id",
"key": "key",
"value": "value",
"id": "agent-env-123e4567-e89b-12d3-a456-426614174000",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by_id": "created_by_id",
"description": "description",
"last_updated_by_id": "last_updated_by_id",
"updated_at": "2019-12-27T18:11:19.117Z",
"value_enc": "value_enc"
}
],
"tool_rules": [
{
"children": [
"string"
],
"tool_name": "tool_name",
"child_arg_nodes": [
{
"name": "name",
"args": {
"foo": "bar"
}
}
],
"prompt_template": "prompt_template",
"type": "constrain_child_tools"
}
],
"updated_at": "2019-12-27T18:11:19.117Z"
}Returns Examples
{
"id": "id",
"agent_type": "memgpt_agent",
"blocks": [
{
"value": "value",
"id": "block-123e4567-e89b-12d3-a456-426614174000",
"base_template_id": "base_template_id",
"created_by_id": "created_by_id",
"deployment_id": "deployment_id",
"description": "description",
"entity_id": "entity_id",
"hidden": true,
"is_template": true,
"label": "label",
"last_updated_by_id": "last_updated_by_id",
"limit": 0,
"metadata": {
"foo": "bar"
},
"preserve_on_migration": true,
"project_id": "project_id",
"read_only": true,
"template_id": "template_id",
"template_name": "template_name"
}
],
"embedding_config": {
"embedding_dim": 0,
"embedding_endpoint_type": "openai",
"embedding_model": "embedding_model",
"azure_deployment": "azure_deployment",
"azure_endpoint": "azure_endpoint",
"azure_version": "azure_version",
"batch_size": 0,
"embedding_chunk_size": 0,
"embedding_endpoint": "embedding_endpoint",
"handle": "handle"
},
"llm_config": {
"context_window": 0,
"model": "model",
"model_endpoint_type": "openai",
"compatibility_type": "gguf",
"display_name": "display_name",
"enable_reasoner": true,
"frequency_penalty": 0,
"handle": "handle",
"max_reasoning_tokens": 0,
"max_tokens": 0,
"model_endpoint": "model_endpoint",
"model_wrapper": "model_wrapper",
"parallel_tool_calls": true,
"provider_category": "base",
"provider_name": "provider_name",
"put_inner_thoughts_in_kwargs": true,
"reasoning_effort": "minimal",
"temperature": 0,
"tier": "tier",
"verbosity": "low"
},
"memory": {
"blocks": [
{
"value": "value",
"id": "block-123e4567-e89b-12d3-a456-426614174000",
"base_template_id": "base_template_id",
"created_by_id": "created_by_id",
"deployment_id": "deployment_id",
"description": "description",
"entity_id": "entity_id",
"hidden": true,
"is_template": true,
"label": "label",
"last_updated_by_id": "last_updated_by_id",
"limit": 0,
"metadata": {
"foo": "bar"
},
"preserve_on_migration": true,
"project_id": "project_id",
"read_only": true,
"template_id": "template_id",
"template_name": "template_name"
}
],
"agent_type": "memgpt_agent",
"file_blocks": [
{
"file_id": "file_id",
"is_open": true,
"source_id": "source_id",
"value": "value",
"id": "block-123e4567-e89b-12d3-a456-426614174000",
"base_template_id": "base_template_id",
"created_by_id": "created_by_id",
"deployment_id": "deployment_id",
"description": "description",
"entity_id": "entity_id",
"hidden": true,
"is_template": true,
"label": "label",
"last_accessed_at": "2019-12-27T18:11:19.117Z",
"last_updated_by_id": "last_updated_by_id",
"limit": 0,
"metadata": {
"foo": "bar"
},
"preserve_on_migration": true,
"project_id": "project_id",
"read_only": true,
"template_id": "template_id",
"template_name": "template_name"
}
],
"prompt_template": "prompt_template"
},
"name": "name",
"sources": [
{
"id": "source-123e4567-e89b-12d3-a456-426614174000",
"embedding_config": {
"embedding_dim": 0,
"embedding_endpoint_type": "openai",
"embedding_model": "embedding_model",
"azure_deployment": "azure_deployment",
"azure_endpoint": "azure_endpoint",
"azure_version": "azure_version",
"batch_size": 0,
"embedding_chunk_size": 0,
"embedding_endpoint": "embedding_endpoint",
"handle": "handle"
},
"name": "name",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by_id": "created_by_id",
"description": "description",
"instructions": "instructions",
"last_updated_by_id": "last_updated_by_id",
"metadata": {
"foo": "bar"
},
"updated_at": "2019-12-27T18:11:19.117Z",
"vector_db_provider": "native"
}
],
"system": "system",
"tags": [
"string"
],
"tools": [
{
"id": "tool-123e4567-e89b-12d3-a456-426614174000",
"args_json_schema": {
"foo": "bar"
},
"created_by_id": "created_by_id",
"default_requires_approval": true,
"description": "description",
"enable_parallel_execution": true,
"json_schema": {
"foo": "bar"
},
"last_updated_by_id": "last_updated_by_id",
"metadata_": {
"foo": "bar"
},
"name": "name",
"npm_requirements": [
{
"name": "x",
"version": "version"
}
],
"pip_requirements": [
{
"name": "x",
"version": "version"
}
],
"return_char_limit": 1,
"source_code": "source_code",
"source_type": "source_type",
"tags": [
"string"
],
"tool_type": "custom"
}
],
"base_template_id": "base_template_id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by_id": "created_by_id",
"deployment_id": "deployment_id",
"description": "description",
"embedding": {
"model": "model",
"provider": "openai"
},
"enable_sleeptime": true,
"entity_id": "entity_id",
"hidden": true,
"identities": [
{
"id": "identity-123e4567-e89b-12d3-a456-426614174000",
"agent_ids": [
"string"
],
"block_ids": [
"string"
],
"identifier_key": "identifier_key",
"identity_type": "org",
"name": "name",
"project_id": "project_id",
"properties": [
{
"key": "key",
"type": "string",
"value": "string"
}
]
}
],
"identity_ids": [
"string"
],
"last_run_completion": "2019-12-27T18:11:19.117Z",
"last_run_duration_ms": 0,
"last_stop_reason": "end_turn",
"last_updated_by_id": "last_updated_by_id",
"managed_group": {
"id": "id",
"agent_ids": [
"string"
],
"description": "description",
"manager_type": "round_robin",
"base_template_id": "base_template_id",
"deployment_id": "deployment_id",
"hidden": true,
"last_processed_message_id": "last_processed_message_id",
"manager_agent_id": "manager_agent_id",
"max_message_buffer_length": 0,
"max_turns": 0,
"min_message_buffer_length": 0,
"project_id": "project_id",
"shared_block_ids": [
"string"
],
"sleeptime_agent_frequency": 0,
"template_id": "template_id",
"termination_token": "termination_token",
"turns_counter": 0
},
"max_files_open": 0,
"message_buffer_autoclear": true,
"message_ids": [
"string"
],
"metadata": {
"foo": "bar"
},
"model": {
"model": "model",
"max_output_tokens": 0,
"parallel_tool_calls": true
},
"multi_agent_group": {
"id": "id",
"agent_ids": [
"string"
],
"description": "description",
"manager_type": "round_robin",
"base_template_id": "base_template_id",
"deployment_id": "deployment_id",
"hidden": true,
"last_processed_message_id": "last_processed_message_id",
"manager_agent_id": "manager_agent_id",
"max_message_buffer_length": 0,
"max_turns": 0,
"min_message_buffer_length": 0,
"project_id": "project_id",
"shared_block_ids": [
"string"
],
"sleeptime_agent_frequency": 0,
"template_id": "template_id",
"termination_token": "termination_token",
"turns_counter": 0
},
"per_file_view_window_char_limit": 0,
"project_id": "project_id",
"response_format": {
"type": "text"
},
"secrets": [
{
"agent_id": "agent_id",
"key": "key",
"value": "value",
"id": "agent-env-123e4567-e89b-12d3-a456-426614174000",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by_id": "created_by_id",
"description": "description",
"last_updated_by_id": "last_updated_by_id",
"updated_at": "2019-12-27T18:11:19.117Z",
"value_enc": "value_enc"
}
],
"template_id": "template_id",
"timezone": "timezone",
"tool_exec_environment_variables": [
{
"agent_id": "agent_id",
"key": "key",
"value": "value",
"id": "agent-env-123e4567-e89b-12d3-a456-426614174000",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by_id": "created_by_id",
"description": "description",
"last_updated_by_id": "last_updated_by_id",
"updated_at": "2019-12-27T18:11:19.117Z",
"value_enc": "value_enc"
}
],
"tool_rules": [
{
"children": [
"string"
],
"tool_name": "tool_name",
"child_arg_nodes": [
{
"name": "name",
"args": {
"foo": "bar"
}
}
],
"prompt_template": "prompt_template",
"type": "constrain_child_tools"
}
],
"updated_at": "2019-12-27T18:11:19.117Z"
}