PKahfi Blueprint

Platform Engineering Standards

Engineering: AI & LLM

AI Engineering Standards

Intelligence as an Interface. Our AI architecture follows the Hexagonal Pattern, isolating LLM providers behind a strict domain repository.

Hexagonal AI Pattern

We avoid vendor lock-in by using a custom Provider Factory. Our business logic interacts with a Repo interface, not a specific LLM SDK.

Native SDK AdaptersWe use official SDKs (Groq, Google AI) directly inside adapters for maximum control.
Runtime SwitchingDynamic failover between providers (e.g., Groq for speed, Gemini for complex reasoning).
DI + FactoryWe Inject the Factory into the Router. DI manages lifecycle; Factory manages selection logic.
The Factory Pattern

// ai-provider-factory.ts

@injectable()

export class AIProviderFactory {

  getProvider(provider: AIProvider) {

    switch (provider) {

      case 'GROQ': return new GroqService();

      case 'GEMINI': return new GeminiService();

    }

  }

}

// Usage in Router (DI)

const factory = container.get(TYPES.AIFactory);

Building Intelligent SaaS

AI is not a feature, it's a core layer of the PKahfi Platform. We build systems that don't just store data, but understand and act on it.