v0.3.0: Major restructuring to modular architecture
🏗️ Major Restructuring to Modular Architecture
This release represents a significant architectural improvement, transforming the semantic cache library from a monolithic to a clean, modular structure.
✨ New Features
- Modular Package Structure: Split functionality into dedicated packages
similarity/- All similarity algorithms (cosine, euclidean, etc.)options/- Functional configuration options
- Enhanced Documentation: Added comprehensive AI agent instructions
CLAUDE.md- Claude-specific development guideAGENTS.md- Universal AI agent instructions
🔧 Improvements
- Cleaner Imports: More intuitive package organization
- Better Code Organization: Logical separation of concerns
- Enhanced Developer Experience: Clearer API structure
- Comprehensive Testing: All tests passing with zero linting errors
📖 Updated Usage
Before (v0.2.x):
cache := semanticcache.New(
semanticcache.WithLRUBackend(100),
semanticcache.WithSimilarityComparator(semanticcache.CosineSimilarity),
)After (v0.3.0):
import (
"github.com/botirk38/semanticcache"
"github.com/botirk38/semanticcache/options"
"github.com/botirk38/semanticcache/similarity"
)
cache := semanticcache.New(
options.WithLRUBackend(100),
options.WithSimilarityComparator(similarity.CosineSimilarity),
)⚠️ Breaking Changes
- Import paths changed: Update your imports to use the new package structure
- Function locations: Options moved to
optionspackage, similarity functions tosimilaritypackage - API compatibility: Core functionality remains the same, only import paths changed
🔧 Migration Guide
- Update imports to use
options.With*()functions - Update similarity function calls to use
similarity.*Similarity - All other API usage remains identical
🛠️ Development
- Zero linting issues (
golangci-lint run) - All tests passing (
go test ./...) - Clean modular architecture
- Ready for production use
📦 Installation
go get github.com/botirk38/semanticcache@v0.3.0