Skip to content

Agents

An agent in Klisk is an AI entity with specific instructions, a language model, and a set of tools that allow it to perform concrete tasks.

Define an agent

Agents are defined with the define_agent function:

python
from klisk import define_agent, get_tools

agent = define_agent(
    name="SalesAssistant",
    instructions="You help the sales team manage leads and opportunities.",
    model="gpt-5.2",
    temperature=0.7,
    tools=get_tools("search_leads", "create_opportunity"),
)

Main parameters

ParameterDescriptionRequired
nameAgent nameYes
instructionsBehavior instructionsYes
modelLanguage model to useYes
temperatureResponse creativity (0-1)No
toolsList of available toolsNo
handoffsOther agents it can hand off toNo
builtin_toolsOpenAI built-in toolsNo

Default model

The recommended model is gpt-5.2. If you want to use other providers (Anthropic, Gemini, etc.), check the other models guide.

Project structure

Each agent lives inside a project with this structure:

my-agent/
├── klisk.config.yaml     # Project configuration
├── .env                  # API keys
├── requirements.txt      # Dependencies
├── .venv/                # Virtual environment
├── src/
│   ├── main.py           # Entry point — defines the agent
│   └── tools/
│       └── ...           # Agent tools
└── tests/

The src/main.py file is the entry point where the main agent is defined.

Multi-agent

You can create multiple agents that collaborate with each other using handoffs:

python
search_agent = define_agent(
    name="Searcher",
    tools=get_tools("search_flights"),
)

main_agent = define_agent(
    name="Coordinator",
    instructions="Route to the right specialist.",
    handoffs=[search_agent],
)

Check the multi-agent guide for more details.

Klisk Documentation