Install the SDK
Get an API key
- Sign up at app.kairn.sh
- Go to Settings → API Keys
- Create a new key — it starts with
kn_live_
Initialise the client
Create a soul
A soul is the agent’s identity — its instructions, personality, and tool access. Create it once; it serves all your users.You only need to create a soul once. After that, you can update it with
kairn.souls.update().Seed user context
Write context from your database into the agent’s memory before invoking. The agent reads it automatically.Invoke the agent
Stream the response
For chat interfaces, usestream() to yield tokens as the agent generates them.
Next steps
Core concepts
Understand souls, memory, sessions, and mandates.
Customer support
Build a support agent that knows your users and takes real actions.
Mandates
Schedule agents to run autonomously — check-ins, reports, nudges.
SDK reference
Full API reference for every method and type.