Agent Management

Manage and troubleshoot agents. Tools for managing files and vector databases included.

Working with agents

Here's some useful things for working with your agent once it's up and running:

Promote an agent

Note: Agent create requests will promote an agent automatically. Agents only need to be promoted after they've been demoted and are in an inactive state.

agent = client.agents.promote(agent.id)
print(f"Agent promoted. Agent ID: {agent.id}")

Demote an agent

Demoting an agent moves it to an inactive state. This is useful when you want to retain the agent's definition without allowing it to handle inference requests.

agent = client.agents.demote(agent.id)
print(f"Agent demoted. Agent ID: {agent.id}")

Delete an agent

This permanently removes an agent from the SeekrFlow platform.

del_response = client.agents.delete(agent.id)
print(f"Agent deleted. Agent ID: {agent.id}")

Vector database management

If your agent is associated with the FileSearch tool, these will come in handy as well:

List all vector databases

databases = await client.vector_database.list()

for db in databases.data:
print(f"ID: {db.id}, Name: {db.name}")

Get a specific vector database

# Get vector database details
db_details = client.vector_database.retrieve(database_id)

print(f"Name: {db_details.name}")
print(f"Last updated: {db_details.updated_at}")

Delete a vector database

# Delete a vector database
client.vector_database.delete(database_id)
print(f"Successfully deleted database {database_id}")

List all files in a vector database

# List files in vector database
db_files = client.vector_database.list_files(database.id)

for file in db_files.data:
    print(f"ID: {file.id}, Filename: {file.filename}")

Delete a file from a vector database

# Delete a file from vector database
client.vector_database.delete_file(database.id, file.id)
print(f"Successfully deleted file {file.id} from {database.id}")

Miscellaneous file operations

List all uploaded files

# List all files
files_response = client.files.list()

for file in files_response.data:
    print(f"ID: {file.id}, Filename: {file.filename}")

Delete a file from the system

# Delete a file
client.files.delete(file.id)
print(f"Successfully deleted file {file.id}")


Next