Skip to Content
DocsGetting StartedInstallation

Installing Kastrax ✅

This guide will help you set up a new Kastrax project from scratch.

Prerequisites ✅

Before you begin, make sure you have the following installed:

  • JDK 17 or later: Kastrax requires Java 17+
  • Kotlin 2.0 or later: Kastrax is built with Kotlin
  • Gradle 8.0 or later: For building and managing dependencies

Creating a New Project ✅

Option 1: Using Gradle ✅

  1. Create a new Gradle project:
mkdir my-kastrax-project cd my-kastrax-project gradle init --type kotlin-application
  1. Configure your build.gradle.kts file:
plugins { kotlin("jvm") version "2.1.10" kotlin("plugin.serialization") version "2.1.10" application } group = "com.example" version = "1.0-SNAPSHOT" repositories { mavenCentral() } dependencies { // Kastrax Core implementation("ai.kastrax:kastrax-core:0.1.0") // Optional modules based on your needs implementation("ai.kastrax:kastrax-memory-impl:0.1.0") implementation("ai.kastrax:kastrax-integrations-deepseek:0.1.0") // Testing testImplementation(kotlin("test")) } application { mainClass.set("com.example.MainKt") }

Option 2: Using the Kastrax CLI (Coming Soon) ✅

In the future, you’ll be able to use the Kastrax CLI to create a new project:

# This is a preview of future functionality kastrax init my-kastrax-project cd my-kastrax-project

API Keys Setup ✅

Kastrax supports multiple LLM providers. You’ll need to set up API keys for the providers you want to use:

val llm = deepSeek { apiKey("your-deepseek-api-key") model(DeepSeekModel.DEEPSEEK_CHAT) }

OpenAI ✅

val llm = openAi { apiKey("your-openai-api-key") model("gpt-4o") }

Anthropic ✅

val llm = anthropic { apiKey("your-anthropic-api-key") model("claude-3-opus") }

Project Structure ✅

A typical Kastrax project has the following structure:

my-kastrax-project/ ├── build.gradle.kts ├── settings.gradle.kts ├── src/ │ ├── main/ │ │ ├── kotlin/ │ │ │ └── com/ │ │ │ └── example/ │ │ │ ├── Main.kt │ │ │ ├── agents/ │ │ │ │ └── MyAgent.kt │ │ │ ├── tools/ │ │ │ │ └── MyTools.kt │ │ │ └── workflows/ │ │ │ └── MyWorkflow.kt │ │ └── resources/ │ │ └── application.conf │ └── test/ │ └── kotlin/ │ └── com/ │ └── example/ │ └── AgentTest.kt └── gradle/ └── wrapper/ ├── gradle-wrapper.jar └── gradle-wrapper.properties

Verifying Installation ✅

Create a simple agent to verify your installation:

// src/main/kotlin/com/example/Main.kt package com.example import ai.kastrax.core.agent.agent import ai.kastrax.integrations.deepseek.deepSeek import ai.kastrax.integrations.deepseek.DeepSeekModel import kotlinx.coroutines.runBlocking fun main() = runBlocking { val myAgent = agent { name("TestAgent") description("A simple test agent") model = deepSeek { apiKey("your-deepseek-api-key") model(DeepSeekModel.DEEPSEEK_CHAT) temperature(0.7) } } val response = myAgent.generate("Hello, world!") println(response.text) }

Run your application:

gradle run

If everything is set up correctly, you should see a response from your agent.

Next Steps ✅

Now that you have set up your Kastrax project, you can:

  1. Create your first agent
  2. Explore the examples
  3. Learn about agent architectures
Last updated on