Agents are the core building blocks in Klisk. An agent is an AI system that can reason, use tools, and interact with users to accomplish tasks.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Evincere/klisk/llms.txt
Use this file to discover all available pages before exploring further.
Defining an agent
Usedefine_agent() to create and register an agent:
define_agent() is a thin wrapper around the OpenAI Agents SDK Agent class that automatically registers your agent in the global AgentRegistry so the Studio and CLI can discover it.
Parameters
name
The agent’s unique identifier. Used in the Studio UI and for referencing the agent programmatically.
instructions
The system prompt that defines the agent’s behavior, personality, and capabilities. This guides how the agent interprets user requests and uses tools.
model
The language model to use. Supports OpenAI models and any LiteLLM-compatible provider.
tools
A list of tools the agent can use. Pass
FunctionTool objects or use get_tools() to retrieve registered tools by name.builtin_tools
Enable provider-hosted tools like web search and code interpreter. Only supported with OpenAI models.
temperature
Controls randomness in responses. Range: 0.0 (deterministic) to 2.0 (very random). Defaults to the model’s default.
reasoning_effort
Controls how much reasoning the model applies. Only for o-series models (o1, o3, o4-mini) and gpt-5+ (gpt-5.1, gpt-5.2).
"none", "minimal", "low", "medium", "high", "xhigh"
reasoning_effort to each provider’s equivalent parameter.
Only set
reasoning_effort for reasoning models. It has no effect on standard models like gpt-4o or claude-sonnet-4-5.Agent lifecycle
When you calldefine_agent():
- Model resolution — The model string is parsed and resolved to either a native OpenAI model or a
LitellmModelinstance - Tool registration — All specified tools are validated and attached to the agent
- SDK agent creation — An underlying
Agentinstance from the OpenAI Agents SDK is created - Registry registration — The agent is registered in the global
AgentRegistrywith metadata about its configuration
- Studio discovery — The Klisk Studio UI automatically detects and displays your agent
- CLI access — Commands like
klisk runandklisk checkcan reference your agent - Hot reload — Changes to your code update the Studio in real-time
Source file tracking
define_agent() automatically captures the source file where it’s called using inspect.stack(). This metadata is used by:
- Studio — Shows which file defines each agent
- Hot reload — Watches the correct files for changes
- Error messages — Provides accurate file locations in diagnostics
Complete example
Next steps
Tools
Learn how to create custom tools for your agents
Models
Explore multi-provider support and model configuration