@kyronixai/runtime
v1.0.7
Published
> The server-side runtime for Kyronix.
Readme
@kyronixai/runtime
The server-side runtime for Kyronix.
The @kyronixai/runtime package is the server-side SDK that powers the Kyronix Agentic Runtime. It handles communication with the Kyronix platform, manages agent sessions, streams responses, authenticates requests, and coordinates execution with the Kyronix client executor.
Instead of implementing planning loops, tool orchestration, memory handling, and execution pipelines yourself, simply integrate the runtime and focus on building your application.
Installation
npm install @kyronixai/runtimeor
pnpm add @kyronixai/runtimeor
yarn add @kyronixai/runtimeRequirements
- Node.js 20+
- A Kyronix API Key
- A Kyronix Project
Create one at:
https://kyronix.harshitnakrani.me
Quick Start
import { Kyronix } from "@kyronixai/runtime";
const kyronix = new Kyronix({
apiKey: process.env.KYRONIX_API_KEY!,
});Run an agent.
const response = await kyronix.run({
agent: "coding",
input: "Create an Express server.",
});
console.log(response);Running Custom Agents
Execute any custom agent created via the Kyronix Dashboard:
const response = await kyronix.runCustomAgent({
agentId: "custom_agent_id_hash",
input: "Perform web search for latest AI news.",
});
console.log(response);List all custom agents registered to your account:
const customAgents = await kyronix.listCustomAgents();
console.log(customAgents);What this package does
The runtime is responsible for communicating with the Kyronix Platform.
It automatically manages:
- Authentication
- Agent Sessions
- Streaming
- API Communication
- Credits
- Request Lifecycle
- Execution State
- WebSocket Communication
- Agent Coordination
It does not execute tools directly.
Tool execution happens inside the @kyronixai/executer package running on the user's machine.
Architecture
Your Backend
│
│
@kyronixai/runtime
│
HTTPS / WebSocket
│
Kyronix Platform
│
KML Execution Messages
│
@kyronixai/executer
│
Terminal • Files • BrowserBasic Usage
const response = await kyronix.run({
agent: "assistant",
input: "Summarize this repository.",
});Streaming
await kyronix.stream({
agent: "coding",
input: "Create a Next.js authentication system.",
onChunk(chunk) {
console.log(chunk);
},
onComplete(result) {
console.log(result);
}
});Sessions
Continue an existing conversation.
await kyronix.run({
sessionId: "session_id",
agent: "assistant",
input: "Continue from the previous task."
});Available Agents
- Assistant
- Coding
- Research
- Database
- RAG
- Browser
- Workflow
- Customer Support
- Sales
- Data Analyst
- Document
Using the Client Executor
For agents that need filesystem access, terminal execution, browser automation, or other local capabilities, pair this package with @kyronixai/executer.
The runtime communicates with the client executor automatically over a secure connection.
Backend
│
▼
@kyronixai/runtime
│
Kyronix Platform
│
▼
@kyronixai/executer
│
Local MachineConfiguration
const kyronix = new Kyronix({
apiKey: process.env.KYRONIX_API_KEY,
projectId: process.env.KYRONIX_PROJECT_ID,
websocket: true,
timeout: 60000,
});API
Initialize
new Kyronix(config)Run
await kyronix.run(options)Run Custom Agent
await kyronix.runCustomAgent(options)Executes a custom agent registered via the dashboard using its agent ID hash.
Stream Custom Agent
await kyronix.streamCustomAgent(options)Streams live execution results for a custom agent.
List Custom Agents
await kyronix.listCustomAgents()Lists all custom agents and tools associated with your project.
Sessions
kyronix.session(id)Resume an existing session.
Disconnect
await kyronix.close()Gracefully closes active connections.
Error Handling
try {
await kyronix.run(...);
} catch (error) {
console.error(error);
}Security
Never expose your API key to the browser.
The runtime package is intended to run only on your backend.
For frontend applications, use @kyronixai/executer.
Documentation
Full documentation is available at:
https://kyronix.harshitnakrani.me
License
MIT
Built with ❤️ by the Kyronix Team.
