SDK Restructuring: Multi-Module Architecture #635
renuka-fernando
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Statement
The current SDK structure bundles all functionality into a single monolithic module, creating several limitations:
Current Structure
Limitations
Dependency Bloat (Current Problem)
milvus-io/milvus/client/v2- Vector database clientredis/go-redis/v9- Redis clientPolicyinterface gets ~90KB go.sumTight Coupling
Unclear Boundaries
gateway/policy/v1alpha/(core) andutils/embeddingproviders/(AI) are siblings under same moduleVersioning Constraints
sdk/core v1.0.0(stable) withsdk/ai v0.2.0(experimental)Proposed Solution
Restructure SDK into multiple independent Go modules under a nested directory structure:
Benefits
1. Dependency Isolation
sdk/core(~20KB)sdk/core+sdk/ai(with AI dependencies)2. Independent Versioning
3. Clear Architecture
4. Flexibility
5. Better Maintenance
Module Characteristics
goccy/go-json)Import Path Examples
Before (Monolithic)
After (Multi-Module)
Policy go.mod Examples
Basic Policy (e.g., Rate Limiting, Header Modification)
Dependencies: Only stdlib + minimal JSON library (~small binary)
AI-Powered Policy (e.g., Semantic Cache)
Dependencies: Core + milvus-client, redis, net/http (larger binary, only for AI policies)
Breaking Changes
Impact
sdk/gateway/policy/v1alpha→sdk/core/policysdk/gateway/policyengine/v1→sdk/core/policyenginesdk/utils/embeddingproviders→sdk/ai/embeddingssdk/utils/vectordbproviders→sdk/ai/vectordbsdk/utils(jsonpath) →sdk/core/utilsgo.modfiles need updated module pathsMigration Effort
Migration Path
Step 1: Restructure SDK into Core Module
Step 1.5: Create AI Module (for embedding/vectordb providers)
Step 2: Update Policy Engine Runtime
Step 3: Update All Sample Policies
Step 4: Update Gateway Builder
Beta Was this translation helpful? Give feedback.
All reactions