Skip to content

feat(ai): define server-side AI adapter interface with Gemma mock provider #9

Open

Description

@Icedmist

Summary

Implement the provider-agnostic server-side AI adapter interface in lib/ai/ with a mock provider and Gemma inference integration.

Context

Per docs/ARCHITECTURE.md (Section 7), AI is a supporting tool for categorization, summarization, and duplicate suggestions, not an authoritative judge. The web application must remain fully usable when the AI service is unavailable or offline.

Scope

  1. AI Adapter Interface (lib/ai/adapter.ts):
    • suggestCategory(title, description)
    • generateSummary(description)
    • findPotentialDuplicates(title, description)
  2. Provider Implementations:
    • MockAIProvider for testing and local development without an active model server.
    • GemmaAIProvider connecting to an HTTP inference endpoint configured via GEMMA_BASE_URL and GEMMA_API_TOKEN.
  3. Resilience & Fallback:
    • Non-blocking async execution; submission does not stall or fail if AI inference errors or times out.

Acceptance Criteria

  • Type-safe provider interface implemented.
  • Mock provider delivers instant deterministic responses in dev/test environments.
  • Failure in AI inference leaves manual user submissions unimpaired.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions