AI Execution Context API Guide
Learn how to manage AI execution contexts using the Wacht Rust SDK. Execution contexts provide isolated environments for running AI agents with specific system instructions and configurations.Prerequisites
Before using any API methods, you must initialize the SDK:List Execution Contexts
Get all execution contexts in your deployment.Basic List
With Filters
Create Execution Context
Create a new execution context for AI operations.Update Execution Context
Modify an existing execution context.Execute Agent
Run an AI agent within a specific execution context.Builder Methods
ListExecutionContextsBuilder
limit(i32)- Number of results to return (max 100)offset(i32)- Number of results to skipstatus(&str)- Filter by statuscontext_group(&str)- Filter by context group
UpdateExecutionContextBuilder
with_title(&str)- Update context titlewith_system_instructions(&str)- Update system instructionswith_context_group(&str)- Update context groupwith_status(&str)- Update status
Request Models
CreateAiExecutionContextRequest
title(String) - Context title (required)system_instructions(Option<String>) - System instructions for the AIcontext_group(Option<String>) - Group identifier for the contextstatus(Option<String>) - Context status (e.g., “active”, “inactive”)
ExecuteAgentRequest
agent_name(String) - Name of the agent to execute (required)execution_type(ExecuteAgentRequestType) - Type of execution (required)
ExecuteAgentRequestType
Variants for different execution types:NewMessage { message: String, files: Option<Vec<String>> }- Execute with a new messageContinue { files: Option<Vec<String>> }- Continue previous conversationStream { message: String, files: Option<Vec<String>> }- Stream response
Context States
Execution contexts can have different states:active- Context is active and ready for executioninactive- Context is disabledarchived- Context is archived
System Instructions
System instructions define the behavior and personality of the AI within the context:Context Groups
Context groups help organize related execution contexts:Error Handling
All SDK methods return aResult<T, Error>:
Related
- Installation - SDK setup
- Agents Guide - AI agent management
- Tools Guide - Tool configuration
- Knowledge Bases Guide - Knowledge base management
- API Reference - Backend API - Full API docs
