WHOOSH-LLM-002: Implement LLM Integration for Team Composition Engine #3

Open
opened 2025-09-21 06:23:42 +00:00 by tony · 0 comments
Owner

Problem

Core LLM integration functions are stubbed out with "not implemented" errors, causing WHOOSH to fall back to basic heuristics only. This blocks the full AI-powered team composition functionality.

Location

File: internal/composer/service.go
Lines: 143 (classifyTaskWithLLM), 421 (analyzeSkillRequirementsWithLLM)

Missing Implementations

1. classifyTaskWithLLM() - Line 143

Current: Returns "not implemented" error
Required: Implement LLM-powered task classification using Ollama API

2. analyzeSkillRequirementsWithLLM() - Line 421

Current: Returns "not implemented" error
Required: Implement LLM-powered skill requirement analysis

Technical Requirements

LLM Integration Architecture

  1. Ollama API Integration:

    • Connect to local Ollama instances (192.168.1.{27,72,113,106}:11434)
    • Model selection based on task complexity
    • Proper error handling and fallback to heuristics
  2. Task Classification:

    • Analyze project requirements and classify task types
    • Determine complexity levels and required expertise
    • Map to predefined role categories
  3. Skill Requirement Analysis:

    • Parse project documentation and codebase
    • Identify required technical skills and domain knowledge
    • Generate skill requirement profiles for team formation

Feature Flag Support

Implementation should respect existing feature flags:

  • WHOOSH_FEATURE_LLM_CLASSIFICATION - AI vs rule-based classification
  • WHOOSH_FEATURE_LLM_SKILL_ANALYSIS - AI skill requirement analysis

Priority

High - Core functionality for AI-powered team composition

Requirement Traceability

@goal: WHOOSH-LLM-002, WSH-AUTO - LLM-powered team composition

Dependencies

  • Ollama API endpoints available on cluster
  • Team Composer Spec requirements (lines 51-229)
  • Feature flag configuration system

Implementation Notes

Example Integration Pattern

func (s *Service) classifyTaskWithLLM(ctx context.Context, task Task) (*Classification, error) {
    if !s.config.Features.LLMClassification {
        return s.classifyTaskWithHeuristics(ctx, task)
    }
    
    // Ollama API call
    client := ollama.NewClient(s.config.OllamaEndpoint)
    result, err := client.Generate(ctx, &ollama.GenerateRequest{
        Model: "llama3.1:8b",
        Prompt: s.buildClassificationPrompt(task),
    })
    
    if err != nil {
        // Fallback to heuristics on error
        log.Warn("LLM classification failed, falling back to heuristics", "error", err)
        return s.classifyTaskWithHeuristics(ctx, task)
    }
    
    return s.parseClassificationResponse(result.Response)
}

Acceptance Criteria

  • classifyTaskWithLLM() connects to Ollama and returns valid classifications
  • analyzeSkillRequirementsWithLLM() analyzes requirements and returns skill profiles
  • Feature flags properly control LLM vs heuristic execution
  • Graceful fallback to heuristics on LLM API failures
  • Integration tests verify Ollama connectivity
  • Unit tests cover prompt generation and response parsing
  • Performance acceptable (< 5s response time for typical requests)
## Problem Core LLM integration functions are stubbed out with "not implemented" errors, causing WHOOSH to fall back to basic heuristics only. This blocks the full AI-powered team composition functionality. ## Location **File:** `internal/composer/service.go` **Lines:** 143 (classifyTaskWithLLM), 421 (analyzeSkillRequirementsWithLLM) ## Missing Implementations ### 1. classifyTaskWithLLM() - Line 143 **Current:** Returns "not implemented" error **Required:** Implement LLM-powered task classification using Ollama API ### 2. analyzeSkillRequirementsWithLLM() - Line 421 **Current:** Returns "not implemented" error **Required:** Implement LLM-powered skill requirement analysis ## Technical Requirements ### LLM Integration Architecture 1. **Ollama API Integration:** - Connect to local Ollama instances (192.168.1.{27,72,113,106}:11434) - Model selection based on task complexity - Proper error handling and fallback to heuristics 2. **Task Classification:** - Analyze project requirements and classify task types - Determine complexity levels and required expertise - Map to predefined role categories 3. **Skill Requirement Analysis:** - Parse project documentation and codebase - Identify required technical skills and domain knowledge - Generate skill requirement profiles for team formation ## Feature Flag Support Implementation should respect existing feature flags: - `WHOOSH_FEATURE_LLM_CLASSIFICATION` - AI vs rule-based classification - `WHOOSH_FEATURE_LLM_SKILL_ANALYSIS` - AI skill requirement analysis ## Priority **High** - Core functionality for AI-powered team composition ## Requirement Traceability @goal: WHOOSH-LLM-002, WSH-AUTO - LLM-powered team composition ## Dependencies - Ollama API endpoints available on cluster - Team Composer Spec requirements (lines 51-229) - Feature flag configuration system ## Implementation Notes ### Example Integration Pattern ```go func (s *Service) classifyTaskWithLLM(ctx context.Context, task Task) (*Classification, error) { if !s.config.Features.LLMClassification { return s.classifyTaskWithHeuristics(ctx, task) } // Ollama API call client := ollama.NewClient(s.config.OllamaEndpoint) result, err := client.Generate(ctx, &ollama.GenerateRequest{ Model: "llama3.1:8b", Prompt: s.buildClassificationPrompt(task), }) if err != nil { // Fallback to heuristics on error log.Warn("LLM classification failed, falling back to heuristics", "error", err) return s.classifyTaskWithHeuristics(ctx, task) } return s.parseClassificationResponse(result.Response) } ``` ## Acceptance Criteria - [ ] classifyTaskWithLLM() connects to Ollama and returns valid classifications - [ ] analyzeSkillRequirementsWithLLM() analyzes requirements and returns skill profiles - [ ] Feature flags properly control LLM vs heuristic execution - [ ] Graceful fallback to heuristics on LLM API failures - [ ] Integration tests verify Ollama connectivity - [ ] Unit tests cover prompt generation and response parsing - [ ] Performance acceptable (< 5s response time for typical requests)
tony added the
bzzz-task
label 2025-09-21 06:29:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tony/WHOOSH#3
No description provided.