Skip to content

๐Ÿš€ Kotlin-based AI agent framework playground featuring examples, strategies, and tools for building intelligent agents with Koog library

License

Notifications You must be signed in to change notification settings

bossm0n5t3r/koog-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

68 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Koog Playground

Kotlin Koog

This repository contains examples and utilities for working with the Koog AI agent framework.

Overview

Koog Playground is a project that demonstrates various capabilities of the Koog framework for building AI agents. It includes examples of:

  • AI agents implementation
  • Strategy patterns for AI interactions
  • API integrations
  • Tool sets for extending agent capabilities
  • Utility functions

Koog Links

Project Structure

Main Source Code

  • src/main/kotlin/Main.kt - Main application entry point
  • src/main/kotlin/QuickstartExample.kt - Quick start example for the Koog framework
  • src/main/kotlin/me/bossm0n5t3r/LoggerExtension.kt - Logger utility extensions

Core Modules

  • src/main/kotlin/me/bossm0n5t3r/agent/ - AI agent implementations
    • AIAgentSample.kt - Sample AI agent implementation
  • src/main/kotlin/me/bossm0n5t3r/api/ - API integration examples
    • PromptApi.kt - Prompt API integration
    • SingleApi.kt - Single API call examples
  • src/main/kotlin/me/bossm0n5t3r/di/ - Dependency injection configuration
    • AppModule.kt - Koin dependency injection module
  • src/main/kotlin/me/bossm0n5t3r/mcp/ - Model Context Protocol implementations
    • GoogleMaps.kt - Google Maps integration for location-based queries
    • Playwright.kt - Playwright for browser automation tasks
  • src/main/kotlin/me/bossm0n5t3r/opentelemetry/ - OpenTelemetry and observability
    • langfuse/ - Langfuse tracing integration
      • AgentWithLangfuseTracing.kt - Agent with Langfuse tracing capabilities
      • docker-compose.yml - Docker setup for Langfuse
  • src/main/kotlin/me/bossm0n5t3r/strategies/ - Strategy patterns for AI interactions
    • CustomStrategyGraphs.kt - Custom strategy graph implementations
    • HistoryCompression.kt - History compression strategies
    • PredefinedStrategiesAndCommonStrategyPatterns.kt - Common strategy patterns
    • StructuredDataProcessing.kt - Structured data processing strategies
  • src/main/kotlin/me/bossm0n5t3r/tools/ - Tool sets for extending agent capabilities
    • AgentWithWeatherToolSet.kt - Agent with weather tool integration
    • DiagnosticToolSet.kt - Diagnostic tools for debugging
    • MyToolSet.kt - Custom tool set implementation
    • WeatherToolSet.kt - Weather-related tools
  • src/main/kotlin/me/bossm0n5t3r/utils/ - Utility functions
    • Helper.kt - Helper utilities

Test Code

  • src/test/kotlin/me/bossm0n5t3r/api/ - API tests
    • PromptApiTest.kt - Tests for Prompt API

Getting Started

Prerequisites

  • JDK 21 or higher
  • Gradle

Setup

  1. Clone the repository
  2. Build the project:
    ./gradlew build
    
  3. Run examples:
    ./gradlew run
    

Examples

Check out QuickstartExample.kt for a simple demonstration of how to use the Koog framework.

Running the Application

The application provides an interactive menu to run different examples:

  1. Run the application:

    ./gradlew run
    
  2. Select an example to run from the menu by entering the corresponding number:

    > Task :run
     00:00:00.249 [main] INFO Application -- Hello, Kotlin!
     00:00:00.311 [main] INFO Application -- Please select the example to run:
     00:00:00.314 [main] INFO Application -- 1. PromptApi
     00:00:00.314 [main] INFO Application -- 2. SingleApi
     00:00:00.314 [main] INFO Application -- 3. AIAgent
     00:00:00.314 [main] INFO Application -- 4. AgentWithWeatherToolSet
     00:00:00.314 [main] INFO Application -- 5. StructuredDataProcessing
     00:00:00.314 [main] INFO Application -- 6. Google Maps
     00:00:00.314 [main] INFO Application -- 7. Playwright
     00:00:00.314 [main] INFO Application -- 0. Exit
     Enter your choice:
     <==========---> 83%00:00:00.773 [main] INFO Application --
    
  3. Follow the prompts for the selected example.

Each example demonstrates different capabilities of the Koog framework:

  • PromptApi: Shows how to use the prompt API for generating responses
  • SingleApi: Demonstrates single API calls to LLM models
  • AIAgent: Basic AI agent implementation
  • AgentWithWeatherToolSet: AI agent with weather-related tools
  • StructuredDataProcessing: Processing structured data with AI
  • Google Maps: Using Google Maps MCP for location-based queries
  • Playwright: Browser automation using Playwright MCP

Dependencies

This project uses:

  • Koog Agents library
  • Koin for dependency injection
  • KotlinX Serialization for JSON handling
  • JUnit 5 and MockK for testing

About

๐Ÿš€ Kotlin-based AI agent framework playground featuring examples, strategies, and tools for building intelligent agents with Koog library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages