Skip to content

SP1.2: Add Koog dependency and AIAgent/AgentService skeleton for Goal 10 dispatcher runtime#755

Open
bedaHovorka with Copilot wants to merge 4 commits into
goal-10from
copilot/add-koog-dependency-agent-service
Open

SP1.2: Add Koog dependency and AIAgent/AgentService skeleton for Goal 10 dispatcher runtime#755
bedaHovorka with Copilot wants to merge 4 commits into
goal-10from
copilot/add-koog-dependency-agent-service

Conversation

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Establishes the agent framework foundation for Goal 10 LLM-driven traffic control. Adds Koog 0.3.0 dependency and implements a lightweight skeleton (no Spring Boot) that will be extended in SP1.3+ with perception/actuator tool bindings and SP1.6 with LLM decision logic.

Changes

Dependency Management

  • Added koogVersion=0.3.0 to gradle.properties
  • Updated dispatcher-agent/build.gradle.kts to declare Koog implementation dependency

Agent Framework Core

  • DomainTool interface: Domain tool abstraction for Koog tool registration (suspend execute method with args Map)
  • AgentService factory interface + KoogDispatchAgent runtime interface: Separates agent creation from runtime behavior
  • DefaultAgentService: Factory producing KoogDispatchAgentImpl instances with configurable tools/model/prompt
  • KoogDispatchAgentImpl: Skeleton returning empty decision list; ready for SP1.6 LLM integration

DI Wiring

  • Updated DispatcherAgentModule to provide AgentService as singleton
  • Added comments indicating SP1.3+ extensions for per-context agent binding and tool adapters

Testing & Documentation

  • 7 new unit tests (all passing): agent creation, initialization, empty decision skeleton behavior, Koin singleton verification
  • docs/SP1_2_AGENT_SKELETON.md: Complete architecture, SP1 phasing roadmap, design rationale

Example Usage (SP1.2 skeleton)

// Inject at module level (singleton)
val agentService: AgentService by inject()

// Create agent with tools and model config (no-op decisions now)
val agent = agentService.createDispatchAgent(
    modelName = "mistral",
    tools = listOf(signalTool, blockTool),  // Tool adapters added in SP1.4
    systemPrompt = "You are a railway dispatcher"
)

// SP1.6 will populate these decisions; currently returns empty list
val decisions = agent.decideAsync(observation)

Notes for Reviewers

  • No Spring Boot: Uses lightweight Koin DI only, aligning with project philosophy
  • Skeleton-first: Minimal working code now; LLM integration deferred to SP1.6 per design plan
  • Interfaces separate factory from runtime for clean testing and extensibility
  • All 2194 core tests passing; no regressions

Copilot AI changed the title [WIP] Add Koog dependency and AIAgent/AgentService skeleton SP1.2: Add Koog dependency and AIAgent/AgentService skeleton for Goal 10 dispatcher runtime Jul 11, 2026
Copilot AI requested a review from bedaHovorka July 11, 2026 19:46

@bedaHovorka bedaHovorka left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

Read *.md documentation and description in supertasks etc. more carefuly

Comment thread gradle.properties Outdated
…ble models

- Upgrade Koog from 0.3.0 to 1.0.0 (first stable release with tool calling)
- Fix test model selection: reject llama2 (no tool support), use verified tool-capable models
- Convert test to @ParametrizedTest with qwen2.5:7b-instruct, llama3.1:8b, gemma3:4b per GOAL_10_SP3_1_LLM_MODEL_EVALUATION.md
- Update SP1_2_AGENT_SKELETON.md with Koog 1.0.0 info and model selection rationale

Addresses reviewer feedback:
- comment 3564919391: Check latest Koog version (now 1.0.0)
- comment 3564922994: Check chosen model name in docs (qwen2.5:7b-instruct)
- comment 3564923716: Use @ParametrizedTest for better coverage
- comment 3564924505: llama2 cannot use tools; fixed
Copilot AI requested a review from bedaHovorka July 11, 2026 20:02
@bedaHovorka bedaHovorka marked this pull request as ready for review July 12, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SP1.2: Add Koog dependency + AIAgent/AgentService skeleton

2 participants